Nokogiri contains libxml Out-of-bounds Write vulnerability
Published 24 May 2022 · Updated 8 Mar 2024
Is your project on an affected nokogiri?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.11.4
- Fixed in
- 1.11.4
bundle update --conservative nokogiri # Gemfile: '>= 1.11.4'Details
There is a flaw in the xml entity encoding functionality of libxml2 in versions before 2.9.11. An attacker who is able to supply a crafted file to be processed by an application linked with the affected functionality of libxml2 could trigger an out-of-bounds read. The most likely impact of this flaw is to application availability, with some potential impact to confidentiality and integrity if an attacker is able to use memory information to further exploit the application.
Nokogiri prior to version 1.11.4 used a vulnerable version of libxml2. Nokogiri 1.11.4 updated libxml2 to version 2.9.11 to address this and other vulnerabilities in libxml2.
Is GHSA-jw9f-hh49-cvp9 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected nokogiri, and gives you the command that fixes it.
More advisories for nokogiri
- LowCVE-2026-126062JRuby: NONET is bypassed for external DTDs and entities when the systemId uses a short-form IPv4 host · 10 Nov 2026
- LowCVE-2026-126064Nokogiri: Use-After-Free in Nokogiri when replacing an attribute value · 10 Nov 2026
- LowCVE-2026-126063Nokogiri: Mutation XSS through `noscript` content in Nokogiri's HTML5 serializer · 10 Nov 2026
- LowCVE-2026-57435Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=` · 19 Jun 2026
- LowCVE-2026-57438Nokogiri: Possible Use-After-Free in XInclude Processing · 19 Jun 2026
- LowCVE-2026-57437Nokogiri: Possible Use-After-Free when directly using `NokogirI::XML::XPathContext` beyond document lifetime · 19 Jun 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-3517
- Linkgithub.com/sparklemotion/nokogiri/issues/2233
- Linkgithub.com/sparklemotion/nokogiri/issues/2274
- Linkwww.oracle.com/security-alerts/cpuoct2021.html
- Linkwww.oracle.com/security-alerts/cpujul2022.html
- Linkwww.oracle.com/security-alerts/cpujan2022.html
- Linkwww.oracle.com/security-alerts/cpuapr2022.html
- Linksecurity.netapp.com/advisory/ntap-20211022-0004
- Linksecurity.netapp.com/advisory/ntap-20210625-0002
- Linksecurity.gentoo.org/glsa/202107-05
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QVM4UJ3376I6ZVOYMHBNX4GY3NIV52WV
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BZOMV5J4PMZAORVT64BKLV6YIZAFDGX6
- Linklists.debian.org/debian-lts-announce/2021/05/msg00008.html
- Linkgitlab.gnome.org/GNOME/libxml2/-/commit/8598060bacada41a0eb09d95c97744ff4e428f8e
- Linkgithub.com/sparklemotion/nokogiri/blob/7c19ef5cc6b7c5c36827dd5495f857c6877ec8cf/CHANGELOG.md?plain=1#L579
- Packagegithub.com/sparklemotion/nokogiri
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-3517.yml
- Linkbugzilla.redhat.com/show_bug.cgi?id=1954232
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.