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

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.83%, higher than 79% of CVEs (2026-12-01)
- Published: 2022-12-08T03:03:24.572Z
- Modified: 2026-06-17T04:30:12.077Z
- Also known as: GHSA-qv4q-mr5r-qprj
- Weaknesses: CWE-252, CWE-476
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- 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.

(As written by CVE List.)

## Affected

- sparklemotion nokogiri: >= 1.13.8, < 1.13.10
- nokogiri (RubyGems): from 1.13.8 before 1.13.10
- nokogiri nokogiri: 1.13.8; 1.13.9

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-qv4q-mr5r-qprj> (third-party-advisory, web)
- <https://github.com/sparklemotion/nokogiri/commit/85410e38410f670cbbc8c5b00d07b843caee88ce> (patch, third-party-advisory, web)
- <https://github.com/sparklemotion/nokogiri/commit/9fe0761c47c0d4270d1a5220cfd25de080350d50> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-23476> (advisory)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-23476.yml> (web)
- <https://github.com/sparklemotion/nokogiri> (package)

## Sources

- CVE List: [CVE-2022-23476](https://www.cve.org/CVERecord?id=CVE-2022-23476), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-qv4q-mr5r-qprj](https://github.com/advisories/GHSA-qv4q-mr5r-qprj), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-23476](https://nvd.nist.gov/vuln/detail/CVE-2022-23476), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-23476 · Whole record: https://cve.day/CVE-2022-23476.json · Rebuilt by cve.day 2026-11-25T22:58:17.299Z
