CVE-2021-3518
Nokogiri Implements libxml2 version vulnerable to use-after-free
Also known as GHSA-v4f8-2847-rwm7
Mitigation
- Upgrade nokogiri to 1.11.4 or later.
Who should check
- Projects that depend on RubyGems package nokogiri (< 1.11.4)
- Anyone running libxml2 libxml2 2.9.11
Vulnerability facts
- Affected
- nokogiri < 1.11.4
- Fixed in
- 1.11.4
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 8.8 (v3.1, NVD)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 18.87% chance of exploitation in 30 days (percentile 98, 2026-11-26)
- CWE
- CWE-416
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| RubyGems nokogiri | < 1.11.4 | 1.11.4 | osv |
| libxml2 | libxml2 2.9.11 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-3518. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-3518.md Affected: nokogiri < 1.11.4 Fixed in: 1.11.4 Steps: 1. Search this machine and project for nokogiri (RubyGems), libxml2: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QVM4UJ3376I6ZVOYMHBNX4GY3NIV52WV/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BZOMV5J4PMZAORVT64BKLV6YIZAFDGX6/
- https://security.gentoo.org/glsa/202107-05
- https://nvd.nist.gov/vuln/detail/CVE-2021-3518
Patches
Other
- https://lists.debian.org/debian-lts-announce/2021/05/msg00008.html
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
- https://security.netapp.com/advisory/ntap-20210625-0002/
- http://seclists.org/fulldisclosure/2021/Jul/58
- http://seclists.org/fulldisclosure/2021/Jul/54
- http://seclists.org/fulldisclosure/2021/Jul/55
- http://seclists.org/fulldisclosure/2021/Jul/59
- https://support.apple.com/kb/HT212605
- https://support.apple.com/kb/HT212602
- https://support.apple.com/kb/HT212601
- https://support.apple.com/kb/HT212604
- https://www.oracle.com/security-alerts/cpujul2022.html
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://security.netapp.com/advisory/ntap-20210625-0002
- https://nokogiri.org/CHANGELOG.html#1114-2021-05-14
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QVM4UJ3376I6ZVOYMHBNX4GY3NIV52WV
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BZOMV5J4PMZAORVT64BKLV6YIZAFDGX6
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4@%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b@%3Cissues.bookkeeper.apache.org%3E
- https://github.com/sparklemotion/nokogiri/blob/2edbbef95f1dc12c1ddc5ebda71b9159026245fe/CHANGELOG.md?plain=1#L722
- https://github.com/sparklemotion/nokogiri
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2021-3518.yml
FAQ
Is CVE-2021-3518 being exploited?
There is no confirmed exploitation: CVE-2021-3518 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 18.87% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-3518?
High: CVSS 8.8 (v3.1, scored by NVD). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2021-3518?
nokogiri < 1.11.4.
Is there a fix for CVE-2021-3518?
Yes. Fixed in 1.11.4. Upgrade nokogiri to 1.11.4 or later.
How do I check if I'm affected by CVE-2021-3518?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.