Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-57236: CWE-416: Use After Free in sparklemotion nokogiri

0
Low
VulnerabilityCVE-2026-57236cvecve-2026-57236cwe-416
Published: 06/25/2026 (06/25/2026, 14:29:14 UTC)
Source: CVE Database V5
Vendor/Project: sparklemotion
Product: nokogiri

Description

Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling Document#encoding= with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call to Document#encoding reads invalid memory, which can cause a segfault or leak freed bytes into a Ruby String. Affects the CRuby (libxml2) implementation only; JRuby is not affected. This vulnerability is fixed in 1.19.4.

CVSS v4.0

Score 1.7low

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U

Affected software

nokogiri
pkg:gem/nokogiri
Affected versions
<1.19.4

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 06/25/2026, 15:01:52 UTC

Technical Analysis

CVE-2026-57236 is a use-after-free vulnerability in the Nokogiri XML and HTML library for Ruby. When Document#encoding= is called with an invalid encoding (such as a non-string or a string containing a null byte) in versions prior to 1.19.4, the current encoding string is freed without being replaced. This leaves the document referencing freed memory, causing subsequent calls to Document#encoding to read invalid memory. This can result in a segmentation fault or leaking freed bytes into a Ruby String. The vulnerability affects only the CRuby implementation using libxml2 and does not impact JRuby. The issue is resolved in Nokogiri version 1.19.4.

Potential Impact

The vulnerability can cause application crashes (segmentation faults) or memory leakage due to use-after-free conditions when handling invalid encoding inputs. This may affect application stability but does not indicate direct remote code execution or data corruption beyond memory leakage. No known exploits are reported in the wild.

Mitigation Recommendations

Upgrade Nokogiri to version 1.19.4 or later, where this use-after-free vulnerability is fixed. No other mitigation is indicated or required.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-24T02:21:33.812Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a3d3f304853345fc113d182

Added to database: 06/25/2026, 14:46:08 UTC

Last enriched: 06/25/2026, 15:01:52 UTC

Last updated: 06/25/2026, 20:18:07 UTC

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses