CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-XF7X-X43H-RPQH

GHSA-xf7x-x43h-rpqh: Denial of Service via Unconstrained Circular Reference Resolution in json-repair

Alon Barad
Alon Barad
Software Engineer

Jul 14, 2026·5 min read·11 visits

Executive Summary (TL;DR)

Unauthenticated remote attackers can cause denial of service (100 percent CPU exhaustion) by submitting circular JSON Schema references to the json-repair parser.

A Denial of Service vulnerability exists in the json-repair Python library due to an unconstrained loop during JSON Schema reference resolution. By submitting a circular JSON Schema, an attacker can trigger infinite recursion, causing 100 percent CPU exhaustion. Because this package is heavily utilized in LLM data-processing pipelines, this flaw presents a substantial threat to application availability.

Vulnerability Overview

The json-repair Python package is a utility designed to parse and repair malformed JSON structures, which is frequently integrated into workflows that process outputs from Large Language Models (LLMs). The library includes a schema-aware parser designed to correct structural JSON issues based on a provided JSON Schema definition. The vulnerability exists within the schema reference ($ref) resolution mechanism of this component.

An attacker can trigger a Denial of Service (DoS) condition by providing a maliciously crafted, circular JSON Schema containing self-referencing pointers. When the parser attempts to resolve these cyclic references, it enters an infinite loop, consuming a single CPU core entirely. This technical analysis explores the mechanics of this flaw, its exploitability, and the official mitigation strategies.

Because json-repair is commonly deployed to sanitize untrusted output in automated parsing pipelines, exposing the loads() interface to user-controlled schemas provides an immediate attack path. Remote, unauthenticated attackers can leverage this behavior to systematically exhaust host processor resources with minimal network overhead.

Root Cause Analysis

The flaw is located in the $ref resolution engine of the schema-aware JSON repair utility, implemented in src/json_repair/schema_repair.py within the SchemaRepairer class. When a JSON Schema containing a $ref key is processed, the SchemaRepairer.resolve_schema() method initiates a while loop designed to sequentially resolve pointers until no more references exist.

The logic evaluates the statement while "$ref" in schema_dict and delegates resolution to the helper function _resolve_ref(). This helper function parses the pointer and returns the corresponding sub-schema relative to the root_schema object, which represents the initial user-provided schema. If the schema contains self-referential definitions (such as node a pointing to node a or a circular chain a -> b -> a), the returned resolved structure continually contains the same $ref key.

Because the resolution engine lacked cycle tracking or recursion depth limits, the loop condition remains satisfied indefinitely. This design flaw allows an unauthenticated actor to force the thread of execution into an infinite loop, resulting in 100 percent CPU utilization on the executing core.

Code Analysis

The vulnerable implementation of the reference resolver in src/json_repair/schema_repair.py demonstrates the lack of traversal state preservation. In the unpatched codebase, the loop simply assigns the output of _resolve_ref back to schema_dict without any historical tracking:

# Vulnerable implementation in src/json_repair/schema_repair.py
schema_dict = cast("dict[str, Any]", schema)
while "$ref" in schema_dict:
    ref = schema_dict["$ref"]
    resolved = self._resolve_ref(ref)
    if isinstance(resolved, bool):
        return resolved
    schema_dict = resolved

The patched version introduces cycle tracking using unique Python object identifiers. By tracking the id() of each traversed schema dictionary, the engine detects when a node is revisited within the current path:

# Patched implementation in src/json_repair/schema_repair.py
schema_dict = cast("dict[str, Any]", schema)
seen_schema_ids: set[int] = set()
while "$ref" in schema_dict:
    ref = schema_dict["$ref"]
    if not isinstance(ref, str):
        raise SchemaDefinitionError("$ref must be a string.")
    schema_id = id(schema_dict)
    if schema_id in seen_schema_ids:
        raise SchemaDefinitionError(f"Circular $ref detected: {ref}")
    seen_schema_ids.add(schema_id)
    resolved = self._resolve_ref(ref)
    if isinstance(resolved, bool):
        return resolved
    schema_dict = resolved
return schema_dict

This remediation is robust because the components of the root schema remain in scope during the lifetime of the SchemaRepairer instance, which guarantees that Python's id() values are stable and not reused during the resolution process. Additionally, enforcing type checking on the $ref key prevents unexpected schema parsing exceptions.

Exploitation Methodology

Exploitation of this vulnerability requires that the target application accepts user-supplied JSON schemas and applies them to the loads() interface of the json-repair library. This is a common pattern in platforms that allow users to define structured output validation for LLM responses.

An attacker can trigger this behavior by constructing a minimal JSON payload accompanied by a schema dictionary containing circular references. The most direct vector involves pointing a $ref key to a definition path that resolves back to itself. The following JSON payload represents a reliable proof of concept:

{
  "malformedJSON": "{}",
  "schema": {
    "$ref": "#/definitions/a",
    "definitions": {
      "a": {
        "$ref": "#/definitions/a"
      }
    }
  }
}

When processed by an application using the vulnerable library version, the thread handling the parsing operation will freeze indefinitely. If the application runs in a single-threaded server environment, such as a basic Flask application, the entire server process becomes unresponsive to subsequent incoming requests.

Impact Assessment

The impact of this vulnerability is a complete loss of availability for the affected application components. Because the execution logic is CPU-bound rather than I/O-bound, the thread cannot yield execution control, which leads to total exhaustion of the hosting CPU core.

