# CVE-2026-32687: SQL injection via channel name in Postgrex.Notifications.listen/3 and unlisten/3

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v4.0, CNA) `CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: High; Integrity impact: High; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.22% (percentile 8, 2026-11-26)
- **CWE:** CWE-89
- **Published:** 2026-05-12T14:18:07.607Z
- **Modified:** 2026-11-20T06:17:25.653Z

## Who should check

- Anyone running elixir-ecto postgrex \>= 0.16.0, \< 0.22.2
- Anyone running elixir-ecto postgrex \>= 266b530faf9bde094e31e0e4ab851f933fadc0f5, \< 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770

## Description

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex (Postgrex.Notifications module) allows SQL Injection.

The channel argument passed to Postgrex.Notifications.listen/3 and Postgrex.Notifications.unlisten/3 is interpolated directly into LISTEN "..." / UNLISTEN "..." SQL statements without escaping the " character. An attacker who can influence the channel name can inject a " to break out of the quoted identifier and append arbitrary SQL. Because the notifications connection uses the PostgreSQL simple query protocol, multi-statement payloads are accepted, allowing DDL and DML commands to be chained (e.g. ; DROP TABLE ...; --). The same unsanitized interpolation also occurs in handle\_connect/1 when replaying LISTEN commands after a reconnect.

This vulnerability is associated with program file lib/postgrex/notifications.ex and program routines Postgrex.Notifications.listen/3, Postgrex.Notifications.unlisten/3, Postgrex.Notifications.handle\_connect/1.

This issue affects postgrex: from 0.16.0 before 0.22.2.

## Affected and fixed versions

- elixir-ecto postgrex: \>= 0.16.0, \< 0.22.2 (cvelist)
- elixir-ecto postgrex: \>= 266b530faf9bde094e31e0e4ab851f933fadc0f5, \< 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770 (cvelist)

## Mitigation

- Upgrade postgrex to 0.22.2 or later.
- Upgrade postgrex to 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-32687. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-32687.md
Affected: elixir-ecto postgrex >= 0.16.0, < 0.22.2; elixir-ecto postgrex >= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770
Fixed in: elixir-ecto postgrex 0.22.2, elixir-ecto postgrex 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770

Steps:
1. Search this machine and project for elixir-ecto postgrex: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-32687 being exploited?

There is no confirmed exploitation: CVE-2026-32687 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.22% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-32687?

High: CVSS 7.5 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-32687?

elixir-ecto postgrex \>= 0.16.0, \< 0.22.2; elixir-ecto postgrex \>= 266b530faf9bde094e31e0e4ab851f933fadc0f5, \< 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770.

### Is there a fix for CVE-2026-32687?

Yes. Fixed in elixir-ecto postgrex 0.22.2, elixir-ecto postgrex 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770. Upgrade postgrex to 0.22.2 or later. Upgrade postgrex to 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770 or later.

### How do I check if I'm affected by CVE-2026-32687?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/elixir-ecto/ecto/security/advisories/GHSA-r73h-97w8-m54h>
- patch: <https://github.com/elixir-ecto/postgrex/commit/266b530faf9bde094e31e0e4ab851f933fadc0f5>
- patch: <https://github.com/elixir-ecto/postgrex/commit/7cdedbd4316bb65f82e6a9a4f922c0ac491cb770>
- other: <https://cna.erlef.org/cves/CVE-2026-32687.html>
- other: <https://osv.dev/vulnerability/EEF-CVE-2026-32687>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-32687>

HTML: <https://flawdb.com/CVE-2026-32687> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-32687>
