Skip to main content
No exploitation reportedFix available

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?

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
  1. 2023-08-1112:19CVE publishedCNA

Versions per branch

NVD · OSV
PostgreSQL
BranchAffectedFixed in
15.x≥ 15.0, < 15.415.4
14.x≥ 14.0, < 14.914.9
13.x≥ 13.0, < 13.1213.12
12.x≥ 12.0, < 12.1612.16
11.x≥ 11.0, < 11.2111.21
postgresql
BranchAffectedFixed in
15.x≥ 15.0.0, < 15.4.015.4.0
14.x≥ 14.0.0, < 14.9.014.9.0
13.x≥ 13.0.0, < 13.12.013.12.0
12.x≥ 12.0.0, < 12.16.012.16.0
11.x≥ 11.0.0, < 11.21.011.21.0
Debian debian linux
BranchAffectedFixed in
8.0= 8.0no fix published
11.0= 11.0no fix published
12.0= 12.0no fix published

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.

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

  • CVE-2023-39417 Red Hat Product Security2,578 products fixed · 39 known affected

    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

  • ICSA-26-120-06 CISA1 product fixed · 8 known affected

    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

  • RHSA-2024:0337 Red Hat Product Security15 products fixed

    Red Hat Security Advisory: RHACS 4.2 security update

  • RHSA-2024:0332 Red Hat Product Security15 products fixed

    Red Hat Security Advisory: ACS 4.1 enhancement update

  • RHSA-2024:0304 Red Hat Product Security15 products fixed

    Red Hat Security Advisory: RHACS 3.74 enhancement and security update

  • RHSA-2023:7884 Red Hat Product Security149 products fixed

    Red Hat Security Advisory: postgresql:15 security update

17 more advisories

Full record on NVD

Fix

  1. Update PostgreSQL to 15.4 · 14.9 · 13.12 · 12.16 · 11.21
  2. 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…
  3. 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
  4. 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.
  5. 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.
  6. 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.
  7. 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

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

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?

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.

Is CVE-2023-39417 actively exploited?

Active exploitation of CVE-2023-39417 has not been confirmed. Its EPSS score was 1.7% on 2026-11-15, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2023-39417?

CVE-2023-39417 has a CVSS v3 base score of 8.8 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

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

Sources for this record