CVEfocus › CVE database › CVE-2022-23476

CVE-2022-23476Unchecked return value from xmlTextReaderExpand in Nokogiri

CVSS 7.5 HighEPSS 2.1% (higher than 82% of CVEs)Published 2022-12-08Updated 2025-04-23Assigner: GitHub_M

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.

CWE-252CWE-476

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

13Fixed
2Fix pending
1Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04ruby-nokogiriNot affected
vulnerable_code_not_present
Ubuntu 18.04ruby-nokogiriFix pending
Ubuntu 16.04ruby-nokogiriFix pending
Debian 14ruby-nokogiriFixed1.13.10+dfsg-1DEBIAN-CVE-2022-23476
Debian 13ruby-nokogiriFixed1.13.10+dfsg-1DEBIAN-CVE-2022-23476
Debian 12ruby-nokogiriFixed1.13.10+dfsg-1DEBIAN-CVE-2022-23476
Alpine Linux 3.24ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.23ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.22ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.21ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.20ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.19ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.18ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.17ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
Alpine Linux 3.16ruby-nokogiriFixed1.13.10-r0ALPINE-CVE-2022-23476
RubyGems librarynokogiriFixed1.13.10GHSA-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.

References

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.