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



CVE-2026-142652

CVE-2026-142652: SQL Injection in Agenta Tracing Full-Text Content Filter

Amit Schendel
Amit Schendel
Senior Security Researcher

Dec 3, 2026·9 min read·5 visits

Executive Summary (TL;DR)

Agenta versions prior to 0.122.5 contain an SQL injection vulnerability (CWE-89) in the POST /api/spans/query endpoint. By passing crafted search strings to the full-text content filter, a low-privileged authenticated user can perform boolean-based or time-based blind SQL injection to read LLM traces, prompts, and span metadata across all projects and tenants.

An authenticated SQL injection vulnerability exists in Agenta prior to version 0.122.5 within the tracing database query layer. The full-text content filter handler in api/oss/src/dbs/postgres/tracing/utils.py interpolates user-supplied search strings directly into a SQLAlchemy text() construct without parameter binding or escaping. This flaw allows an authenticated user with read access to spans in a single project to execute arbitrary SQL conditions against the tracing database, bypassing project and tenant isolation boundaries to exfiltrate trace data across the entire platform.

Vulnerability Overview

Agenta is an open-source LLMOps platform designed for prompt engineering, evaluation, and observability of large language model applications. A core capability of the platform is its distributed tracing subsystem, which records execution spans, model prompts, completions, and associated metadata into a dedicated PostgreSQL database. Users and automated services query these records through the FastAPI backend to inspect application behavior and debug LLM workflows.

In versions prior to 0.122.5, the tracing query engine contains an SQL injection vulnerability classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). The flaw resides in the api/oss/src/dbs/postgres/tracing/utils.py module, specifically within the _handle_fts_field() utility function. This function processes incoming filter conditions submitted to the POST /api/spans/query API endpoint when a client requests a full-text search across span content.

When constructing the PostgreSQL full-text search predicate, the application passes the user-controlled search value directly into a SQLAlchemy text() construct using Python f-string formatting. Because text() instructs the ORM to treat the enclosed characters as raw SQL syntax rather than bound data literals, any single quotation marks or SQL operators within the search term are interpreted directly by the PostgreSQL query parser.

This implementation flaw exposes the tracing database to manipulation by any authenticated user who possesses low-level permissions to view spans in at least one project. By leveraging boolean-based or time-based blind SQL injection techniques, an attacker can cross tenant and project isolation boundaries to read sensitive trace spans, prompt inputs, and system completions belonging to all other tenants hosted on the Agenta instance.

Root Cause Analysis

The root cause of CVE-2026-142652 is the unsafe concatenation of untrusted user input into a raw SQLAlchemy text() expression during AST (Abstract Syntax Tree) construction. When a client issues a query against POST /api/spans/query, the backend parses the filter payload into data transfer objects (Condition instances) and passes them to the filter compilation pipeline in api/oss/src/dbs/postgres/tracing/utils.py.

For conditions targeting the Fields.CONTENT field, the query builder invokes _handle_fts_field(). This function leverages PostgreSQL's built-in full-text search operators by pairing to_tsvector with websearch_to_tsquery via the @@ match operator. To pass the 'simple' text search configuration and the user's search term to websearch_to_tsquery, the developers wrapped both arguments in SQLAlchemy's text() function.

In SQLAlchemy, the text() construct is designed to represent literal SQL fragments verbatim. Unless bind parameters are explicitly declared using colon-prefixed placeholders (e.g., text(":val").bindparams(val=value)), SQLAlchemy bypasses all parameterization and quoting routines during dialect compilation. By writing text(f"'{value}'"), the code performs string interpolation at the Python layer before SQLAlchemy ever compiles the expression.

Furthermore, _handle_fts_field() duplicates this vulnerable pattern across two separate query branches: once when constructing the full-text search predicate for span attributes, and a second time when constructing the predicate for span events. Consequently, a single malicious value in the request payload is injected twice into the resulting WHERE clause. When the compiled SQL string reaches PostgreSQL, a single quote (') in value terminates the string literal early, allowing the attacker to append arbitrary SQL expressions into the query execution context.

Code Analysis

The vulnerability and its remediation are isolated to api/oss/src/dbs/postgres/tracing/utils.py and verified by unit tests introduced in commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c. In the vulnerable code prior to version 0.122.5, _handle_fts_field() built the ts_query variable using raw Python string interpolation inside text():

# Vulnerable implementation in api/oss/src/dbs/postgres/tracing/utils.py
 
# Branch 1: Attributes full-text search
ts_vector = func.to_tsvector(text("'simple'"), attribute)
ts_query = func.websearch_to_tsquery(text("'simple'"), text(f"'{value}'")) # <-- Raw f-string interpolation
 
conditions.append(ts_vector.op("@@")(ts_query))
 
# Branch 2: Events full-text search
ts_vector = func.to_tsvector(text("'simple'"), attribute)
ts_query = func.websearch_to_tsquery(text("'simple'"), text(f"'{value}'")) # <-- Second injection point
 
conditions.append(ts_vector.op("@@")(ts_query))

When value is a benign string such as hello, the compiled SQL fragment becomes websearch_to_tsquery('simple', 'hello'). However, if value contains it's, the single quote breaks the lexical boundary, producing invalid SQL (websearch_to_tsquery('simple', 'it's')). If value contains a structured injection payload, the extra syntax is evaluated as part of the surrounding WHERE clause.

