CVE-2022-50998: Nokogiri before 1.13.9 Multiple Vulnerabilities via libxml2
Nokogiri before 1.13.9 (CRuby implementation using packaged libraries) bundles libxml2 v2.9.14, which is affected by CVE-2022-40304 (data corruption / double-free from an entity reference cycle when entity content is allocated from a dict) and CVE-2022-40303 (integer overflows when parsing with XMLPARSEHUGE). Nokogiri 1.13.9 upgrades the packaged libxml2 to v2.10.3 to address these issues. Processing crafted XML input may lead to denial of service or memory corruption. (The advisory also references CVE-2022-2309, a NULL pointer dereference via iterwalk/canonicalize, which maintainers determined does not affect Nokogiri users.)
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Nokogirito a version that resolves this vulnerability.Fixed in 1.13.9 - Compensating control
When possible, avoid processing crafted/untrusted XML input; limit or sanitize XML sources to reduce the risk of denial of service or memory corruption triggered by the affected libxml2 versions bundled with Nokogiri prior to 1.13.9.