CVE-2023-39417
Postgresql: extension script @substitutions@ within quoting allow sql injection
No exploitation reported by the sources we read.
- Published2023-08-11
- Fixed in15.4 · 14.9 · 13.12 · 12.16 · 11.21
- WeaknessCWE-89
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
Description
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.
Timeline
dates in UTC- 2023-08-1112:19CVE publishedCNA
Versions per branch
NVD · OSV| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 15.x | ≥ 15.0, < 15.4 | 15.4 | NVD |
| 14.x | ≥ 14.0, < 14.9 | 14.9 | NVD |
| 13.x | ≥ 13.0, < 13.12 | 13.12 | NVD |
| 12.x | ≥ 12.0, < 12.16 | 12.16 | NVD |
| 11.x | ≥ 11.0, < 11.21 | 11.21 | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 15.x | ≥ 15.0.0, < 15.4.0 | 15.4.0 | OSV |
| 14.x | ≥ 14.0.0, < 14.9.0 | 14.9.0 | OSV |
| 13.x | ≥ 13.0.0, < 13.12.0 | 13.12.0 | OSV |
| 12.x | ≥ 12.0.0, < 12.16.0 | 12.16.0 | OSV |
| 11.x | ≥ 11.0.0, < 11.21.0 | 11.21.0 | OSV |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 8.0 | = 8.0 | no fix published | NVD |
| 11.0 | = 11.0 | no fix published | NVD |
| 12.0 | = 12.0 | no fix published | NVD |
2 more products in the sources.
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Products declared by the CNA43 products
As redhat, the CNA that assigned this CVE, declared them in the CVE record; versions as written.
- Red Hat Advanced Cluster Security 4.2other versions: affected
package advanced-cluster-security/rhacs-central-db-rhel8https://catalog.redhat.com/software/containers/
Not affected ≥ 4.2.4-6
- Red Hat Advanced Cluster Security 4.2other versions: affected
package advanced-cluster-security/rhacs-main-rhel8https://catalog.redhat.com/software/containers/
Not affected ≥ 4.2.4-6
- Red Hat Advanced Cluster Security 4.2other versions: affected
package advanced-cluster-security/rhacs-operator-bundlehttps://catalog.redhat.com/software/containers/
Not affected ≥ 4.2.4-7
- Red Hat Advanced Cluster Security 4.2other versions: affected
package advanced-cluster-security/rhacs-scanner-db-rhel8https://catalog.redhat.com/software/containers/
Not affected ≥ 4.2.4-6
- Red Hat Advanced Cluster Security 4.2other versions: affected
package advanced-cluster-security/rhacs-scanner-db-slim-rhel8https://catalog.redhat.com/software/containers/
Not affected ≥ 4.2.4-7
- Red Hat Enterprise Linux 8other versions: affected
package postgresql:13https://access.redhat.com/downloads/content/package-browser/
Not affected ≥ 8090020231114113712.a75119d5
37 more products in the CVE record.
Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-11-06
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- libpqopenEuler:22.03-LTS-SP2all versions · fixed in 13.12-1.oe2203sp2and 1 other package
- libpqopenEuler:22.03-LTS-SP1all versions · fixed in 13.12-1.oe2203sp1
- libpq5TuxCare:Ubuntu:18.04all versions · fixed in 10.23-0ubuntu0.18.04.2+tuxcare.els1and 13 other packages
- libpq5TuxCare:Ubuntu:16.04all versions · fixed in 9.5.25-0ubuntu0.16.04.1+tuxcare.els5and 14 other packages
- libpq5-9.6TuxCare:Debian:10all versions · fixed in 9.6.24-0+deb10u1+tuxcare.els3and 14 other packages
- pg_repackRocky Linux:8all versions · fixed in 0:1.4.6-3.module+el8.5.0+684+c3892ef9
- pg_repackRocky Linux:8all versions · fixed in 0:1.4.8-1.module+el8.10.0+1622+bd25b19c
- pg_repackRocky Linux:8all versions · fixed in 0:1.4.8-1.module+el8.10.0+1858+fcc46a79
184 more package ranges on OSV.dev
Vendor advisories
postgresql: extension script @substitutions@ within quoting allow SQL injection
postgresql as a component of Red Hat Enterprise Linux 6 · postgresql-contrib as a component of Red Hat Enterprise Linux 6 · postgresql-devel as a component of Red Hat Enterprise Linux 6 · +36 more
ABB Ability Symphony Plus Engineering
ABB Ability Symphony Plus S+ Engineering 2.2 · ABB Ability Symphony Plus S+ Engineering 2.3 · ABB Ability Symphony Plus S+ Engineering 2.3 RU1 · +5 more
Red Hat Security Advisory: RHACS 4.2 security update
Red Hat Security Advisory: ACS 4.1 enhancement update
Red Hat Security Advisory: RHACS 3.74 enhancement and security update
Red Hat Security Advisory: postgresql:15 security update
17 more advisories
Fix
- Update PostgreSQL to 15.4 · 14.9 · 13.12 · 12.16 · 11.21
- Vendor fix CISA ICSA-26-120-06 · 8 productsABB advises all customers to review their installations to determine if they are using an impacted product as listed above, no further analysis or tools are needed to make this determination. The recommended immediate actions per product are listed below: - Systems using S+ Engineering 2.2 throug…
- Vendor fix Red Hat Product Security RHSA-2024:0337 · 15 productsBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258
- Vendor fix Red Hat Product Security RHSA-2024:0332 · 15 productsIf you are using an earlier version of RHACS 4.1, you are advised to upgrade to patch release 4.1.6.
- Vendor fix Red Hat Product Security RHSA-2024:0304 · 15 productsIf you are using an earlier version of RHACS 3.74, you are advised to upgrade to patch release 3.74.8.
- Vendor fix Red Hat Product Security RHSA-2023:7884 · 149 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing this update.
- Workaround from the vendor CISA ICSA-26-120-06 · 8 productsNo workarounds are available. Assess the installation specific risk based on this advisory. Use the recommendations described under “Mitigating factors” or “Recommended immediate actions”.
Advisories and patches
- www.postgresql.orgVendor Advisory
Detection
- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof of concept
- PoC-in-GitHubno public repository identifiedread 2026-11-16
- Metasploit modules
- none listed Metasploit Framework
Sources
- CISA-ADPSSVC decisionnone2025-07-09
- CNACVSS 3.17.52026-11-06
- NVDCVSS 3.18.8read 2026-11-06
- CNAweakness (CWE)CWE-892026-11-06
- NVDweakness (CWE)CWE-89read 2026-11-06
- FIRST EPSSEPSS score1.7 %2026-11-15
- OSVaffected packages—
- GitHub Advisoriesadvisory—
Identifiers
- AZL-27892same flawAzure Linux · MIT
- BIT-postgresql-2023-39417same flawBitnami · Apache-2.0
- EUVD-2023-43141same flawENISA EUVD · LicenseRef-ENISA-legal-notice
- GHSA-jx3x-j983-74m3same flawGitHub Advisory Database · CC-BY-4.0
- JLSEC-2026-42same flawJulia Security Advisories · CC-BY-4.0
- ALSA-2023:7581advisory covering several CVEsAlmaLinux · MIT
- ALSA-2023:7714advisory covering several CVEsAlmaLinux · MIT
- ALSA-2023:7784advisory covering several CVEsAlmaLinux · MIT
- ALSA-2023:7785advisory covering several CVEsAlmaLinux · MIT
- ALSA-2023:7884advisory covering several CVEsAlmaLinux · MIT
- DLA-3600-1advisory covering several CVEsDebian · LicenseRef-unstated
- DSA-5553-1advisory covering several CVEsDebian · LicenseRef-unstated
- DSA-5554-1advisory covering several CVEsDebian · LicenseRef-unstated
- MGASA-2023-0261advisory covering several CVEsMageia · LicenseRef-unstated
- OESA-2023-1567advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2023-1568advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2023-1576advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2023-1577advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2023-1578advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-1335advisory covering several CVEsopenEuler · LicenseRef-unstated
- openSUSE-SU-2024:13118-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2024:13119-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2024:13120-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2024:13134-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2024:13358-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- RHSA-2023:7545advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7579advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7580advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7581advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7616advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7656advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7666advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7667advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7694advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7695advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7714advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7770advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7772advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7784advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7785advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7883advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7884advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2023:7885advisory covering several CVEsRed Hat · CC-BY-4.0
- RLSA-2023:7581advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2023:7714advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2023:7785advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2023:7884advisory covering several CVEsRocky Linux · BSD-3-Clause
- SUSE-SU-2023:3341-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2023:3342-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2023:3343-1advisory covering several CVEsSUSE · LicenseRef-unstated
Technical details
- CVSS v3 Vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Published
- 2023-08-11
- Last Modified
- 2026-11-06
- NVD status
- Modified
- GitHub Advisory
- GHSA-jx3x-j983-74m3
Frequently asked questions
What is CVE-2023-39417?
Is CVE-2023-39417 actively exploited?
What is the CVSS score for CVE-2023-39417?
Running PostgreSQL? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website lookups · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
Sources for this record
- CISA ICS advisories (CSAF) · Public domain (US Government work)
- CVE Program · CVE Program Terms of Use
- ENISA EU Vulnerability Database · ENISA legal notice §1.2 (reproduction authorised, provided the source is acknowledged)
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-jx3x-j983-74m3
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0
- CISA Vulnrichment · CC0-1.0