CVE-2026-142652: Agenta SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-96p7-33vc-xgf2
CVSS 7.7
CWE-89
Published
Advisory Summary

CVE-2026-142652 is a HIGH (CVSS 7.7) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Agenta libraries in the PyPI ecosystem. The issue involves sql injection in tracing full-text content filter. Remediation is available by upgrading affected packages to version 0.122.5.

CVE-2026-142652 at a Glance

CVE Identifier CVE-2026-142652
GHSA Identifier GHSA-96p7-33vc-xgf2
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Agenta
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-142652

To remediate this vulnerability, upgrade all affected Agenta dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

agenta fixed: 0.122.5
pip install agenta>=0.122.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show agenta

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-142652, inspect your installed packages using pip:

pip show agenta

Analyze the terminal output to locate any version of Agenta in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.122.5), your application is affected.

Note: The pip show agenta command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product 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 component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Agenta, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The full-text `content` filter used by the span query endpoint (`POST /api/spans/query`) inserted the user-supplied search term into the SQL query without parameter binding or escaping. A single quote in the search term ends the SQL string literal, and the rest of the term runs as SQL. Any authenticated user who can view spans in their own project can send this filter. The query runs against the tracing database, so an attacker can read tracing data from every project and every tenant, including other tenants' traces and spans. The attacker reads the data blind, for example through boolean or timing conditions. The tracing data is stored in a separate Postgres database. Users, API keys and secrets are stored in a different database, and this query cannot reach them. ### Affected code `api/oss/src/dbs/postgres/tracing/utils.py`, function `_handle_fts_field`. ### Patches The issue is fixed in version 0.122.5. The search term is now passed to `websearch_to_tsquery` as a bound query parameter. A regression test covers quoted and SQL-like search terms. ### Workarounds There is no workaround. Upgrade to 0.122.5 or later. Self-hosted operators can reduce the impact by running the API with a database role that is not a superuser and that has access only to the Agenta databases. ### Credits Reported by Lee Zhi Yang ([@Xeraaaaaaa](https://github.com/Xeraaaaaaa)).

CVE-2026-142652 Affected Agenta Versions

1 component(s)
Fixed Versions:
0.122.5
Product / Package Ecosystem Affected Versions Fixed Version
agenta
PyPI
< 0.122.5
0.122.5

References

Frequently Asked Questions

What is CVE-2026-142652?
CVE-2026-142652 is a security vulnerability in Agenta involving SQL injection in tracing full-text content filter under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Agenta versions are affected?
Affected versions include releases prior to 0.122.5 across affected packages: agenta.
What version fixes CVE-2026-142652?
Upgrading to 0.122.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is agenta affected?
Yes, agenta is affected in releases prior to 0.122.5. Upgrade your dependency to 0.122.5 or later.
What is the CVSS score of CVE-2026-142652?
CVE-2026-142652 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-142652?
CVE-2026-142652 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product 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 component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check PyPI dependencies for CVE-2026-142652?
Run the dependency tree command: 'pip show agenta'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-96p7-33vc-xgf2",
  "modified" : "2026-12-03T17:59:37Z",
  "published" : "2026-12-03T17:59:37Z",
  "aliases" : [ "CVE-2026-142652" ],
  "summary" : "Agenta: SQL injection in tracing full-text content filter",
  "details" : "### Impact\n\nThe full-text `content` filter used by the span query endpoint (`POST /api/spans/query`) inserted the user-supplied search term into the SQL query without parameter binding or escaping. A single quote in the search term ends the SQL string literal, and the rest of the term runs as SQL.\n\nAny authenticated user who can view spans in their own project can send this filter. The query runs against the tracing database, so an attacker can read tracing data from every project and every tenant, including other tenants' traces and spans. The attacker reads the data blind, for example through boolean or timing conditions.\n\nThe tracing data is stored in a separate Postgres database. Users, API keys and secrets are stored in a different database, and this query cannot reach them.\n\n### Affected code\n\n`api/oss/src/dbs/postgres/tracing/utils.py`, function `_handle_fts_field`.\n\n### Patches\n\nThe issue is fixed in version 0.122.5. The search term is now passed to `websearch_to_tsquery` as a bound query parameter. A regression test covers quoted and SQL-like search terms.\n\n### Workarounds\n\nThere is no workaround. Upgrade to 0.122.5 or later. Self-hosted operators can reduce the impact by running the API with a database role that is not a superuser and that has access only to the Agenta databases.\n\n### Credits\n\nReported by Lee Zhi Yang ([@Xeraaaaaaa](https://github.com/Xeraaaaaaa)).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "agenta"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.122.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.122.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Agenta-AI/agenta/security/advisories/GHSA-96p7-33vc-xgf2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Agenta-AI/agenta/pull/7529"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Agenta-AI/agenta/commit/345d6d3e22bc0ece92ebefdf11d8e453c658e51c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Agenta-AI/agenta"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Agenta-AI/agenta/releases/tag/v0.122.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-03T17:59:37Z",
    "nvd_published_at" : null
  }
}