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·22 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

•2 days ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
9 views•5 min read
•2 days ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
8 views•5 min read
•2 days ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
9 views•4 min read
•2 days ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•2 days ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•2 days ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read