CVE-2023-39417Postgresql: 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.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 22.04 | postgresql-14 | Fixed | 14.9-0ubuntu0.22.04.1 | UBUNTU-CVE-2023-39417 |
| Ubuntu 20.04 | postgresql-12 | Fixed | 12.16-0ubuntu0.20.04.1 | UBUNTU-CVE-2023-39417 |
| Ubuntu 18.04 | postgresql-10 | Fix pending | UBUNTU-CVE-2023-39417 | |
| Ubuntu 16.04 | postgresql-9.5 | Fix pending | 9.5.25-0ubuntu0.16.04.1+esm5 (Ubuntu Pro) | UBUNTU-CVE-2023-39417 |
| Ubuntu 14.04 | postgresql-9.1 | Fix pending | ||
| Ubuntu 14.04 | postgresql-9.3 | Fix pending | UBUNTU-CVE-2023-39417 | |
| Debian 14 | pgextwlist | Fixed | 1.20-1 | DEBIAN-CVE-2023-39417 |
| Debian 13 | pgextwlist | Fixed | 1.19-1+deb13u1 | DEBIAN-CVE-2023-39417 |
| Debian 12 | pgextwlist | Fixed | 1.15-2+deb12u1 | DEBIAN-CVE-2023-39417 |
| Debian 12 | postgresql-15 | Fixed | 15.5-0+deb12u1 | DEBIAN-CVE-2023-39417 |
| Red Hat Enterprise Linux 9 | pg_repack | Fixed | 0:1.4.8-1.module+el9.2.0+17405+aeb9ec60 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | pgaudit | Fixed | 0:1.7.0-1.module+el9.2.0+17405+aeb9ec60 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgres-decoderbufs | Fixed | 0:1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-contrib | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-docs | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-plperl | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-plpython3 | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-pltcl | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-private-devel | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-private-libs | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-server | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-server-devel | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-static | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-test | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7784 |
| Red Hat Enterprise Linux 9 | postgresql-test-rpm-macros | Fixed | 0:15.5-1.module+el9.2.0.z+20667+a2d2a8a9 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-upgrade | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 9 | postgresql-upgrade-devel | Fixed | 0:13.13-1.el9_3 | RHSA-2023:7785 |
| Red Hat Enterprise Linux 8 | pg_repack | Fixed | 0:1.4.8-1.module+el8.9.0+19797+c4ce5969 | RHSA-2023:7714 |
| Red Hat Enterprise Linux 8 | pgaudit | Fixed | 0:1.4.0-5.module+el8.9.0+19330+c97ddbdf | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgres-decoderbufs | Fixed | 0:0.10.0-2.module+el8.9.0+19330+c97ddbdf | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql | Fixed | 0:12.17-1.module+el8.9.0+20789+410e66ce | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql-contrib | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql-docs | Fixed | 0:12.17-1.module+el8.9.0+20789+410e66ce | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql-plperl | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7714 |
| Red Hat Enterprise Linux 8 | postgresql-plpython3 | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7714 |
| Red Hat Enterprise Linux 8 | postgresql-pltcl | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-private-devel | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-private-libs | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-server | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql-server-devel | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-static | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7714 |
| Red Hat Enterprise Linux 8 | postgresql-test | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-test-rpm-macros | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7884 |
| Red Hat Enterprise Linux 8 | postgresql-upgrade | Fixed | 0:15.5-1.module+el8.9.0+20663+03952ce4 | RHSA-2023:7581 |
| Red Hat Enterprise Linux 8 | postgresql-upgrade-devel | Fixed | 0:13.13-1.module+el8.9.0+20664+9c30cf7f | RHSA-2023:7884 |
| Red Hat Enterprise Linux 7 | postgresql | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-contrib | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-plperl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-plpython | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-pltcl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-server | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-static | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-test | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | postgresql-upgrade | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-contrib | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-docs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-libs | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-plperl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-plpython | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-pltcl | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-server | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | postgresql-test | Will not fix Out of support scope | ||
| AlmaLinux 9 | pg_repack | Fixed | 1.4.8-1.module_el9.2.0+22+09653793 | ALSA-2023:7785 |
| AlmaLinux 9 | pgaudit | Fixed | 1.7.0-1.module_el9.2.0+22+09653793 | ALSA-2023:7785 |
| AlmaLinux 9 | postgres-decoderbufs | Fixed | 1.9.7-1.Final.module_el9.2.0+22+09653793 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7784 |
| AlmaLinux 9 | postgresql-contrib | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7784 |
| AlmaLinux 9 | postgresql-docs | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-plperl | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-plpython3 | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-pltcl | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-private-devel | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7784 |
| AlmaLinux 9 | postgresql-private-libs | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-server | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-server-devel | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7784 |
| AlmaLinux 9 | postgresql-static | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-test | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-test-rpm-macros | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-upgrade | Fixed | 13.13-1.el9_3 | ALSA-2023:7785 |
| AlmaLinux 9 | postgresql-upgrade-devel | Fixed | 15.5-1.module_el9.3.0+52+21733919 | ALSA-2023:7784 |
| AlmaLinux 8 | pg_repack | Fixed | 1.4.6-3.module_el8.6.0+2758+4f4474df | ALSA-2023:7714 |
| AlmaLinux 8 | pgaudit | Fixed | 1.4.0-5.module_el8.6.0+2758+4f4474df | ALSA-2023:7714 |
| AlmaLinux 8 | postgres-decoderbufs | Fixed | 0.10.0-2.module_el8.6.0+3094+eb237fb8 | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7714 |
| AlmaLinux 8 | postgresql-contrib | Fixed | 12.17-1.module_el8.9.0+3704+f1f917ce | ALSA-2023:7581 |
| AlmaLinux 8 | postgresql-docs | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7581 |
| AlmaLinux 8 | postgresql-plperl | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-plpython3 | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7714 |
| AlmaLinux 8 | postgresql-pltcl | Fixed | 12.17-1.module_el8.9.0+3704+f1f917ce | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-private-devel | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-private-libs | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-server | Fixed | 12.17-1.module_el8.9.0+3704+f1f917ce | ALSA-2023:7581 |
| AlmaLinux 8 | postgresql-server-devel | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7581 |
| AlmaLinux 8 | postgresql-static | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-test | Fixed | 15.5-1.module_el8.9.0+3706+885c732e | ALSA-2023:7581 |
| AlmaLinux 8 | postgresql-test-rpm-macros | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-upgrade | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7884 |
| AlmaLinux 8 | postgresql-upgrade-devel | Fixed | 13.13-1.module_el8.9.0+3692+8714f643 | ALSA-2023:7714 |
| Rocky Linux 9 | pgaudit | Fixed | 0:1.7.0-1.module+el9.5.0+30637+4391fcca | RLSA-2023:7785 |
| Rocky Linux 9 | postgres-decoderbufs | Fixed | 0:1.9.7-1.Final.module+el9.5.0+30637+4391fcca | RLSA-2023:7785 |
| Rocky Linux 8 | pg_repack | Fixed | 0:1.4.8-1.module+el8.10.0+1858+fcc46a79 | RLSA-2023:7884 |
| Rocky Linux 8 | pgaudit | Fixed | 0:1.5.0-1.module+el8.8.0+1443+0e26d3b2 | RLSA-2023:7884 |
| Rocky Linux 8 | postgres-decoderbufs | Fixed | 0:1.9.7-1.Final.module+el8.10.0+40056+df351139 | RLSA-2023:7714 |
| Rocky Linux 8 | postgresql | Fixed | 0:13.13-1.module+el8.9.0+1593+6cfc6c10 | RLSA-2023:7714 |
| Alpine Linux 3.22 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.21 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.20 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.20 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.19 | postgresql13 | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.19 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.19 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.18 | postgresql12 | Fixed | 12.16-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.18 | postgresql13 | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.18 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.18 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.17 | postgresql12 | Fixed | 12.16-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.17 | postgresql13 | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.17 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.17 | postgresql15 | Fixed | 15.4-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.16 | postgresql12 | Fixed | 12.16-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.16 | postgresql13 | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.16 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.15 | postgresql12 | Fixed | 12.16-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.15 | postgresql13 | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.15 | postgresql14 | Fixed | 14.9-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.14 | postgresql | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
| Alpine Linux 3.13 | postgresql | Fixed | 13.12-r0 | ALPINE-CVE-2023-39417 |
What the vendor says
As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Red Hat Advanced Cluster Security 4.2
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 8.2 Advanced Update Support
- Red Hat Enterprise Linux 8.2 Telecommunications Update Service
- Red Hat Enterprise Linux 8.2 Update Services for SAP Solutions
- Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support
- Red Hat Enterprise Linux 8.4 Telecommunications Update Service
- Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions
- Red Hat Enterprise Linux 8.6 Extended Update Support
- Red Hat Enterprise Linux 8.8 Extended Update Support
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 9.0 Extended Update Support
Vendor advisories:
- https://access.redhat.com/errata/RHSA-2023:7545 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2023:7579 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2023:7580 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2023:7581 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2023:7616 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2023:7656 (vendor-advisory)
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
- https://access.redhat.com/errata/RHSA-2023:7772
- https://access.redhat.com/errata/RHSA-2023:7784
- https://access.redhat.com/errata/RHSA-2023:7785
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.