HighGHSA-v4f8-2847-rwm7CVE-2021-3518
Nokogiri Implements libxml2 version vulnerable to use-after-free
Published 24 May 2022 · Updated 9 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
nokogiriRubyGems
- Affected
- <1.11.4
- Fixed in
- 1.11.4
Update to the fixed version for your release line, for example:
bundle update --conservative nokogiri # Gemfile: '>= 1.11.4'Details
There's a flaw in libxml2 in versions before 2.9.11. An attacker who is able to submit a crafted file to be processed by an application linked with libxml2 could trigger a use-after-free. The greatest impact from this flaw is to confidentiality, integrity, and availability.
Is GHSA-v4f8-2847-rwm7 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-3518
- Linkwww.oracle.com/security-alerts/cpuoct2021.html
- Linkwww.oracle.com/security-alerts/cpujul2022.html
- Linkwww.oracle.com/security-alerts/cpuapr2022.html
- Linksupport.apple.com/kb/HT212605
- Linksupport.apple.com/kb/HT212604
- Linksupport.apple.com/kb/HT212602
- Linksupport.apple.com/kb/HT212601
- Linksecurity.netapp.com/advisory/ntap-20210625-0002
- Linksecurity.gentoo.org/glsa/202107-05
- Linknokogiri.org/CHANGELOG.html#1114-2021-05-14
- 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
- Linklists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E
- Linklists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E
- Linkgithub.com/sparklemotion/nokogiri/blob/2edbbef95f1dc12c1ddc5ebda71b9159026245fe/CHANGELOG.md?plain=1#L722
- Packagegithub.com/sparklemotion/nokogiri
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-3518.yml
- Linkbugzilla.redhat.com/show_bug.cgi?id=1954242
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.