# CVE-2023-39417: Postgresql: extension script @substitutions@ within quoting allow sql injection

- Priority: **Routine**
- Reason: Not severe (CVSS 7.5, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-08-11 · Modified: 2026-11-26
- Aliases: ALPINE-CVE-2023-39417, SUSE-SU-2023:3341-1, SUSE-SU-2023:3343-1, SUSE-SU-2023:3344-1, SUSE-SU-2023:3345-1, SUSE-SU-2023:3346-1, SUSE-SU-2023:3348-1, UBUNTU-CVE-2023-39417, USN-6296-1, USN-6366-1, DEBIAN-CVE-2023-39417, DLA-3600-1, SUSE-SU-2023:3384-1, openSUSE-SU-2024:13118-1, openSUSE-SU-2024:13119-1, openSUSE-SU-2024:13120-1, openSUSE-SU-2024:13358-1, DLA-4806-1, DSA-6385-1
- Record: https://cvemate.com/vulnerability/CVE-2023-39417 · JSON: https://cvemate.com/vulnerability/CVE-2023-39417/json

## Description

```text
IN THE EXTENSION SCRIPT, a SQL Injection vulnerability was found in PostgreSQL if it uses @extowner@, @extschema@, or @extschema:...@ inside a quoting construct (dollar quoting, '', or ""). If an administrator has installed files of a vulnerable, trusted, non-bundled extension, an attacker with database-level CREATE privilege can execute arbitrary code as the bootstrap superuser.
```

## Signals

- CVSS: 8.8 high (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 1.632%, percentile 77.088%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 49)

- alpine postgresql (Alpine Linux): ≥ 11.0, \< 13.12-r0 \| ≥ 13.0, \< 13.12-r0
- alpine postgresql12 (Alpine Linux): \< 12.16-r0
- alpine postgresql13 (Alpine Linux): \< 13.12-r0
- alpine postgresql14 (Alpine Linux): \< 14.9-r0
- alpine postgresql15 (Alpine Linux): \< 15.4-r0
- debian pgextwlist (Debian): \< 1.15-2+deb12u1 \| \< 1.19-1+deb13u1 \| \< 1.20-1
- debian postgresql-11 (Debian): \< 11.21-0+deb10u2
- debian postgresql-15 (Debian): \< 15.5-0+deb12u1
- ubuntu postgresql-10 (Ubuntu): All versions (No fix recorded)
- ubuntu postgresql-12 (Ubuntu): \< 12.16-0ubuntu0.20.04.1
- ubuntu postgresql-14 (Ubuntu): \< 14.9-0ubuntu0.22.04.1
- ubuntu postgresql-9.3 (Ubuntu): All versions (No fix recorded)
- ubuntu postgresql-9.5 (Ubuntu): \< 9.5.25-0ubuntu0.16.04.1+esm5
- debian debian\_linux: 8.0 \| 11.0 \| 12.0
- postgresql postgresql: ≥ 11.0, \< 11.21 \| ≥ 12.0, \< 12.16 \| ≥ 13.0, \< 13.12 \| ≥ 14.0, \< 14.9 \| ≥ 15.0, \< 15.4
- redhat enterprise\_linux: 8.0 \| 9.0
- redhat software\_collections: na
- opensuse postgresql11&distro=openSUSE Tumbleweed (openSUSE): \< 11.21-1.1
- opensuse postgresql12&distro=openSUSE Leap 15.4 (openSUSE): \< 12.16-150200.8.47.1
- opensuse postgresql12&distro=openSUSE Leap 15.5 (openSUSE): \< 12.16-150200.8.47.1

## References (first 20 of 51)

- <https://access.redhat.com/errata/RHSA-2023:7545>
- <https://access.redhat.com/errata/RHSA-2023:7579>
- <https://access.redhat.com/errata/RHSA-2023:7580>
- <https://access.redhat.com/errata/RHSA-2023:7581>
- <https://access.redhat.com/errata/RHSA-2023:7616>
- <https://access.redhat.com/errata/RHSA-2023:7656>
- <https://access.redhat.com/errata/RHSA-2023:7666>
- <https://access.redhat.com/errata/RHSA-2023:7667>
- <https://access.redhat.com/errata/RHSA-2023:7694>
- <https://access.redhat.com/errata/RHSA-2023:7695>
- <https://access.redhat.com/errata/RHSA-2023:7714>
- <https://access.redhat.com/errata/RHSA-2023:7770>
- <https://access.redhat.com/errata/RHSA-2023:7772>
- <https://access.redhat.com/errata/RHSA-2023:7784>
- <https://access.redhat.com/errata/RHSA-2023:7785>
- <https://access.redhat.com/errata/RHSA-2023:7883>
- <https://access.redhat.com/errata/RHSA-2023:7884>
- <https://access.redhat.com/errata/RHSA-2023:7885>
- <https://access.redhat.com/errata/RHSA-2024:0304>
- <https://access.redhat.com/errata/RHSA-2024:0332>

---

Data as of 2026-12-05T03:01:15.517Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
