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

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.

Published: 2023-08-11 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2023-39417 is rated Moderate Risk (56.1/100): CVSS High severity, with medium exploitation likelihood (EPSS 1.57%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2023-39417

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.68% 1.57% +0.90%
2 2026-03-21 0.62% 0.68% +0.06%
3 2026-02-12 0.62%

Full EPSS history (27 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2023-39417

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
7.5 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.6 5.9 [email protected]
8.8 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.9 [email protected]

Weakness enumeration for CVE-2023-39417

OS Trackers for CVE-2023-39417

vendor priority summary link
alpine CVE-2023-39417: 4 source package rows (postgresql12, postgresql13, postgresql14, postgresql15); 19 state rows across 11 repos (3.17-main, 3.18-community, 3.18-main, 3.19-community, 3.19-main, 3.20-community, 3.20-main, 3.21-community, 3.22-community, edge-community, edge-main); fixed 19, open 0. https://security.alpinelinux.org/vuln/CVE-2023-39417
debian not yet assigned CVE-2023-39417 not yet assigned priority: Debian including 2 source packages (postgresql-13, postgresql-15), 2 status rows across 2 suites (bookworm, bullseye): resolved 2. https://security-tracker.debian.org/tracker/CVE-2023-39417
redhat medium https://access.redhat.com/security/cve/CVE-2023-39417
suse medium CVE-2023-39417 severity moderate: SUSE including 501 source package names (14.9-12.30:libpq5-15.4-150200.5.12.1, 14.9-12.30:postgresql14-14.9-150200.5.29.1, …), 1376 product×package rows across 65 product lines (Container suse/postgres, Image SLES15-SP3-Manager-4-2-Server-BYOS-Azure, … (65 product lines)): Fixed 656, Known Not Affected 489, Known Affected 231. https://www.suse.com/security/cve/CVE-2023-39417/
ubuntu medium CVE-2023-39417 medium priority: Ubuntu including 7 source packages (postgresql-10, postgresql-12, …), 84 status rows across 12 suites (bionic, focal, jammy, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 65, ignored 9, released 6, needs-triage 3, deferred 1. https://ubuntu.com/security/CVE-2023-39417

Affected software / configurations for CVE-2023-39417

Vendor Product Version Raw CPE
postgresql postgresql >= 11.0, < 11.21 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 12.0, < 12.16 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 13.0, < 13.12 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 14.0, < 14.9 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
postgresql postgresql >= 15.0, < 15.4 cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*
redhat software_collections cpe:2.3:a:redhat:software_collections:-:*:*:*:*:*:*:*
redhat enterprise_linux 8.0 cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*
redhat enterprise_linux 9.0 cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*
debian debian_linux 8.0 cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*
debian debian_linux 11.0 cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
debian debian_linux 12.0 cpe:2.3:o:debian:debian_linux:12.0:*:*:*:*:*:*:*

References for CVE-2023-39417

URL Tags
https://access.redhat.com/errata/RHSA-2023:7545 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7579 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7580 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7581 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7616 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7656 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7666 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7667 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7694 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7695 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7714 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7770 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7772 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7784 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7785 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7883 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7884 Third Party Advisory
https://access.redhat.com/errata/RHSA-2023:7885 Third Party Advisory
https://access.redhat.com/errata/RHSA-2024:0304 Third Party Advisory
https://access.redhat.com/errata/RHSA-2024:0332 Third Party Advisory
https://access.redhat.com/errata/RHSA-2024:0337 Third Party Advisory
https://access.redhat.com/security/cve/CVE-2023-39417 Third Party Advisory
https://bugzilla.redhat.com/show_bug.cgi?id=2228111 Issue Tracking Third Party Advisory
https://www.postgresql.org/support/security/CVE-2023-39417 Vendor Advisory
https://lists.debian.org/debian-lts-announce/2023/10/msg00003.html
https://security.netapp.com/advisory/ntap-20230915-0002/
https://www.debian.org/security/2023/dsa-5553
https://www.debian.org/security/2023/dsa-5554
cvelogic Threat Intelligence