---
id: CVE-2026-34400
aliases:
  - GHSA-8prr-286p-4w7j
  - PYSEC-2026-2341
title: >-
  alerta-server has potential SQL Injection vulnerability in Query String Syntax
  (q=) API
summary: >-
  alerta-server has potential SQL Injection vulnerability in Query String Syntax
  (q=) API
severity: medium
vendor: alerta-server
product: alerta-server
ecosystem: pip
affected:
  - alerta-server < 9.1.0
patched:
  - alerta-server 9.1.0
published: '2026-03-31'
updated: '2026-07-13'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-8prr-286p-4w7j'
references:
  - url: 'https://github.com/alerta/alerta/security/advisories/GHSA-8prr-286p-4w7j'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-34400'
  - url: 'https://github.com/alerta/alerta/pull/2040'
  - url: 'https://github.com/alerta/alerta/pull/712'
  - url: >-
      https://github.com/alerta/alerta/commit/aeba85a37a09e5769a7a2da56481aa979ff99a00
  - url: >-
      https://github.com/alerta/alerta/commit/fdd52cd1abad8d02d1dfb8ecdcdbb43b6af3b883
  - url: 'https://github.com/alerta/alerta'
  - url: 'https://github.com/alerta/alerta/releases/tag/v9.1.0'
tags:
  - osv
  - pip
epss: 0.0059
epssPercentile: 0.4606
ingestedAt: '2026-07-13T18:57:55.230Z'
---

## Overview

### 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

## Affected packages

- `alerta-server < 9.1.0`

## Remediation

Upgrade to a patched release:

- `alerta-server 9.1.0`