To remediate the vulnerability, commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c replaces the text(f"'{value}'") construct with SQLAlchemy's bindparam() construct explicitly typed as Text:

# Patched implementation in api/oss/src/dbs/postgres/tracing/utils.py
 
# Branch 1: Attributes full-text search
ts_vector = func.to_tsvector(text("'simple'"), attribute)
ts_query = func.websearch_to_tsquery(
    text("'simple'"),
    bindparam(None, str(value), type_=Text), # <-- Parameterized value binding
)
 
conditions.append(ts_vector.op("@@")(ts_query))
 
# Branch 2: Events full-text search
ts_vector = func.to_tsvector(text("'simple'"), attribute)
ts_query = func.websearch_to_tsquery(
    text("'simple'"),
    bindparam(None, str(value), type_=Text), # <-- Parameterized value binding
)
 
conditions.append(ts_vector.op("@@")(ts_query))

By passing None as the key to bindparam(), SQLAlchemy automatically generates unique anonymous positional parameter names (such as %(param_1)s and %(param_2)s or $1 and $2 depending on the PostgreSQL driver) during statement compilation. The actual string contents of str(value) are never concatenated into the SQL command string; instead, they are transmitted out-of-band in the parameter array alongside the prepared statement.

> [!NOTE] > Fix Completeness Assessment: The patch completely eliminates the injection vector within _handle_fts_field(). The commit also adds api/oss/tests/pytest/unit/tracing/test_content_filter.py, which compiles the filter clause against the PostgreSQL dialect using strings containing single quotes, double quotes, SQL line comments (--), and semicolons (;). The unit test asserts that the raw value never appears in the compiled SQL string (assert value not in sql) and verifies that the value is strictly isolated inside compiled.params.values().

Exploitation

Exploiting CVE-2026-142652 requires network access to the Agenta backend API and a valid authentication token (such as a user session token or API key) that has authorization to view spans in at least one project. No special configuration is needed, as full-text content filtering is a standard feature of the tracing endpoint.

The entry point for the attack is POST /api/spans/query. An attacker submits a JSON payload containing a filter condition where field is set to content and value holds the SQL injection string. Because _handle_fts_field() places the injected expression inside a WHERE clause filtering spans for the caller's authorized project, the endpoint does not directly return raw query results from arbitrary tables in the HTTP response body. Instead, the endpoint returns either a list of matching spans from the user's current project or an empty result set.

POST /api/spans/query HTTP/1.1
Host: agenta.example.com
Authorization: Bearer <low_privilege_token>
Content-Type: application/json
 
{
  "filtering": {
    "conditions": [
      {
        "field": "content",
        "value": "test') OR (SELECT CASE WHEN (1=1) THEN true ELSE false END) --"
      }
    ]
  }
}

Because the injection occurs twice within the generated SQL statement (once for the attributes condition and once for the events condition), the attacker must craft the payload so that theresulting SQL syntax remains valid across both interpolations, or use comment syntax (/* ... */ or --) carefully depending on how SQLAlchemy wraps the surrounding parenthetical clauses. Specifically, closing the websearch_to_tsquery('simple', '<payload>') function call with ') allows the attacker to append boolean operators (AND, OR) inside the WHERE predicate before commenting out or balancing the trailing quote.

Using boolean-based blind extraction, the attacker populates at least one known span in their own project and uses conditional subqueries (e.g., comparing ASCII character values of data from other projects' rows in the spans table) to toggle whether their known span is returned in the HTTP response. Alternatively, the attacker can employ time-based blind extraction by injecting calls to PostgreSQL's pg_sleep() function, measuring the HTTP response latency to infer character values bit by bit across tenant boundaries.

Impact Assessment

CVE-2026-142652 is rated High severity with a CVSS v3.1 base score of 7.7 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N). The vector reflects that the vulnerability is remotely exploitable over the network (AV:N) with low attack complexity (AC:L), requires low privileges (PR:L), and requires no user interaction (UI:N).

The critical architectural factor in this score is the Scope: Changed (S:C) metric. In a multi-tenant or multi-project Agenta deployment, authorization controls at the application layer restrict a user to querying only the project IDs to which they have been granted access. However, because the SQL query executes over a shared PostgreSQL connection pool that has read access to the entire tracing database, breaking out of the WHERE clause predicate allows the user's query to read rows belonging to any project ID or tenant ID stored in that database.

