CVE-2026-57234: Nokogiri JRuby NONET Bypass Enables SSRF/XXE Attacks
Nokogiri, a widely-used Ruby library for parsing XML and HTML, has a flaw in its JRuby implementation that bypasses a security setting meant to prevent external network access during schema parsing. An attacker with authenticated access could craft a malicious schema file that, when parsed, fetches resources from attacker-controlled servers. This could enable Server-Side Request Forgery (SSRF) or XML External Entity (XXE) attacks, potentially leaking sensitive data or compromising internal systems. The vulnerability affects JRuby users only; the standard Ruby implementation is not impacted. The issue is resolved in version 1.19.4.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 2.6 LOW · CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
- Weaknesses (CWE)
- CWE-178, CWE-184, CWE-611
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-25 / 2026-06-26
NVD description (verbatim)
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, the NONET parse option, which Nokogiri turns on by default for Nokogiri::XML::Schema (see CVE-2020-26247), was not correctly enforced on the JRuby implementation. As a result, a schema parsed with default options could still cause external resources to be fetched over the network, potentially enabling SSRF or XXE attacks. This vulnerability is fixed in 1.19.4.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The NONET (No Network) parse option in Nokogiri is designed to disable external resource resolution during XML/HTML schema parsing—a hardening measure introduced to address CVE-2020-26247. In the standard Ruby implementation, this restriction is enforced correctly. However, the JRuby version of Nokogiri does not properly enforce the NONET flag when parsing schemas with default options, allowing the underlying JRuby XML parser to still resolve external entities and fetch network resources. An authenticated user with the ability to influence which schema is parsed could exploit this to trigger SSRF attacks (forcing the server to contact internal or external targets) or XXE attacks (extracting data via entity expansion). The vulnerability requires both authentication and user interaction (schema selection), which constraints the attack surface.
Business impact
Organizations using Nokogiri on JRuby in production environments that parse untrusted XML schemas face potential information disclosure and lateral movement risks. If an attacker can provide or influence a schema file, they could trigger outbound requests to probe internal networks, access internal metadata services, or exfiltrate data embedded in XML responses. In containerized or cloud environments, this could lead to exposure of credentials or secrets stored in environment variables or metadata endpoints. The impact is amplified in multi-tenant systems where one tenant's malicious schema could compromise others. However, the requirement for authentication and user interaction limits the severity in typical deployments.
Affected systems
Ruby applications using Nokogiri versions prior to 1.19.4 on the JRuby runtime are affected. Standard Ruby (MRI) users are not vulnerable. The risk is highest in services that accept XML schema uploads or allow users to specify schema sources (e.g., API validation layers, data integration platforms, or XML processing microservices). JRuby deployments are less common than standard Ruby but are used in organizations leveraging Java Virtual Machine infrastructure or requiring Java interoperability.
Exploitability
Exploitation requires authentication and relies on user interaction—specifically, the ability to influence which schema is parsed or to provide a schema directly to the application. No remote unauthenticated attack is possible. The attacker must craft a schema file containing entity references or external DTD declarations designed to trigger network access. This is not an easy, one-click exploitation scenario; it demands application-level access and knowledge of how the target application processes schemas. The CVSS vector (AV:N/AC:H/PR:L/UI:R) reflects these constraints: network-accessible but high attack complexity, authenticated, and requiring user interaction.
Remediation
Upgrade Nokogiri to version 1.19.4 or later. For JRuby-dependent applications, this is a straightforward dependency bump in your Gemfile or gemspec. After patching, verify that your application no longer instantiates Nokogiri::XML::Schema with untrusted input, and consider implementing additional application-level controls such as schema validation, sandboxing, or allowlisting trusted schemas. Teams unable to upgrade immediately should restrict which users or systems can supply XML schemas to the application.
Patch guidance
Update the Nokogiri gem to 1.19.4 or any subsequent version. In a Gemfile, change `gem 'nokogiri'` to `gem 'nokogiri', '>= 1.19.4'` or pin to a specific patch like `gem 'nokogiri', '~> 1.19.4'`. Run `bundle update nokogiri` to install. Verify the new version with `bundle list nokogiri` and confirm your application uses JRuby (check `ruby --version` output for 'jruby'). Testing on a staging environment before production deployment is recommended to ensure no behavioral changes affect schema validation workflows.
Detection guidance
Monitor application logs for unusual schema parsing activity or external network connections initiated during XML schema processing. If using JRuby, search your dependency manifest (Gemfile.lock) for Nokogiri versions < 1.19.4. Establish a code review checklist to flag any application code that passes user-supplied input directly to Nokogiri::XML::Schema.new(). Network monitoring tools can detect outbound connections from application servers that occur during schema parsing—anomalies warrant investigation. In CI/CD pipelines, add a step to verify Nokogiri version and fail builds if a vulnerable version is detected.
Why prioritize this
Despite a low CVSS score, this vulnerability merits attention for JRuby shops because it undermines a deliberate security control (NONET). The disclosure corrects a regression—the feature was supposed to prevent exactly this attack. Any organization relying on schema parsing as a security boundary should prioritize patching. However, this is not an emergency patch for MRI-only shops or applications that never parse untrusted schemas. Prioritization should be risk-based: high for JRuby users with user-supplied schemas, low for closed environments with static, trusted schemas.
Risk score, explained
The CVSS score of 2.6 (LOW) reflects a narrow attack surface: authentication is required, attack complexity is high, and user interaction is necessary. The impact is limited to confidentiality (potential data leak); integrity and availability are not affected. However, this score does not capture the contextual severity—in applications where schema injection is feasible, the actual risk is higher. The CWE references (CWE-178 Improper Handling of Case Sensitivity, CWE-184 Incomplete List of Disallowed Inputs, CWE-611 Improper Restriction of XML External Entity Reference) underscore the nature of the flaw: a logic error in enforcing restrictions across runtime implementations.
Frequently asked questions
Does this affect standard Ruby (MRI) users?
No. This vulnerability is specific to the JRuby implementation of Nokogiri. Standard Ruby users are not affected and do not need to upgrade for this particular flaw, though staying current with security patches is always recommended.
What if our application doesn't parse user-supplied schemas?
Your risk is lower, but not zero. If your application parses XML documents that reference external schemas, or if any code path could be influenced to load a schema from an attacker-controlled source, you remain exposed. Review your code to confirm all schema sources are trusted and static.
Can this be exploited without authentication?
No. The CVSS vector requires authenticated access (PR:L). An attacker must have valid application credentials or be an authenticated user of your system. Fully unauthenticated remote exploitation is not possible.
Are there workarounds if we can't upgrade immediately?
Limit which users or systems can supply or influence schema input. Implement allowlists of trusted schema sources. Disable user-driven schema uploads if not essential. Sandbox or isolate JRuby processes to limit the damage from SSRF. However, these are temporary measures; patching should be prioritized within your normal update cycle.
This analysis is based on the publicly disclosed vulnerability details as of the publication date. No exploit code, proof-of-concept, or weaponized attack techniques are provided. Organizations should validate patch applicability against their specific Nokogiri version and runtime environment before deployment. This assessment assumes the Nokogiri advisory and CVSS vector are accurate; always verify against the official vendor security bulletin. The vulnerability's real-world severity may differ based on application architecture and threat model. This explainer does not constitute professional security or legal advice. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-44367LOWKlaw Username Case Sensitivity DoS and Account Lockout
- CVE-2026-49383LOWIntelliJ IDEA UI Designer XML External Entity (XXE) Information Disclosure
- CVE-2026-8404LOWDjango Cache-Control Case-Sensitivity Bypass (Low Severity)
- CVE-2025-58175MEDIUMGeoServer SSRF Vulnerability in Proxy Configuration
- CVE-2026-12788MEDIUMXXE Vulnerability in zhilink ADP Platform 1.0.0 – Authentication Required
- CVE-2026-40991MEDIUMSpring REST Docs XXE Injection in Remote API Documentation
- CVE-2026-40998HIGHSpring Web Services XXE via Jaxp13XPathTemplate – Patch Guidance
- CVE-2026-44020HIGHXXE Vulnerability in Docling USPTO Patent Parser