CVE-2026-29975

Infinite Loop in lwjson Streaming Parser Causing Denial of Service

Published May 8, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
lwjson 1.8.1 contains an improper input validation vulnerability in the streaming JSON parser (lwjson_stream.c). The end-of-string detection logic incorrectly identifies escaped quote characters by only checking the immediately preceding character rather than counting consecutive backslashes, causing valid JSON strings ending with an escaped backslash (like "\\") to never terminate parsing. A remote attacker can send well-formed JSON to cause applications using lwjson_stream_parse() to hang indefinitely, resulting in denial of service.

Analysis

AI-generated

Technical impact

The vulnerability arises from improper input validation in lwjson's streaming JSON parser. The parser incorrectly handles escaped quote characters, only examining the preceding character rather than counting consecutive backslashes. This flaw maps to CWE‑835 (Infinite Loop). Consequently, JSON strings that end in an escaped backslash never terminate, causing the parser to loop indefinitely. A remote attacker can send a crafted, well‑formed JSON payload containing such a string to trigger an indefinite hang in any application that uses lwjson_stream_parse(), resulting in denial of service.

Affected Systems

This defect is present in applications that link against lwjson version 1.8.1. The affected code resides in the lwjson_stream.c file of the lwjson project repository. No specific commercial vendors are listed, but any software that embeds this library at compile time is susceptible.

Risk and Exploitability

The CVE has a CVSS score of 7.5 and the EPSS score is not available. The vulnerability is not in the CISA KEV catalog, indicating no confirmed exploitation yet. The attack vector is inferred to be remote: a malicious JSON payload sent over a network interface can trigger the infinite loop, making the process unresponsive. The impact is limited to availability, but any service that cannot recover from a hung parsing routine faces significant disruption.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a patched version of lwjson if one is released.
  • If an upgrade is not possible, manually patch lwjson_stream.c to count consecutive backslashes correctly or add a timeout to the parsing routine.
  • Implement application‑level safeguards such as binding the parsing operation to a separate thread with a resource limit or employing a watchdog timer to detect and recover from hangs.

Generated by OpenCVE AI on May 8, 2026 at 22:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Majerle
Majerle lwjson
Vendors & Products Majerle
Majerle lwjson
Type Values Removed Values Added
Title Infinite Loop in lwjson Streaming Parser Causing Denial of Service
Type Values Removed Values Added
Title Improper String Parsing Leads to Application Hang in lwjson Streaming Parser
Weaknesses CWE-679
Type Values Removed Values Added
Title Improper String Parsing Leads to Application Hang in lwjson Streaming Parser
Weaknesses CWE-679
Type Values Removed Values Added
Weaknesses CWE-835
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description lwjson 1.8.1 contains an improper input validation vulnerability in the streaming JSON parser (lwjson_stream.c). The end-of-string detection logic incorrectly identifies escaped quote characters by only checking the immediately preceding character rather than counting consecutive backslashes, causing valid JSON strings ending with an escaped backslash (like "\\") to never terminate parsing. A remote attacker can send well-formed JSON to cause applications using lwjson_stream_parse() to hang indefinitely, resulting in denial of service.
References
Weaknesses
  • CWE-835

    Loop with Unreachable Exit Condition ('Infinite Loop')

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
May 8, 2026, 6:07 PM
Reserved
Mar 4, 2026, 12:00 AM
Status
Deferred
Published
May 8, 2026, 4:16 PM
Modified
Jun 17, 2026, 10:29 AM