Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. nokogiri
  4. ›
  5. GHSA-phwj-rprq-35pp

GHSA-phwj-rprq-35pp: Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=`

June 19, 2026

Nokogiri’s CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an XML attribute. If Ruby code had already accessed an attribute child node, Nokogiri::XML::Attr#value= could free the underlying native child node while the wrapper remained reachable through the document node cache. A later use of the freed child node or a Ruby GC mark could dereference an invalid pointer, causing an invalid read and a possible segfault.

Nokogiri 1.19.4 preserves any already-wrapped attribute child nodes before replacing the attribute value.

JRuby is not affected.

References

  • github.com/advisories/GHSA-phwj-rprq-35pp
  • github.com/sparklemotion/nokogiri/security/advisories/GHSA-phwj-rprq-35pp

Code Behaviors & Features

Detect and mitigate GHSA-phwj-rprq-35pp 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.19.4

Fixed versions

  • 1.19.4

Solution

Upgrade to version 1.19.4 or above.

Impact 5.3 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-416: Use After Free
  • CWE-825: Expired Pointer Dereference

Source file

gem/nokogiri/GHSA-phwj-rprq-35pp.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:03 +0000.