What’s Vulnerable › Vulnerabilities
CVE-2023-39417: Postgresql: extension script @substitutions@ within quoting allow sql injection
- Severity: high (CVSS 8.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.7% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2023-08-11 · updated 2026-11-01
- Weakness: CWE-89
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.
Affected products
- Debian Linux: 8.0, 11.0, 12.0 (and their updates)
- PostgreSQL: from 11.0 before 11.21; from 12.0 before 12.16; from 13.0 before 13.12; from 14.0 before 14.9; from 15.0 before 15.4 — fixed in 11.21, 12.16, 13.12, 14.9, 15.4
- Red Hat Enterprise Linux: 8.0, 9.0 (and their updates)
- RedHat Software Collections: all versions
- Red Hat Advanced Cluster Security 4.2: all versions — fixed in 4.2.4-6
- Red Hat Enterprise Linux 8: all versions — fixed in 8090020231114113712.a75119d5
- Red Hat Enterprise Linux 8.2 Advanced Update Support: all versions — fixed in 8020020231128165246.4cda2c84
- Red Hat Enterprise Linux 8.2 Telecommunications Update Service: all versions — fixed in 8020020231128165246.4cda2c84
- Red Hat Enterprise Linux 8.2 Update Services for SAP Solutions: all versions — fixed in 8020020231128165246.4cda2c84
- Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support: all versions — fixed in 8040020231127153301.522a0ee4
- Red Hat Enterprise Linux 8.4 Telecommunications Update Service: all versions — fixed in 8040020231127153301.522a0ee4
- Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions: all versions — fixed in 8040020231127153301.522a0ee4
- Red Hat Enterprise Linux 8.6 Extended Update Support: all versions — fixed in 8060020231114115246.ad008a3a
- Red Hat Enterprise Linux 8.8 Extended Update Support: all versions — fixed in 8080020231114105206.63b34585
- Red Hat Enterprise Linux 9: all versions — fixed in 0:13.13-1.el9_3
- Red Hat Enterprise Linux 9.0 Extended Update Support: all versions — fixed in 0:13.13-1.el9_0
- Red Hat Enterprise Linux 9.2 Extended Update Support: all versions — fixed in 0:13.13-1.el9_2
- Red Hat Software Collections: all versions
- Red Hat Software Collections for Red Hat Enterprise Linux 7: all versions — fixed in 0:12.17-1.el7
- Red Hat RHACS-3.74-RHEL-8: all versions — fixed in 3.74.8-9
- Red Hat RHACS-4.1-RHEL-8: all versions — fixed in 4.1.6-6
How to fix
Upgrade to a fixed version: PostgreSQL 11.21, 12.16, 13.12, 14.9; Red Hat Advanced Cluster Security 4.2 4.2.4-6; Red Hat Enterprise Linux 8 8090020231114113712.a75119d5; Red Hat Enterprise Linux 8.2 Advanced Update Support 8020020231128165246.4cda2c84; Red Hat Enterprise Linux 8.2 Telecommunications Update Service 8020020231128165246.4cda2c84; Red Hat Enterprise Linux 8.2 Update Services for SAP Solutions 8020020231128165246.4cda2c84; Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support 8040020231127153301.522a0ee4; Red Hat Enterprise Linux 8.4 Telecommunications Update Service 8040020231127153301.522a0ee4; Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions 8040020231127153301.522a0ee4; Red Hat Enterprise Linux 8.6 Extended Update Support 8060020231114115246.ad008a3a; Red Hat Enterprise Linux 8.8 Extended Update Support 8080020231114105206.63b34585; Red Hat Enterprise Linux 9 0:13.13-1.el9_3. Check the vendor advisory for mitigations.
References
- 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
Get alerted when CVE-2023-39417 or the next vulnerability affects your stack