Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. nokogiri
  4. ›
  5. CVE-2022-40304

CVE-2022-40304: Improper Restriction of XML External Entity Reference

November 23, 2022 (updated November 9, 2023)

An issue was discovered in Nogokiri’s vendored libxml2 library. Certain invalid XML entity definitions can corrupt a hash table key, potentially leading to subsequent logic errors. In one case, a double-free can be provoked.

References

  • nokogiri.org/CHANGELOG.html
  • nvd.nist.gov/vuln/detail/CVE-2022-40304

Code Behaviors & Features

Detect and mitigate CVE-2022-40304 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.13.9

Fixed versions

  • 1.13.9

Solution

Upgrade to version 1.13.9 or above.

Impact 7.8 HIGH

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-415: Double Free

Source file

gem/nokogiri/CVE-2022-40304.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:24 +0000.