VDB
Sign up
—

PYSEC-2026-2341

alerta-server has potential SQL Injection vulnerability in Query String Syntax (q=) API

Quick fix

PYSEC-2026-2341 — alerta-server: upgrade to the fixed version with the command below.

pip install --upgrade 'alerta-server>=9.1.0'

Details

### Impact The Query string search API (q=) was vulnerable to SQL injection via the Postgres query parser, which built WHERE clauses by interpolating user-supplied search terms directly into SQL strings via f-strings.

### Patches Fixed in v9.1.0. The Postgres query parser now uses parameterized queries with %(name)s placeholders passed to psycopg2's cursor.execute(), preventing SQL injection through the ?q= parameter. The MongoDB backend was not affected.

### Workarounds Upgrade to v9.1.0 or later. If unable to upgrade, deploy a proxy in front of the Alerta API to sanitize the q= parameter.

### Resources https://github.com/alerta/alerta/pull/712/files https://owasp.org/www-community/attacks/SQL_Injection

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/alerta-server
Introduced in: 0Fixed in: 9.1.0
Fixpip install --upgrade 'alerta-server>=9.1.0'

References