Nokogiri v1.11.0 was released on 2021-01-03, which contains a fix for
CVE-2020-26247, fully described at
https://github.com/advisories/GHSA-vr8q-g5c7-m54m. That security advisory
is reproduced here for your convenience.
Nokogiri maintainers have evaluated this as Low Severity (CVSS3 2.6)
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
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
Nokogiri <= 1.10.10 as well as prereleases 1.11.0.rc1, 1.11.0.rc2, and
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
1. Ensure the input is trusted. Do not enable this option for untrusted
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:
# 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 resourcesschema =
# 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,
Then you can add the second parameter to indicate that the input is trusted
by changing it to:
# 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 networkschema = Nokogiri::XML::Schema.new(trusted_schema,
- This issue's public advisory
- Original Hackerone report (private)
- OWASP description of XXE attack
- OWASP description of SSRF attack
The Nokogiri maintainers would like to thank HackerOne
<https://hackerone.com/nokogiri> for providing a secure, responsible
mechanism for reporting, and for providing their fantastic service to us.