Nokogiri affected by libxslt Use of Uninitialized Resource/Use After Free vulnerability
Published 24 May 2022 · Updated 9 Jun 2026
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.10.5
- Fixed in
- 1.10.5
bundle update --conservative nokogiri # Gemfile: '>= 1.10.5'Details
In xsltCopyText in transform.c in libxslt 1.1.33, a pointer variable isn't reset under certain circumstances. If the relevant memory area happened to be freed and reused in a certain way, a bounds check could fail and memory outside a buffer could be written to, or uninitialized data could be disclosed.
Nokogiri prior to version 1.10.5 contains a vulnerable version of libxslt. Nokogiri version 1.10.5 upgrades the dependency to libxslt 1.1.34, which contains a patch for this issue.
Is GHSA-242x-7cm6-4w8j 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-2019-18197
- Linkgithub.com/sparklemotion/nokogiri/issues/1943
- Linkaccess.redhat.com/errata/RHSA-2020:0514
- Linkbugs.chromium.org/p/oss-fuzz/issues/detail?id=15746
- Linkbugs.chromium.org/p/oss-fuzz/issues/detail?id=15768
- Linkbugs.chromium.org/p/oss-fuzz/issues/detail?id=15914
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2019-18197.yml
- Packagegithub.com/sparklemotion/nokogiri
- Linkgithub.com/sparklemotion/nokogiri/blob/01ab95f3e37429ed8d3b380a8d2f73902eb325d9/CHANGELOG.md?plain=1#L934
- Linkgitlab.gnome.org/GNOME/libxslt/commit/2232473733b7313d67de8836ea3b29eec6e8e285
- Linklists.debian.org/debian-lts-announce/2019/10/msg00037.html
- Linksecurity.netapp.com/advisory/ntap-20191031-0004
- Linksecurity.netapp.com/advisory/ntap-20200416-0004
- Linkusn.ubuntu.com/4164-1
- Linkwww.oracle.com/security-alerts/cpuapr2020.html
- Linklists.opensuse.org/opensuse-security-announce/2020-02/msg00010.html
- Linklists.opensuse.org/opensuse-security-announce/2020-02/msg00015.html
- Linklists.opensuse.org/opensuse-security-announce/2020-02/msg00025.html
- Linklists.opensuse.org/opensuse-security-announce/2020-05/msg00062.html
- Linkwww.openwall.com/lists/oss-security/2019/11/17/2
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.