Skip to content
OpenAdvisories
High · 7.5 CVE-2023-39417 EUVD-2023-43141GHSA-jx3x-j983-74m3

Postgresql: extension script @substitutions@ within quoting allow sql injection

Published Aug 11, 2023 · Updated Nov 6, 2026 · Assigned by redhat

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

VendorProductAffectedFixed
Red Hat Red Hat Advanced Cluster Security 4.2 — —
Red Hat Red Hat Enterprise Linux 8 — —
Red Hat Red Hat Enterprise Linux 8.2 Advanced Update Support — —
Red Hat Red Hat Enterprise Linux 8.2 Telecommunications Update Service — —
Red Hat Red Hat Enterprise Linux 8.2 Update Services for SAP Solutions — —
Red Hat Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support — —
Red Hat Red Hat Enterprise Linux 8.4 Telecommunications Update Service — —
Red Hat Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions — —
Red Hat Red Hat Enterprise Linux 8.6 Extended Update Support — —
Red Hat Red Hat Enterprise Linux 8.8 Extended Update Support — —
Red Hat Red Hat Enterprise Linux 9 — —
Red Hat Red Hat Enterprise Linux 9.0 Extended Update Support — —
Red Hat Red Hat Enterprise Linux 9.2 Extended Update Support — —
Red Hat Red Hat Software Collections for Red Hat Enterprise Linux 7 — —
Red Hat RHACS-3.74-RHEL-8 — —
Red Hat RHACS-4.1-RHEL-8 — —
Red Hat Red Hat Enterprise Linux 6 — —
Red Hat Red Hat Enterprise Linux 7 — —
Red Hat Red Hat Software Collections — —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 pgextwlist 1.20-1 —
Debian 13 pgextwlist 1.19-1+deb13u1 —
Debian 12 pgextwlist 1.15-2+deb12u1 —
Debian 12 postgresql-15 15.5-0+deb12u1 DSA-5553-1
Debian 11 postgresql-13 13.13-0+deb11u1 DSA-5554-1
Debian 10 postgresql-11 11.21-0+deb10u2 DLA-3600-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS postgresql-14 14.9-0ubuntu0.22.04.1 USN-6296-1
Ubuntu 20.04 LTS postgresql-12 12.16-0ubuntu0.20.04.1 USN-6296-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS postgresql-10 No fix yet —
Ubuntu Pro 16.04 LTS postgresql-9.5 9.5.25-0ubuntu0.16.04.1+esm5 USN-6366-1
Ubuntu Pro 14.04 LTS postgresql-9.3 No fix yet —
ReleasePackageFixed inAdvisory
RHEL 9 pg_repack 1.4.8-1.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7785
RHEL 9 pgaudit 1.7.0-1.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7785
RHEL 9 postgres-decoderbufs 1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7785
RHEL 9 postgresql +13 13.13-1.el9_3 RHSA-2023:7785, RHSA-2023:7784
RHEL 9 postgresql-test-rpm-macros 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 RHSA-2023:7785
RHEL 8 pg_repack 1.4.6-3.module+el8.9.0+19330+c97ddbdf RHSA-2023:7884, RHSA-2023:7714, RHSA-2023:7581
RHEL 8 pgaudit 1.4.0-5.module+el8.9.0+19330+c97ddbdf RHSA-2023:7884, RHSA-2023:7714, RHSA-2023:7581
RHEL 8 postgres-decoderbufs 0.10.0-2.module+el8.9.0+19330+c97ddbdf RHSA-2023:7884, RHSA-2023:7714, RHSA-2023:7581
RHEL 8 postgresql +12 12.17-1.module+el8.9.0+20789+410e66ce RHSA-2023:7884, RHSA-2023:7714, RHSA-2023:7581
RHEL 8 postgresql-private-libs +1 15.5-1.module+el8.9.0+20663+03952ce4 RHSA-2023:7884
RHEL 3 rh-postgresql12-postgresql +13 12.17-1.el7 RHSA-2023:7770
RHEL 3 rh-postgresql13-postgresql +14 13.13-1.el7 RHSA-2023:7772
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 9.2 EUS pg_repack 1.4.8-1.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7885
RHEL 9.2 EUS pgaudit 1.7.0-1.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7885
RHEL 9.2 EUS postgres-decoderbufs 1.9.7-1.Final.module+el9.2.0+17405+aeb9ec60 RHSA-2023:7885
RHEL 9.2 EUS postgresql +13 13.13-1.el9_2 RHSA-2023:7885, RHSA-2023:7616
RHEL 9.2 EUS postgresql-test-rpm-macros 15.5-1.module+el9.2.0.z+20667+a2d2a8a9 RHSA-2023:7885
RHEL 9.0 EUS postgresql +10 13.13-1.el9_0 RHSA-2023:7545
RHEL 8.8 EUS pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5 RHSA-2023:7883, RHSA-2023:7656, RHSA-2023:7579
RHEL 8.8 EUS pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5 RHSA-2023:7883, RHSA-2023:7656, RHSA-2023:7579
RHEL 8.8 EUS postgres-decoderbufs 0.10.0-2.module+el8.4.0+8873+b821c30a RHSA-2023:7883, RHSA-2023:7656, RHSA-2023:7579
RHEL 8.8 EUS postgresql +12 12.17-1.module+el8.8.0+20722+3bb5d7ac RHSA-2023:7883, RHSA-2023:7656, RHSA-2023:7579
RHEL 8.8 EUS postgresql-private-libs +1 15.5-1.module+el8.8.0+20658+5fb3eedd RHSA-2023:7883
RHEL 8.6 EUS pg_repack 1.4.6-3.module+el8.5.0+11354+78b3c9c5 RHSA-2023:7666, RHSA-2023:7580
RHEL 8.6 EUS pgaudit 1.4.0-5.module+el8.5.0+11354+78b3c9c5 RHSA-2023:7666, RHSA-2023:7580
RHEL 8.6 EUS postgres-decoderbufs 0.10.0-2.module+el8.4.0+8873+b821c30a RHSA-2023:7666, RHSA-2023:7580
RHEL 8.6 EUS postgresql +12 12.17-1.module+el8.6.0+20721+c66fb2f5 RHSA-2023:7666, RHSA-2023:7580
RHEL 8.4 TUS pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 TUS postgres-decoderbufs 0.10.0-2.module+el8.4.0+8873+b821c30a RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 TUS postgresql +12 12.17-1.module+el8.4.0+20773+7c41d490 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 E4S pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 E4S postgres-decoderbufs 0.10.0-2.module+el8.4.0+8873+b821c30a RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 E4S postgresql +12 12.17-1.module+el8.4.0+20773+7c41d490 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 AUS pgaudit 1.4.0-6.module+el8.4.0+11288+c193d6d7 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 AUS postgres-decoderbufs 0.10.0-2.module+el8.4.0+8873+b821c30a RHSA-2023:7695, RHSA-2023:7694
RHEL 8.4 AUS postgresql +12 12.17-1.module+el8.4.0+20773+7c41d490 RHSA-2023:7695, RHSA-2023:7694
RHEL 8.2 TUS pgaudit 1.4.0-4.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 TUS postgres-decoderbufs 0.10.0-2.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 TUS postgresql +12 12.17-1.module+el8.2.0+20720+50ffbc0b RHSA-2023:7667
RHEL 8.2 E4S pgaudit 1.4.0-4.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 E4S postgres-decoderbufs 0.10.0-2.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 E4S postgresql +12 12.17-1.module+el8.2.0+20720+50ffbc0b RHSA-2023:7667
RHEL 8.2 AUS pgaudit 1.4.0-4.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 AUS postgres-decoderbufs 0.10.0-2.module+el8.2.0+9043+1dbb5661 RHSA-2023:7667
RHEL 8.2 AUS postgresql +12 12.17-1.module+el8.2.0+20720+50ffbc0b RHSA-2023:7667

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 pg_repack 1.4.8-1.module_el9.2.0+22+09653793 ALSA-2023:7785
AlmaLinux 9 pgaudit 1.7.0-1.module_el9.2.0+22+09653793 ALSA-2023:7785
AlmaLinux 9 postgres-decoderbufs 1.9.7-1.Final.module_el9.2.0+22+09653793 ALSA-2023:7785
AlmaLinux 9 postgresql +13 13.13-1.el9_3 ALSA-2023:7785, ALSA-2023:7784
AlmaLinux 9 postgresql-test-rpm-macros 15.5-1.module_el9.3.0+52+21733919 ALSA-2023:7785
AlmaLinux 8 pg_repack 1.4.6-3.module_el8.6.0+2758+4f4474df ALSA-2023:7884, ALSA-2023:7714, ALSA-2023:7581
AlmaLinux 8 pgaudit 1.4.0-5.module_el8.6.0+2758+4f4474df ALSA-2023:7884, ALSA-2023:7714, ALSA-2023:7581
AlmaLinux 8 postgres-decoderbufs 0.10.0-2.module_el8.6.0+2758+4f4474df ALSA-2023:7884, ALSA-2023:7714, ALSA-2023:7581
AlmaLinux 8 postgresql +12 12.17-1.module_el8.9.0+3704+f1f917ce ALSA-2023:7884, ALSA-2023:7714, ALSA-2023:7581
AlmaLinux 8 postgresql-private-libs +1 15.5-1.module_el8.9.0+3706+885c732e ALSA-2023:7884

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 pgaudit 1.7.0-1.module+el9.5.0+30637+4391fcca RLSA-2023:7785
Rocky Linux 9 postgres-decoderbufs 1.9.7-1.Final.module+el9.5.0+30637+4391fcca RLSA-2023:7785
Rocky Linux 8 pg_repack 1.4.6-3.module+el8.5.0+684+c3892ef9 RLSA-2023:7884, RLSA-2023:7714, RLSA-2023:7581
Rocky Linux 8 pgaudit 1.4.0-5.module+el8.9.0+1331+6f33d496 RLSA-2023:7884, RLSA-2023:7714, RLSA-2023:7581
Rocky Linux 8 postgres-decoderbufs 0.10.0-2.module+el8.5.0+684+c3892ef9 RLSA-2023:7884, RLSA-2023:7714, RLSA-2023:7581
Rocky Linux 8 postgresql 12.17-1.module+el8.9.0+1603+444d1b54 RLSA-2023:7714, RLSA-2023:7581
ReleasePackageFixed inAdvisory
SLES 15 SP5 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
SLES 15 SP5 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
SLES 15 SP4 postgresql13 13.12-150200.5.43.1 SUSE-SU-2023:3344-1
SLES 15 SP4 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
SLES 15 SP4 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
SLES 15 SP1 postgresql12 12.16-150100.3.44.1 SUSE-SU-2023:3346-1
SLES 12 SP5 postgresql12 12.16-3.42.1 SUSE-SU-2023:3341-1
SLES 12 SP5 postgresql13 13.12-3.36.1 SUSE-SU-2023:3345-1
SLES 12 SP5 postgresql14 14.9-3.26.1 SUSE-SU-2023:3343-1
SLES 12 SP5 postgresql15 15.4-3.12.1 SUSE-SU-2023:3342-1
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP1 postgresql12 12.16-150100.3.44.1 SUSE-SU-2023:3346-1
SLES for SAP 12 SP5 postgresql12 12.16-3.42.1 SUSE-SU-2023:3341-1
SLES for SAP 12 SP5 postgresql13 13.12-3.36.1 SUSE-SU-2023:3345-1
SLES for SAP 12 SP5 postgresql14 14.9-3.26.1 SUSE-SU-2023:3343-1
SLES for SAP 12 SP5 postgresql15 15.4-3.12.1 SUSE-SU-2023:3342-1
SLE HPC 15 SP1 postgresql12 12.16-150100.3.44.1 SUSE-SU-2023:3346-1
SUSE Manager Server 4.2 postgresql13 13.12-150200.5.43.1 SUSE-SU-2023:3344-1
SUSE Manager Server 4.2 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
SUSE Manager Server 4.2 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
SUSE Manager Proxy 4.2 postgresql13 13.12-150200.5.43.1 SUSE-SU-2023:3344-1
SUSE Manager Proxy 4.2 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
SUSE Manager Proxy 4.2 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed postgresql11 11.21-1.1 openSUSE-SU-2024:13118-1
openSUSE Tumbleweed postgresql12 12.16-1.1 openSUSE-SU-2024:13119-1
openSUSE Tumbleweed postgresql13 13.12-1.1 openSUSE-SU-2024:13120-1
openSUSE Tumbleweed postgresql14 14.9-1.1 openSUSE-SU-2024:13358-1
openSUSE Tumbleweed postgresql15 15.4-1.1 openSUSE-SU-2024:13134-1
openSUSE Leap 15.5 postgresql12 12.16-150200.8.47.1 SUSE-SU-2023:3384-1
openSUSE Leap 15.5 postgresql13 13.12-150200.5.43.1 SUSE-SU-2023:3344-1
openSUSE Leap 15.5 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
openSUSE Leap 15.5 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
openSUSE Leap 15.4 postgresql12 12.16-150200.8.47.1 SUSE-SU-2023:3384-1
openSUSE Leap 15.4 postgresql13 13.12-150200.5.43.1 SUSE-SU-2023:3344-1
openSUSE Leap 15.4 postgresql14 14.9-150200.5.29.1 SUSE-SU-2023:3348-1
openSUSE Leap 15.4 postgresql15 15.4-150200.5.12.1 SUSE-SU-2023:3347-1
ReleasePackageFixed inAdvisory
Alpine v3.22 postgresql15 15.4-r0 —
Alpine v3.21 postgresql15 15.4-r0 —
Alpine v3.20 postgresql14 14.9-r0 —
Alpine v3.20 postgresql15 15.4-r0 —
Alpine v3.19 postgresql13 13.12-r0 —
Alpine v3.19 postgresql14 14.9-r0 —
Alpine v3.19 postgresql15 15.4-r0 —
Alpine v3.18 postgresql12 12.16-r0 —
Alpine v3.18 postgresql13 13.12-r0 —
Alpine v3.18 postgresql14 14.9-r0 —
Alpine v3.18 postgresql15 15.4-r0 —
Show 5 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.17 postgresql12 12.16-r0 —
Alpine v3.17 postgresql13 13.12-r0 —
Alpine v3.17 postgresql14 14.9-r0 —
Alpine v3.17 postgresql15 15.4-r0 —
Alpine v3.16 postgresql12 12.16-r0 —
Alpine v3.16 postgresql13 13.12-r0 —
Alpine v3.16 postgresql14 14.9-r0 —
Alpine v3.15 postgresql12 12.16-r0 —
Alpine v3.15 postgresql13 13.12-r0 —
Alpine v3.15 postgresql14 14.9-r0 —
Alpine v3.14 postgresql 13.12-r0 —
Alpine v3.13 postgresql 13.12-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 postgresql15 +15 15.0-1.amzn2023.0.4 ALAS2023-2023-322

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) postgresql 14.10-1 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 pg_repack 1.4.8-1.module+el9.2.0+21134+ceb95ed9 ELSA-2023-7785
Oracle Linux 9 pgaudit 1.7.0-1.module+el9.2.0+21134+ceb95ed9 ELSA-2023-7785
Oracle Linux 9 postgres-decoderbufs 1.9.7-1.Final.module+el9.2.0+21134+ceb95ed9 ELSA-2023-7785
Oracle Linux 9 postgresql +13 13.13-1.0.1.el9_3 ELSA-2023-7785, ELSA-2023-7784
Oracle Linux 9 postgresql-test-rpm-macros 15.5-1.module+el9.3.0+90103+1d024772 ELSA-2023-7785
Oracle Linux 8 pg_repack 1.4.6-3.module+el8.9.0+90098+1560b6c2 ELSA-2023-7884, ELSA-2023-7714, ELSA-2023-7581
Oracle Linux 8 pgaudit 1.4.0-5.module+el8.9.0+90107+c48bae1a ELSA-2023-7884, ELSA-2023-7714, ELSA-2023-7581
Oracle Linux 8 postgres-decoderbufs 0.10.0-2.module+el8.9.0+90098+1560b6c2 ELSA-2023-7884, ELSA-2023-7714, ELSA-2023-7581
Oracle Linux 8 postgresql +12 12.17-1.0.1.module+el8.9.0+90107+c48bae1a ELSA-2023-7884, ELSA-2023-7714, ELSA-2023-7581
Oracle Linux 8 postgresql-private-libs +1 15.5-1.module+el8.9.0+90110+d8a562d5 ELSA-2023-7884

Advisories 50

References