VDB
Sign up
LOW3.7

GHSA-v995-44v6-5fqm

JRuby: NONET is bypassed for external DTDs and entities when the systemId uses a short-form IPv4 host

Quick fix

GHSA-v995-44v6-5fqm — nokogiri: upgrade to the fixed version with the command below.

bundle update nokogiri

Details

### Summary

On JRuby, the `NONET` parse option did not block an external DTD or entity whose system identifier used a short-form IPv4 host, such as `http://127.1/` or `http://169.254.43518/`, or was an absolute path such as `/x.dtd` in a document parsed from a network URL. An application that parses untrusted XML with `DTDLOAD`, `DTDVALID` or `NOENT` could be made to send network requests, potentially enabling SSRF.

Nokogiri 1.19.5 applies the `XML::Schema` check from [GHSA-8678-w3jw-xfc2](https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-8678-w3jw-xfc2): with `NONET` set, only local resources are loaded.

Only JRuby is affected. Default parse options are not affected.

### Severity

The Nokogiri maintainers have evaluated this as low severity.

### Mitigation

Upgrade to Nokogiri 1.19.5 or later, or do not enable `DTDLOAD`, `DTDVALID` or `NOENT` for untrusted input.

### Credit

This issue was responsibly reported by @arpitjain099.

Are you affected?

Enter the version of the package you're using.

Affected packages

RubyGems/nokogiri
Introduced in: 0Fixed in: 1.19.5
Fixbundle update nokogiri

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:gem/nokogiri"]}'