Skip to content
OpenAdvisories
High · 7.5 CVE-2022-23476 EUVD-2022-7725GHSA-qv4q-mr5r-qprj

Unchecked return value from xmlTextReaderExpand in Nokogiri

Published Dec 8, 2022 · Updated Apr 23, 2025 · Assigned by GitHub_M

Description

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.

Affected products

VendorProductAffectedFixed
sparklemotion nokogiri >= 1.13.8, < 1.13.10 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 ruby-nokogiri 1.13.10+dfsg-1 —
Debian 13 ruby-nokogiri 1.13.10+dfsg-1 —
Debian 12 ruby-nokogiri 1.13.10+dfsg-1 —
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed ruby3.2-rubygem-nokogiri 1.15.4-1.1 openSUSE-SU-2024:13440-1
openSUSE Tumbleweed rubygem-nokogiri 1.15.5-1.5 openSUSE-SU-2026:10356-1, openSUSE-SU-2025:14697-1, openSUSE-SU-2024:14174-1
ReleasePackageFixed inAdvisory
Alpine v3.24 ruby-nokogiri 1.13.10-r0 —
Alpine v3.23 ruby-nokogiri 1.13.10-r0 —
Alpine v3.22 ruby-nokogiri 1.13.10-r0 —
Alpine v3.21 ruby-nokogiri 1.13.10-r0 —
Alpine v3.20 ruby-nokogiri 1.13.10-r0 —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 ruby-nokogiri 1.13.10-r0 —
Alpine v3.18 ruby-nokogiri 1.13.10-r0 —
Alpine v3.17 ruby-nokogiri 1.13.10-r0 —
Alpine v3.16 ruby-nokogiri 1.13.10-r0 —

Affected packages

EcosystemPackageAffectedFixedRecord
RubyGems nokogiri >= 1.13.8, < 1.13.10 1.13.10 GHSA-qv4q-mr5r-qprj

Advisories 4

References