CVE-2021-47996
Received Received - Intake

Memory Leak and Buffer Overflow in Nokogiri

Vulnerability report for CVE-2021-47996, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-25

Last updated on: 2026-08-25

Assigner: VulnCheck

Description

Nokogiri before 1.11.4 (CRuby implementation only, when the packaged/vendored libxml2 is used) bundles libxml2 2.9.10, which is affected by multiple vulnerabilities addressed in libxml2 2.9.12, including a memory leak in xmlSchemaValidateStream (CVE-2019-20388), a global buffer over-read in xmlEncodeEntitiesInternal (CVE-2020-24977), a heap-based buffer overflow (CVE-2021-3517), and an out-of-bounds read (CVE-2021-3518). Processing crafted XML documents may lead to denial of service, information disclosure, or memory corruption.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-25
Last Modified
2026-08-25
Generated
2026-08-25
AI Q&A
2026-08-25
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 4 associated CPEs
Vendor Product Version / Range
sparklemotion nokogiri to 1.11.4 (exc)
nokogiri nokogiri to 1.11.4 (exc)
gnome libxml2 2.9.10
gnome libxml2 2.9.12

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-119 The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2021-47996 affects Nokogiri versions before 1.11.4 when using its bundled libxml2 library. It involves multiple vulnerabilities in libxml2 2.9.10, including memory leaks, buffer overflows, and out-of-bounds reads. These flaws can cause denial of service, information disclosure, or memory corruption when processing crafted XML documents.

Detection Guidance

Check Nokogiri version with gem list nokogiri. If using packaged libxml2, verify version with xml2-config --version. Systems using libxml2 2.9.10 or earlier are vulnerable.

Impact Analysis

This vulnerability may allow attackers to crash applications, leak sensitive data, or execute arbitrary code by exploiting flaws in XML processing. Systems using vulnerable Nokogiri versions with bundled libxml2 are at risk if they process untrusted XML input.

Compliance Impact

This vulnerability primarily affects systems using Nokogiri with bundled libxml2 versions before 1.11.4. While it may lead to denial of service, information disclosure, or memory corruption, the provided text does not specify direct impacts on GDPR or HIPAA compliance. Compliance risks would depend on how the affected XML processing is used in systems handling regulated data.

Mitigation Strategies

Upgrade Nokogiri to version 1.11.4 or later using gem install nokogiri -v 1.11.4. If using system libxml2, update via your OS package manager.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2021-47996. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart