{"id":"CVE-2022-23476","aliases":["CVE-2022-23476","GHSA-qv4q-mr5r-qprj"],"related":[],"kind":"vulnerability","state":"published","title":"Unchecked return value from xmlTextReaderExpand in Nokogiri","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nNokogiri `1.13.8, 1.13.9` fails 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. \n\nFor applications using `XML::Reader` to parse untrusted inputs, this may potentially be a vector for a denial of service attack.\n\n\n## Mitigation\n\nUpgrade to Nokogiri `>= 1.13.10`.\n\nUsers 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.\n\n\n## Severity\n\nThe Nokogiri maintainers have evaluated this as [High Severity 7.5 (CVSS3.1)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).\n\n\n## References\n\n- [CWE - CWE-252: Unchecked Return Value (4.9)](https://cwe.mitre.org/data/definitions/252.html)\n- [CWE - CWE-476: NULL Pointer Dereference (4.9)](https://cwe.mitre.org/data/definitions/476.html)\n\n\n## Credit\n\nThis vulnerability was responsibly reported by @davidwilemski.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Nokogiri es una librería XML y HTML de código abierto para el lenguaje de programación Ruby. Nokogiri `1.13.8` y `1.13.9` no pueden verificar el valor de retorno de `xmlTextReaderExpand` en el método `Nokogiri::XML::Reader#attribute_hash`. Esto puede provocar una excepción de puntero null cuando se analiza un marcado no válido. Para las aplicaciones que utilizan `XML::Reader` para analizar entradas que no son de confianza, esto puede ser potencialmente un vector para un ataque de Denegación de Servicio (DoS). Se recomienda a los usuarios actualizar a Nokogiri `&gt;= 1.13.10`. Los usuarios pueden buscar en su código llamadas a `XML::Reader#attributes` o `XML::Reader#attribute_hash` para determinar si están afectados.","source":"nvd"}],"published":"2022-12-08T03:03:24.572Z","modified":"2026-06-17T04:30:12.077Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-252","CWE-476"],"affected":[{"ranges":[{"version":">= 1.13.8, < 1.13.10","status":"affected"}],"vendor":"sparklemotion","product":"nokogiri","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.13.8","status":"affected","fixed":"1.13.10"}],"ecosystem":"RubyGems","package":"nokogiri","purl":"pkg:gem/nokogiri","source":"ghsa"},{"ranges":[{"status":"affected","version":"1.13.8"},{"status":"affected","version":"1.13.9"}],"vendor":"nokogiri","product":"nokogiri","cpe":"cpe:2.3:a:nokogiri:nokogiri:1.13.8:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-qv4q-mr5r-qprj","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/nokogiri/commit/85410e38410f670cbbc8c5b00d07b843caee88ce","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/nokogiri/commit/9fe0761c47c0d4270d1a5220cfd25de080350d50","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23476","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-23476.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/sparklemotion/nokogiri","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-04-23T15:48:08.798Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23476","url":"https://www.cve.org/CVERecord?id=CVE-2022-23476","licence":"CVE Terms of Use","modified":"2025-04-23T16:31:18.189Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qv4q-mr5r-qprj","url":"https://github.com/advisories/GHSA-qv4q-mr5r-qprj","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:18.808Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23476","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23476","licence":"Public domain","modified":"2026-06-17T04:30:12.077Z"}],"updatedAt":"2026-11-25T22:58:17.299Z","epss":{"score":0.01832,"percentile":0.79516,"date":"2026-12-01T12:00:22.000Z"}}