CVE-2022-23476Unchecked return value from xmlTextReaderExpand in Nokogiri
Nokogiri is an open source XML and HTML library for the Ruby programming language. Nokogiri `1.13.8` and `1.13.9` fail to check the return value from `xmlTextReaderExpand` in the method `Nokogiri::XML::Reader#attribute_hash`. This can lead to a null pointer exception when invalid markup is being parsed. For applications using `XML::Reader` to parse untrusted inputs, this may potentially be a vector for a denial of service attack. Users are advised to upgrade to Nokogiri `>= 1.13.10`. Users may be able to search their code for calls to either `XML::Reader#attributes` or `XML::Reader#attribute_hash` to determine if they are affected.
What to do
Fixed builds are available from Alpine, Debian, RubyGems: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | ruby-nokogiri | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | ruby-nokogiri | Fix pending | ||
| Ubuntu 16.04 | ruby-nokogiri | Fix pending | ||
| Debian 14 | ruby-nokogiri | Fixed | 1.13.10+dfsg-1 | DEBIAN-CVE-2022-23476 |
| Debian 13 | ruby-nokogiri | Fixed | 1.13.10+dfsg-1 | DEBIAN-CVE-2022-23476 |
| Debian 12 | ruby-nokogiri | Fixed | 1.13.10+dfsg-1 | DEBIAN-CVE-2022-23476 |
| Alpine Linux 3.24 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.23 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.22 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.21 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.20 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.19 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.18 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.17 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| Alpine Linux 3.16 | ruby-nokogiri | Fixed | 1.13.10-r0 | ALPINE-CVE-2022-23476 |
| RubyGems library | nokogiri | Fixed | 1.13.10 | GHSA-qv4q-mr5r-qprj |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- sparklemotion nokogiri: affected: >= 1.13.8, < 1.13.10
References
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-qv4q-mr5r-qprj
- https://github.com/sparklemotion/nokogiri/commit/85410e38410f670cbbc8c5b00d07b843caee88ce
- https://github.com/sparklemotion/nokogiri/commit/9fe0761c47c0d4270d1a5220cfd25de080350d50
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.