GHSA-96p7-33vc-xgf2

Suggest an improvement
Source
https://github.com/advisories/GHSA-96p7-33vc-xgf2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-96p7-33vc-xgf2/GHSA-96p7-33vc-xgf2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-96p7-33vc-xgf2
Aliases
Published
2026-12-03T17:59:37Z
Modified
2026-12-03T18:15:03Z
Severity
  • 7.7 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N CVSS Calculator
Summary
Agenta: SQL injection in tracing full-text content filter
Details

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).

Database specific
{
    "cwe_ids":  [
        "CWE-89"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-03T17:59:37Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

PyPI / agenta

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.122.5

Affected versions

0.*
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5
0.1.6
0.1.7
0.1.8
0.1.9
0.1.10
0.1.11
0.1.12
0.1.13
0.1.14
0.1.15
0.1.16
0.1.17
0.1.18
0.1.19
0.1.21
0.1.22
0.1.23
0.1.24
0.1.25
0.1.26
0.1.27
0.1.28
0.1.29
0.2.0
0.2.2
0.2.3
0.2.4
0.2.5
0.2.6
0.2.7
0.2.8
0.2.9
0.2.10
0.2.11
0.2.12
0.3.0
0.3.1
0.4.0
0.4.1
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.6.8
0.6.9
0.6.10
0.7.0
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.9.0
0.10.0
0.10.1
0.10.2
0.10.3
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.12.5
0.12.6
0.12.7
0.13.0a0
0.13.0a1
0.13.0a2
0.13.0a3
0.13.0
0.13.1
0.13.2
0.13.3
0.13.4
0.13.5
0.13.6
0.13.7a0
0.13.7
0.13.8
0.14.0
0.14.1a0
0.14.1a1
0.14.1
0.14.2
0.14.3
0.14.4
0.14.5
0.14.6a0
0.14.6
0.14.7a0
0.14.7a1
0.14.7
0.14.8a0
0.14.8
0.14.9
0.14.10
0.14.11
0.14.12a0
0.14.12a1
0.14.12a2
0.14.12
0.14.13
0.14.14a0
0.14.14a1
0.14.14
0.15.0a0
0.15.0a1
0.15.0a2
0.15.0a3
0.15.0a4
0.15.0
0.16.0
0.17.0
0.17.1
0.17.2
0.17.3
0.17.4a0
0.17.4
0.17.5
0.17.6a0
0.17.6a1
0.18.0
0.19.0
0.19.1a0
0.19.1
0.19.2
0.19.3
0.19.4
0.19.5
0.19.6a0
0.19.6
0.19.7
0.19.8a0
0.19.8
0.19.9
0.20.0a0
0.20.0a1
0.20.0a3
0.20.0a4
0.20.0a6
0.20.0a7
0.20.0a8
0.20.0a9
0.20.0a10
0.20.0a11
0.20.0a12
0.20.0a13
0.21.0a1
0.21.0b1
0.22.0
0.23.0a1
0.23.0
0.24.0
0.24.1a0
0.24.1
0.24.2a1
0.24.2a2
0.24.2
0.24.3a1
0.24.3
0.24.4
0.25.0
0.25.1
0.25.2
0.25.3a1
0.25.3
0.25.4a1
0.25.4a2
0.25.4a3
0.25.4a4
0.25.4
0.26.0a0
0.26.0
0.27.0a0
0.27.0a1
0.27.0a2
0.27.0a5
0.27.0a6
0.27.0a7
0.27.0a8
0.27.0a9
0.27.0a12
0.27.0a13
0.27.0a15
0.27.0
0.27.1
0.27.2a2
0.27.2
0.27.3
0.27.4a0
0.27.4a1
0.27.5a1
0.27.5
0.27.6a0
0.27.6a1
0.27.6a2
0.27.6a3
0.27.6
0.27.7a0
0.27.7a1
0.27.7a2
0.27.7
0.27.8a2
0.28.0a1
0.28.0a2
0.28.0a3
0.28.0a4
0.28.0
0.28.1
0.28.2a1
0.28.2a2
0.29.0
0.30.0a1
0.30.0a2
0.30.0a3
0.30.0a4
0.30.0a6
0.30.0
0.31.0a1
0.31.0
0.32.0a1
0.32.0a2
0.32.0
0.33.0a1
0.33.0a3
0.33.0
0.33.1
0.33.2
0.33.3
0.33.4
0.33.5
0.33.6
0.33.7
0.33.8
0.34.1
0.34.3
0.34.4
0.34.5
0.34.6
0.34.7
0.35.0
0.35.1
0.35.2
0.36.0
0.36.1
0.36.2
0.36.3
0.36.4
0.36.5
0.37.0
0.37.1
0.37.2
0.37.3
0.38.0
0.38.1
0.38.2
0.39.0
0.39.1
0.39.2
0.39.3
0.39.4
0.40.0
0.41.0
0.41.1
0.42.0
0.42.1
0.42.2
0.43.0
0.43.1
0.44.0
0.44.3
0.44.4
0.45.0
0.45.1
0.45.2
0.45.3
0.45.4
0.46.0
0.46.1
0.47.0
0.48.0
0.48.1
0.48.2
0.48.3
0.48.4
0.48.5
0.48.6
0.48.7
0.48.8
0.48.9
0.48.10
0.49.0
0.49.1
0.49.2
0.49.3
0.49.4
0.49.5
0.50.0
0.50.1
0.50.2
0.50.3
0.50.4
0.50.5
0.50.6
0.51.0
0.51.1
0.51.2
0.51.3
0.51.4
0.51.5
0.51.6
0.52.0
0.52.1
0.52.2
0.52.3
0.52.4
0.52.5
0.52.6
0.52.7
0.52.8
0.53.0
0.54.0
0.54.1
0.55.0
0.55.1
0.55.2
0.56.0
0.56.1
0.56.2
0.56.3
0.56.4
0.57.0
0.57.1
0.57.2
0.58.0
0.59.0
0.59.1
0.59.2
0.59.3
0.59.4
0.59.5
0.59.6
0.59.7
0.59.8
0.59.9
0.59.10
0.59.11
0.59.12
0.60.0
0.60.1
0.60.2
0.61.0
0.61.1
0.61.2
0.62.0
0.62.1
0.62.2
0.62.3
0.62.4
0.62.5
0.62.6
0.62.7
0.62.8
0.62.9
0.63.0
0.63.2
0.64.0
0.64.1
0.65.0
0.66.0
0.66.1
0.66.2
0.67.0
0.68.0
0.68.1
0.68.3
0.68.5
0.69.0
0.69.1
0.69.2
0.69.3
0.69.4
0.69.5
0.69.6
0.69.7
0.69.8
0.70.0
0.70.1
0.71.0
0.71.1
0.72.0
0.72.1
0.72.2
0.72.3
0.72.4
0.73.0
0.74.0
0.75.0
0.75.1
0.76.0
0.77.0
0.77.1
0.77.2
0.77.3
0.77.4
0.78.0
0.78.1
0.79.0
0.79.1
0.80.0
0.80.1
0.80.2
0.80.3
0.80.4
0.80.5
0.80.6
0.80.7
0.80.8
0.80.9
0.81.0
0.81.1
0.81.2
0.82.0
0.83.0
0.83.1
0.84.0
0.84.1
0.85.0
0.85.1
0.85.2
0.85.3
0.85.4
0.85.5
0.85.6
0.86.0
0.86.1
0.86.3
0.86.4
0.86.5
0.86.6
0.86.7
0.86.8
0.87.0
0.87.1
0.87.2
0.88.0
0.89.0
0.90.0
0.90.1
0.90.3
0.91.0
0.92.0
0.92.1
0.92.2
0.93.0
0.94.0
0.94.1
0.94.2
0.94.3
0.94.4
0.94.5
0.94.6
0.94.7
0.94.8
0.94.9
0.95.0
0.95.1
0.95.2
0.95.3
0.95.4
0.95.5
0.95.6
0.95.7
0.96.0
0.96.1
0.96.2
0.96.3
0.96.4
0.96.5
0.96.6
0.96.7
0.96.8
0.96.9
0.96.10
0.96.11
0.97.0
0.98.0
0.98.1
0.99.0
0.99.1
0.99.2
0.99.3
0.99.5
0.99.6
0.99.7
0.99.9
0.100.0
0.100.1
0.100.2
0.100.3
0.100.4
0.100.5
0.100.6
0.100.7
0.100.8
0.100.9
0.101.0
0.101.1
0.102.0
0.103.0
0.103.1
0.103.2
0.103.3
0.103.4
0.103.5
0.104.0
0.104.1
0.104.2
0.104.3
0.105.1
0.105.2
0.105.3
0.105.7
0.105.8
0.105.9
0.106.0
0.106.1
0.106.2
0.107.0
0.107.1
0.108.0
0.108.1
0.109.0
0.109.1
0.110.0
0.111.0
0.112.0
0.112.1
0.112.2
0.112.3
0.113.0
0.114.0
0.114.1
0.114.2
0.114.3
0.114.4
0.114.5
0.114.7
0.114.8
0.115.0
0.115.1
0.115.2
0.115.3
0.115.4
0.116.0
0.117.0
0.118.0
0.118.1
0.118.2
0.118.3
0.118.4
0.118.5
0.119.0
0.119.1
0.120.0
0.121.0
0.121.1
0.121.2
0.121.3
0.121.4
0.121.5
0.121.6
0.121.7
0.121.8
0.122.0
0.122.1
0.122.2
0.122.3
0.122.4

Database specific

last_known_affected_version_range
"<= 0.122.4"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-96p7-33vc-xgf2/GHSA-96p7-33vc-xgf2.json"