CVE-2020-26247: XXE in Nokogiri

Published Dec 30, 2020
·
Updated

Severity

Nokogiri maintainers have evaluated this as Low Severity (CVSS3 2.6).

Description

In Nokogiri versions <= 1.11.0.rc3, XML Schemas parsed by Nokogiri::XML::Schema are trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks.

This behavior is counter to the security policy followed by Nokogiri maintainers, which is to treat all input as untrusted by default whenever possible.

Please note that this security fix was pushed into a new minor version, 1.11.x, rather than a patch release to the 1.10.x branch, because it is a breaking change for some schemas and the risk was assessed to be "Low Severity".

Affected Versions

Nokogiri <= 1.10.10 as well as prereleases 1.11.0.rc1, 1.11.0.rc2, and 1.11.0.rc3

Mitigation

There are no known workarounds for affected versions. Upgrade to Nokogiri 1.11.0.rc4 or later.

If, after upgrading to 1.11.0.rc4 or later, you wish to re-enable network access for resolution of external resources (i.e., return to the previous behavior):

1. Ensure the input is trusted. Do not enable this option for untrusted input. 2. When invoking the Nokogiri::XML::Schema constructor, pass as the second parameter an instance of Nokogiri::XML::ParseOptions with the NONET flag turned off.

So if your previous code was:

ruby in v1.11.0.rc3 and earlier, this call allows resources to be accessed over the network but in v1.11.0.rc4 and later, this call will disallow network access for external resources schema = Nokogiri::XML::Schema.new(schema)

in v1.11.0.rc4 and later, the following is equivalent to the code above (the second parameter is optional, and this demonstrates its default value) schema = Nokogiri::XML::Schema.new(schema, Nokogiri::XML::ParseOptions::DEFAULTSCHEMA)

Then you can add the second parameter to indicate that the input is trusted by changing it to:

ruby in v1.11.0.rc3 and earlier, this would raise an ArgumentError but in v1.11.0.rc4 and later, this allows resources to be accessed over the network schema = Nokogiri::XML::Schema.new(trustedschema, Nokogiri::XML::ParseOptions.new.nononet)

References

- This issue's public advisory - Original Hackerone report (private) - OWASP description of XXE attackProcessing) - OWASP description of SSRF attack

Credit

This vulnerability was independently reported by @eric-therond and @gucki.

The Nokogiri maintainers would like to thank HackerOne for providing a secure, responsible mechanism for reporting, and for providing their fantastic service to us.

Other sources

In Nokogiri before version 1.11.0.rc4 there is an XXE vulnerability. XML Schemas parsed by Nokogiri::XML::Schema are trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks.

References:

https://github.com/sparklemotion/nokogiri/commit/9c87439d9afa14a365ff13e73adc809cb2c3d97b https://github.com/sparklemotion/nokogiri/releases/tag/v1.11.0.rc4 https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-vr8q-g5c7-m54m https://hackerone.com/reports/747489 https://rubygems.org/gems/nokogiri

Red Hat

Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. In Nokogiri before version 1.11.0.rc4 there is an XXE vulnerability. XML Schemas parsed by Nokogiri::XML::Schema are trusted by default, allowing external resources to be accessed over the network, potentially enabling XXE or SSRF attacks. This behavior is counter to the security policy followed by Nokogiri maintainers, which is to treat all input as untrusted by default whenever possible. This is fixed in Nokogiri version 1.11.0.rc4.

MITRE

Affected Software

8 affected componentsFixes available
rubygems/nokogiri<=1.10.10
1.11.0
redhat/rubygem-nokogiri<1.11.0.
1.11.0.
Nokogiri Nokogiri Ruby<1.11.0
Nokogiri Nokogiri Ruby=1.11.0-rc1
Nokogiri Nokogiri Ruby=1.11.0-rc2
Nokogiri Nokogiri Ruby=1.11.0-rc3
Debian Debian Linux=9.0
Debian Debian Linux=10.0

Event History

Dec 30, 2020
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Advisory Published
06:35 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2020-26247?

The severity of CVE-2020-26247 is Low (CVSS3 2.6).

2

How does CVE-2020-26247 affect Nokogiri?

CVE-2020-26247 affects Nokogiri versions <= 1.11.0.rc3.

3

What is the remedy for CVE-2020-26247?

The remedy for CVE-2020-26247 is to update Nokogiri to version 1.11.0.

4

What is the reference for CVE-2020-26247?

The references for CVE-2020-26247 are: [GitHub Advisory](https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-vr8q-g5c7-m54m), [GitHub Commit](https://github.com/sparklemotion/nokogiri/commit/9c87439d9afa14a365ff13e73adc809cb2c3d97b), [HackerOne Report](https://hackerone.com/reports/747489).

5

What is the Common Weakness Enumeration (CWE) associated with CVE-2020-26247?

The Common Weakness Enumeration (CWE) associated with CVE-2020-26247 are CWE-918 and CWE-611.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2020-26247 - XXE in Nokogiri - SecAlerts