Consequently, the Confidentiality Impact is High (C:H) within the tracing boundary. In LLMOps environments, trace spans frequently contain highly sensitive organizational data, including proprietary system prompts, customer PII submitted to LLM endpoints, internal RAG (Retrieval-Augmented Generation) documents, tool-calling payloads, and model completions. An attacker can systematically exfiltrate all such historical trace records across every tenant on the platform.

> [!IMPORTANT] > Blast Radius Limitation: Agenta's architecture separates observability data from core platform administration data. The tracing database sits on a distinct database connection and schema from the core database that stores user accounts, authentication credentials, platform API keys, and encrypted secrets. Because PostgreSQL does not permit cross-database queries over a single database connection without explicit foreign data wrappers (FDW), an attacker exploiting CVE-2026-142652 cannot read the core user/secrets database, nor can they modify data (I:N) or compromise host availability (A:N).

Remediation

The primary remediation is to upgrade Agenta to version 0.122.5 or later. The vulnerability was patched in commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c via Pull Request #7529, which enforces parameterized query binding via sqlalchemy.sql.expression.bindparam for all full-text search content filters.

For deployments utilizing Docker or Kubernetes, administrators should update their container image tags to v0.122.5 (or a newer release) and redeploy the api service pods. Organizations building from source should pull the latest main branch or cherry-pick commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c into their deployment branch and verify the build by running the pytest suite against api/oss/tests/pytest/unit/tracing/test_content_filter.py.

If immediate upgrading is operationally unfeasible, security teams should implement compensating controls at the reverse proxy, API gateway, or Web Application Firewall (WAF) layer. Specifically, inspect all incoming POST /api/spans/query requests and block JSON payloads where a filter condition on content includes single quotation marks ('), SQL comments (--, /*), or common PostgreSQL timing and system functions (pg_sleep, current_setting, version).

Additionally, security monitoring teams should audit historical PostgreSQL logs and API access logs for signs of prior exploitation. Indicators of compromise include HTTP 500 responses on POST /api/spans/query correlated with PostgreSQL SYNTAX ERROR logs referencing websearch_to_tsquery, or abnormal spikes in high-volume sequential requests to /api/spans/query from a single authenticated user session.

Official Patches

Agenta-AIOfficial GitHub Security Advisory (GHSA-96p7-33vc-xgf2)
Agenta-AISecurity Patch Commit
Agenta-AIPatch Pull Request #7529
Agenta-AIAgenta Release v0.122.5

Fix Analysis (1)

Technical Appendix

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

Affected Systems

Agenta-AI/agenta (< 0.122.5)

Affected Versions Detail

Product
Affected Versions
Fixed Version
agenta
Agenta-AI
< 0.122.50.122.5
AttributeDetail
Vulnerability TypeCWE-89: SQL Injection
CVSS v3.1 Score7.7 High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N)
Affected Componentapi/oss/src/dbs/postgres/tracing/utils.py (_handle_fts_field)
Attack VectorAuthenticated HTTP POST to /api/spans/query
Security ImpactCross-project and cross-tenant disclosure of LLM traces and spans
Fixed Version0.122.5
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream database component.

Vulnerability Timeline

Fix commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c authored and committed to repository
2026-10-11
CVE-2026-142652 and GitHub Advisory GHSA-96p7-33vc-xgf2 published
2026-12-03
NVD and OSV records published with CVSS v3.1 score 7.7
2026-12-03

References & Sources

  • [1]GitHub Security Advisory GHSA-96p7-33vc-xgf2
  • [2]Agenta Pull Request #7529
  • [3]Fix Commit 345d6d3e22bc0ece92ebefdf11d8e453c658e51c
  • [4]Agenta Release v0.122.5
  • [5]CVE.org Record for CVE-2026-142652
  • [6]CVEListV5 JSON Record
  • [7]NVD Vulnerability Detail for CVE-2026-142652

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

•15 minutes ago•CVE-2026-142649
5.3

CVE-2026-142649: Input Validation Bypass via Loose Type Comparison in Laravel Framework

CVE-2026-142649 (also tracked as GHSA-h2hg-mfj4-rg7q) is an input validation bypass vulnerability affecting the validation subsystem of the Laravel web application framework (laravel/framework). Specifically, the validateIn method in src/Illuminate/Validation/Concerns/ValidatesAttributes.php performs non-strict comparisons when evaluating scalar input values against defined allowlists for the 'in', 'Rule::in', and 'not_in' validation rules. Because PHP's native in_array() function defaults to loose equality (==) when the third parameter ($strict) is omitted, numeric strings with non-canonical representations—such as leading or trailing whitespace, embedded newlines, leading zeros, positive signs, decimal points, or scientific notation—evaluate as equal to standard numeric allowlist entries. Furthermore, because Laravel's validated() and valid() accessor methods return the original, un-canonicalized input string rather than the matched allowlist token, unvalidated characters and unexpected string formats propagate directly into downstream business logic, database queries, and state enforcement checks.

