Loading vulnerability details...
| Property | Value |
|---|---|
| Advisory ID | SGZ-2026-EF6B4 |
| Severity | HIGH |
| CWE | CWE-611 |
| Confidence | 92% |
| Category | logic_flaw |
| Exploitability | likely |
| Package | 472edf42-5c9f-4cd4-b026-21de5585a226@latest (maven) |
| Location | ext/java/nokogiri/internals/XmlDomParserContext.java:71-74 |
| Affected Functions | initParser, setFeature |
| Attack Vector | NETWORK |
| Attack Complexity | LOW |
| Privileges Required | NONE |
| Discovered By | SafeGuard Zero-Day AI Discovery Engine |
The parser enables loading of external DTDs based on the user-controlled option options.dtdLoad. When enabled, an attacker can supply a malicious XML payload containing external entity references that cause the parser to fetch arbitrary resources, leading to SSRF, data exfiltration, or local file disclosure. Although a SecurityManager is set, the limits may be insufficient to fully mitigate crafted payloads.
The vulnerability was identified in the file ext/java/nokogiri/internals/XmlDomParserContext.java at lines 71-74 within the 472edf42-5c9f-4cd4-b026-21de5585a226 package (version latest). The following functions are directly affected: initParser, setFeature. Any code path that invokes these functions inherits this vulnerability.
File: ext/java/nokogiri/internals/XmlDomParserContext.java (lines 71-74)
setFeature(FEATURE_LOAD_EXTERNAL_DTD, options.dtdLoad);
setFeature(FEATURE_LOAD_DTD_GRAMMAR, options.dtdLoad);
parser.setEntityResolver(new NokogiriEntityResolver(runtime, errorHandler, options));
The code above demonstrates the vulnerable pattern. This code is executed at runtime and can be directly exploited by an attacker with the appropriate access level.
Provide an XML document with a DOCTYPE that defines an external entity referencing a remote URL (e.g., http://attacker.com/evil) or a file URI (file:///etc/passwd). Send this payload to the vulnerable parsing method with options.dtdLoad set to true. The parser will resolve the entity, causing the server to make an outbound request or read local files.
Remote server can be forced to make arbitrary network requests (SSRF) or read local files, leading to data leakage or further compromise.
Disable external DTD loading by default (options.dtdLoad = false). Enforce secure processing by setting the Xerces feature http://apache.org/xml/features/disallow-doctype-decl to true, and disable XInclude. Additionally, keep the SecurityManager limits and consider using a hardened XML parser library.
Advisory: SGZ-2026-EF6B4 | Source: SafeGuard Zero-Day AI Discovery | Status: Candidate
This vulnerability was autonomously discovered by SafeGuard's AI-powered Zero-Day Discovery engine using TAOR (Think-Act-Observe-Repeat) agentic analysis on the package source code. It is not yet tracked in any public vulnerability database (CVE, NVD, GHSA, OSV). This finding should be triaged by a security engineer and, if confirmed, reported upstream to the package maintainer.
| Property | Value |
|---|---|
| Advisory ID | SGZ-2026-EF6B4 |
| Severity | HIGH |
| CWE | CWE-611 |
| Confidence | 92% |
| Category | logic_flaw |
| Exploitability | likely |
| Package | 472edf42-5c9f-4cd4-b026-21de5585a226@latest (maven) |
| Location | ext/java/nokogiri/internals/XmlDomParserContext.java:71-74 |
| Affected Functions | initParser, setFeature |
| Attack Vector | NETWORK |
| Attack Complexity | LOW |
| Privileges Required | NONE |
| Discovered By | SafeGuard Zero-Day AI Discovery Engine |
The parser enables loading of external DTDs based on the user-controlled option options.dtdLoad. When enabled, an attacker can supply a malicious XML payload containing external entity references that cause the parser to fetch arbitrary resources, leading to SSRF, data exfiltration, or local file disclosure. Although a SecurityManager is set, the limits may be insufficient to fully mitigate crafted payloads.
The vulnerability was identified in the file ext/java/nokogiri/internals/XmlDomParserContext.java at lines 71-74 within the 472edf42-5c9f-4cd4-b026-21de5585a226 package (version latest). The following functions are directly affected: initParser, setFeature. Any code path that invokes these functions inherits this vulnerability.
File: ext/java/nokogiri/internals/XmlDomParserContext.java (lines 71-74)
setFeature(FEATURE_LOAD_EXTERNAL_DTD, options.dtdLoad);
setFeature(FEATURE_LOAD_DTD_GRAMMAR, options.dtdLoad);
parser.setEntityResolver(new NokogiriEntityResolver(runtime, errorHandler, options));
The code above demonstrates the vulnerable pattern. This code is executed at runtime and can be directly exploited by an attacker with the appropriate access level.
Provide an XML document with a DOCTYPE that defines an external entity referencing a remote URL (e.g., http://attacker.com/evil) or a file URI (file:///etc/passwd). Send this payload to the vulnerable parsing method with options.dtdLoad set to true. The parser will resolve the entity, causing the server to make an outbound request or read local files.
Remote server can be forced to make arbitrary network requests (SSRF) or read local files, leading to data leakage or further compromise.
Disable external DTD loading by default (options.dtdLoad = false). Enforce secure processing by setting the Xerces feature http://apache.org/xml/features/disallow-doctype-decl to true, and disable XInclude. Additionally, keep the SecurityManager limits and consider using a hardened XML parser library.
Advisory: SGZ-2026-EF6B4 | Source: SafeGuard Zero-Day AI Discovery | Status: Candidate
This vulnerability was autonomously discovered by SafeGuard's AI-powered Zero-Day Discovery engine using TAOR (Think-Act-Observe-Repeat) agentic analysis on the package source code. It is not yet tracked in any public vulnerability database (CVE, NVD, GHSA, OSV). This finding should be triaged by a security engineer and, if confirmed, reported upstream to the package maintainer. This vulnerability involves weaknesses in
This high-severity vulnerability could allow attackers to gain unauthorized access, execute arbitrary code, or compromise data integrity. Prompt remediation is strongly recommended.
Isolate affected systems from untrusted networks until patching is complete
Implement enhanced monitoring for exploitation attempts and unusual behavior