In containerized or shared environments, a series of requests utilizing this exploit can exhaust all available processor cores, affecting adjacent services. This vulnerability carries a CVSS v3.1 score of 7.5 (High) with an attack vector of Network, low attack complexity, and no privileges or user interaction required.

While the vulnerability does not allow remote code execution or data exposure, it represents an effective and low-cost vector for denial of service (DoS) against LLM middleware applications that dynamically evaluate user schemas.

Remediation and Mitigation

The primary remediation strategy is upgrading the json-repair package to version 0.60.1 or later, where the cycle-detection logic has been integrated. This upgrade completely mitigates the loop condition by raising a SchemaDefinitionError when circular structures are encountered.

If upgrading is not immediately feasible, developers must implement schema sanitization before passing objects to the repair utility. Applications should use stable third-party schema validators that support recursion limiters to validate the schema's structure prior to processing.

Additionally, hosting environments should enforce strict resource limits, such as maximum execution timeouts on web workers (e.g., Gunicorn or uWSGI timeout configurations). This ensures that any thread entering an infinite loop is automatically terminated before causing system-wide degradation.

Official Patches

mangiucugnaOfficial Security Advisory Release Note
mangiucugnaFixed Version Release Tag

Technical Appendix

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

Affected Systems

Applications utilizing python-json-repair to parse or validate schema-bounded outputs.Flask/FastAPI endpoints mapping POST payloads directly to the json_repair.loads schema parameter.Interactive playground applications showcasing LLM schema parsing techniques.

Affected Versions Detail

Product
Affected Versions
Fixed Version
json-repair
mangiucugna
< 0.60.10.60.1
AttributeDetail
CWE IDCWE-835
Attack VectorNetwork (AV:N)
CVSS Severity7.5 (High)
EPSS Score0.00045
ImpactDenial of Service (CPU Exhaustion)
Exploit StatusProof-of-Concept Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499.004Endpoint Denial of Service: Application Exhaustion
Impact
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')

The program contains an iteration loop with an exit condition that cannot be reached or satisfied, causing infinite loop execution.

Known Exploits & Detection

GitHub AdvisoryDenial of Service proof of concept payload in advisory description.

References & Sources

  • [1]GitHub Advisory for GHSA-xf7x-x43h-rpqh
  • [2]Vulnerable Code Repository
  • [3]Official Security Advisory Release Note
  • [4]Fixed Version Release Tag

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-53653
8.7

CVE-2026-53653: Unauthenticated Denial of Service via Unbounded Image Derivative Dimensions in Grav CMS

Grav CMS prior to version 1.7.53 and 2.0.0-rc.8 is vulnerable to an unauthenticated remote denial of service (DoS) vulnerability. By supplying crafted query parameters with extremely large dimensions to image assets, remote unauthenticated attackers can force the server to allocate massive amounts of system memory, leading to kernel Out-Of-Memory (OOM) termination of web worker processes.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 2 hours ago•CVE-2026-53657
8.2

CVE-2026-53657: Privilege Escalation via Overly Permissive Unix Domain Socket in Lima Guest Agent

CVE-2026-53657 is a local privilege escalation vulnerability in Lima (lima-vm/lima) affecting versions prior to 2.1.3 when configured with the QEMU driver. The guest agent daemon, running as root, creates its communication socket `/run/lima-guestagent.sock` with world-writable permissions (0777). This allows unprivileged local users to command the agent to establish arbitrary tunnels, including to privileged local UNIX sockets (like D-Bus). Because the target daemon authenticates the incoming connection using the credentials of the root-owned guest agent (via SO_PEERCRED), unprivileged users can perform root operations, resulting in complete guest VM compromise.

Amit Schendel
Amit Schendel
3 views•9 min read
•about 3 hours ago•CVE-2026-10740
5.3

CVE-2026-10740: Denial of Service in s2n-quic CryptoStream Reassembly

An unauthenticated Denial of Service vulnerability exists in the s2n-quic library's CryptoStream reassembler due to a lack of buffer limits on out-of-order cryptographic frames. An attacker can transmit a crafted CRYPTO frame with an extremely high offset and nominal payload, forcing the receiver to execute unbounded memory allocations and causing service crashes.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 4 hours ago•CVE-2026-55153
7.1

CVE-2026-55153: JNDI Injection and Deserialization Gadget Abuse in mchange-commons-java

A JNDI Injection and Deserialization Gadget vulnerability exists in mchange-commons-java prior to version 0.6.0. The com.mchange.v2.naming.JavaBeanObjectFactory component permits arbitrary class instantiation and setter invocation, allowing attackers to perform Server-Side Request Forgery (SSRF) and remote class loading.

Alon Barad
Alon Barad
6 views•5 min read
•about 5 hours ago•GHSA-8RW6-P7M8-63JP
6.5

GHSA-8RW6-P7M8-63JP: Array Element-Level SELECT Permissions Leak in SurrealDB

SurrealDB versions supporting element-level SELECT permissions on arrays are vulnerable to a logical authorization bypass. Due to an index-shifting error during array filtration, restricted elements can skip permission checks and leak to unauthorized record users.

Alon Barad
Alon Barad
5 views•6 min read
•1 day ago•CVE-2026-12243
7.5

CVE-2026-12243: Incomplete Path Traversal Validation and Percent-Encoding Bypass in NLTK

CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.

Amit Schendel
Amit Schendel
5 views•8 min read