Alon Barad
Alon Barad
1 views•10 min read
•about 7 hours ago•GHSA-Q5PW-PP6J-MVFC
7.1

GHSA-q5pw-pp6j-mvfc: Arbitrary Command Execution via Argument Injection in Samsung/CredSweeper GitHub Action

The Samsung/CredSweeper GitHub Action between versions 1.11.6 and 1.16.x contains an argument injection vulnerability (CWE-88) in its composite action definition. The action accepts unvalidated strings for the 'error' and 'hashed' input parameters and passes them directly as command-line arguments to the CredSweeper CLI. An attacker capable of controlling these action inputs can inject the '--log_config' flag pointing to an attacker-controlled YAML file. Because CredSweeper loads this configuration using Python's logging.config.dictConfig, which supports instantiating arbitrary callables via the '()' factory key, this flaw leads to arbitrary command execution within the GitHub Actions runner environment.

Amit Schendel
Amit Schendel
8 views•11 min read
•about 8 hours ago•CVE-2026-92542
6.9

CVE-2026-92542: Blind VXLAN Injection into Encrypted Overlay Networks in Docker Engine and Moby

CVE-2026-92542 (GHSA-6m9p-4h64-m6vh) is an authentication bypass by spoofing and confused deputy vulnerability in the overlay network driver (libnetwork) of Docker Engine and Moby. The firewall rules responsible for marking outgoing VXLAN datagrams for IPsec encryption fail to distinguish between authentic VXLAN packets generated by the Linux kernel and forged UDP packets sent by local userspace processes. Consequently, an unprivileged user or process executing in the host network namespace of a Linux Docker Swarm node can transmit crafted VXLAN datagrams that the kernel automatically encrypts and routes to peer nodes, enabling blind injection of arbitrary Ethernet frames into encrypted overlay networks.

Amit Schendel
Amit Schendel
9 views•12 min read
•about 9 hours ago•CVE-2026-135389
9.1

CVE-2026-135389: Authentication Bypass via Premature Session Caching in Pion DTLS

A critical authentication bypass vulnerability exists in Pion DTLS (versions 2.1.0 through 3.1.13 and 4.0.0-rc.1 through 4.0.0-rc.5) within the DTLS 1.2 server handshake state machine. When a server is configured with a SessionStore and negotiates a certificate-based cipher suite, it prematurely persists the session ID and derived master secret immediately after processing the ClientKeyExchange message. Because this cache write occurs before validating the client's Certificate, CertificateVerify, and Finished messages, an unauthenticated remote attacker can abandon an incomplete initial handshake and immediately perform an abbreviated session resumption handshake using the derived master secret, bypassing mandatory client certificate authentication (RequireAnyClientCert, RequireAndVerifyClientCert) and custom VerifyConnection callbacks.

Amit Schendel
Amit Schendel
5 views•12 min read
•about 10 hours ago•CVE-2026-141546
5.0

CVE-2026-141546: Path Traversal and Arbitrary File Write in KiCad MCP Pro Variant Export Tools

CVE-2026-141546 (GHSA-wfmg-598x-58c5) is a path traversal vulnerability (CWE-22) in KiCad MCP Pro prior to version 4.20.1. Three variant export tools in src/kicad_mcp/tools/variants.py construct target output paths by joining unvalidated user-supplied arguments directly onto the validated output directory using Python's pathlib.Path concatenation operator. A caller invoking these tools with path traversal sequences or absolute file paths can bypass the KICAD_MCP_WORKSPACE_ROOT confinement boundary to create directories and write or overwrite arbitrary files on the host filesystem.

Alon Barad
Alon Barad
9 views•9 min read
•about 11 hours ago•CVE-2026-141553
5.5

CVE-2026-141553: Path Traversal and Arbitrary File Overwrite in termux-sync Restore Routine

CVE-2026-141553 (GHSA-x9x8-xcv7-5x5g) is a medium-severity path traversal and arbitrary file overwrite vulnerability in termux-sync prior to version 1.3.8. During backup restoration, the cmd_restore function computes the extraction containment boundary as the parent directory of the target backup folder ($PREFIX or .../files) rather than the specific subdirectory itself. Consequently, a crafted backup archive (such as usr_etc.tar.gz) can extract files into sibling directories like $PREFIX/bin, overwriting system executables such as $PREFIX/bin/sh and achieving arbitrary code execution within the Termux user context.

Alon Barad
Alon Barad
8 views•10 min read