CVE-2025-71407: Nokogiri before 1.18.3 Stack Buffer Overflow and Use-After-Free
Nokogiri before 1.18.3 contains a stack buffer overflow vulnerability in libxml2 when reporting DTD validation errors with long QName prefixes, and a use-after-free vulnerability during validation against untrusted XML Schemas. Attackers can trigger these vulnerabilities by providing malicious DTD content or untrusted XSD files to cause denial of service or potential code execution.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Nokogirito a version that resolves this vulnerability.Fixed in 1.18.3 - Compensating control
Ensure applications do not load or validate against untrusted XML Schemas (XSD files) or malicious DTD content; only use trusted/controlled DTD/XSD inputs to prevent denial of service and potential code execution paths described for Nokogiri before 1.18.3.