{"id":"CVE-2022-29181","published":"2022-05-20T00:00:00Z","modified":"2025-05-27T14:51:01Z","title":"Improper Handling of Unexpected Data Type in Nokogiri","vendor":"sparklemotion","product":"nokogiri","tier":"tail","description":{"text":"Nokogiri is an open source XML and HTML library for Ruby. Nokogiri prior to version 1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers, allowing specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory. Version 1.13.6 contains a patch for this issue. As a workaround, ensure the untrusted input is a `String` by calling `#to_s` or equivalent.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.2,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0323,"percentile":0.88564,"provenance":"source"},"cwes":[{"id":"CWE-241","name":"Improper Handling of Unexpected Data Type"}],"references":[{"url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7","tags":["x_refsource_MISC"]},{"url":"https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267","tags":["x_refsource_MISC"]},{"url":"https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.6","tags":["x_refsource_MISC"]},{"url":"https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri","tags":["x_refsource_MISC"]},{"url":"https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/","tags":["x_transferred"]},{"url":"https://security.gentoo.org/glsa/202208-29","tags":["vendor-advisory","x_transferred"]},{"url":"https://support.apple.com/kb/HT213532","tags":["x_transferred"]},{"url":"http://seclists.org/fulldisclosure/2022/Dec/23","tags":["mailing-list","x_transferred"]}],"priority":{"score":23.5,"factors":[{"name":"EPSS percentile","points":17.71},{"name":"CVSS severity","points":5.74}]},"vendorSlug":"sparklemotion","affectedVersions":[{"vendor":"sparklemotion","product":"nokogiri","versions":["< 1.13.6"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-22T15:41:19.551410Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"nokogiri","vulnerableRanges":["<1.13.6"],"patched":["1.13.6"],"from":["GHSA-xh29-r2w5-wx8m"],"provenance":"source"}],"summary":{"text":"The Nokogiri Ruby XML and HTML library, prior to version 1.13.6, fails to type-check all inputs passed to its XML and HTML4 SAX parsers, so specially crafted input can trigger illegal memory access (segfault) or reads from unrelated memory.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:39:34Z"},"euvd":{"id":"EUVD-2022-5789","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-sparklemotion-nokogiri-cve-2021-41098","parents":[{"from":"CVE-2021-41098","to":"CVE-2022-29181","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["ext/java/nokogiri/XmlSaxParserContext.java"],"commits":["https://github.com/sparklemotion/nokogiri/commit/5bf729ff3cc84709ee3c3248c981584088bf9f6d","https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7","https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267"],"basis":"shared function","functions":["XmlSaxParserContext"]}]}],"packageHistory":[{"cve":"CVE-2021-30560","published":"2021-08-03","fixed":"1.13.2","kev":false},{"cve":"CVE-2018-25032","published":"2022-03-25","fixed":"1.13.4","kev":false},{"cve":"CVE-2022-24836","published":"2022-04-11","fixed":"1.13.4","kev":false,"link":{"from":"CVE-2022-24836","to":"CVE-2022-29181","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:nokogiri","fromFixed":"1.13.4","toFixed":"1.13.6","daysApart":39}]}},{"cve":"CVE-2022-29181","published":"2022-05-20","fixed":"1.13.6","kev":false},{"cve":"CVE-2022-23476","published":"2022-12-08","fixed":"1.13.10","kev":false},{"cve":"CVE-2026-79772","published":"2026-08-25","fixed":"1.19.1","kev":false},{"cve":"CVE-2026-79770","published":"2026-08-25","fixed":"1.19.3","kev":false}],"package":"RubyGems:nokogiri"}}