Cloudanix VulnDB

CVE-2024-10979

None

CVSS

—

EPSS

4.4%

Published

Nov 14, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A regular database user could change important system settings and make the server run harmful programs without needing special operating-system access.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Remote Code Execution
Component
Application
Class
Command Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Incorrect control of environment variables in PostgreSQL PL/Perl allows an unprivileged database user to change sensitive process environment variables (e.g. PATH). That often suffices to enable arbitrary code execution, even if the attacker lacks a database server operating system user.

Why it matters to the business

Attackers with only database access could execute arbitrary code on the server, risking data exposure or full system compromise. Prevalence across PostgreSQL deployments increases potential blast radius; no active ransomware or KEV usage observed but upgrade windows should be treated as priority.

How an attack unfolds

An attacker obtains an unprivileged database account, defines or invokes a PL/Perl function that overwrites variables such as PATH, and then causes the server to execute an external command or script whose resolution now points to attacker-controlled binaries.

How to fix it

Upgrade PostgreSQL to 17.1, 16.5, 15.9, 14.14, 13.17, or 12.21 (or newer). The fix is present in commit 20a82026828536331ebe912b86f060078a173633. Where immediate patching is not feasible, disable PL/Perl or restrict its use to trusted roles only.

How to confirm the fix worked

Confirm running PostgreSQL version matches or exceeds a listed fixed release. Attempt to set environment variables from within a PL/Perl function as an unprivileged user and verify the attempt is rejected or has no effect.

Typical attack path

  1. Obtain unprivileged database user credentials
  2. Create or call a PL/Perl stored procedure that modifies environment variables
  3. Trigger a command execution path that resolves through the altered variable (commonly PATH)
  4. Execute arbitrary operating-system code without OS-level credentials

How to detect it

Review PostgreSQL logs for creation or execution of PL/Perl functions containing calls that alter environment variables; correlate with unexpected child processes spawned by the postgres user that reference non-standard binary paths.

What your security team should do

  • Apply the listed PostgreSQL patches across all instances without delay
  • Audit and minimize use of PL/Perl language handlers
  • Harden database roles so only trusted users can create functions in untrusted languages
  • Include PostgreSQL version checks in routine vulnerability scanning

The record

Incorrect control of environment variables in PostgreSQL PL/Perl allows an unprivileged database user to change sensitive process environment variables (e.g. PATH). That often suffices to enable arbitrary code execution, even if the attacker lacks a database server operating system user. Versions before PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21 are affected.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pg_repack 0 1.4.6-3.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 pg_repack 0 1.4.8-1.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 pg_repack 0 1.4.8-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pg_repack 0 1.5.1-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.10.0+3889+48cb11fb.alma.1
AlmaLinux:8 pgaudit 0 1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1
AlmaLinux:8 pgaudit 0 1.7.0-1.module_el8.9.0+3706+885c732e
AlmaLinux:8 pgaudit 0 16.0-1.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+2760+1746ec94
AlmaLinux:8 pgaudit 0 1.5.0-1.module_el8.6.0+3095+ee60d910
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+2760+1746ec94
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.6.0+3095+ee60d910
AlmaLinux:8 postgres-decoderbufs 0 0.10.0-2.module_el8.9.0+3704+f1f917ce
AlmaLinux:8 postgres-decoderbufs 0 1.9.7-1.Final.module_el8.9.0+3706+885c732e
AlmaLinux:8 postgres-decoderbufs 0 2.4.0-1.Final.module_el8.10.0+3798+606ebb9f
AlmaLinux:8 postgresql 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-contrib 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-contrib 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-contrib 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-contrib 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-docs 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-docs 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-docs 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-docs 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-plperl 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-plperl 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-plperl 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-plperl 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-plpython3 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-plpython3 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-plpython3 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-plpython3 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-pltcl 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-pltcl 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-pltcl 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-pltcl 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-private-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-private-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-private-libs 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-private-libs 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-server 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-server 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-server-devel 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-server-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-server-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-server-devel 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-static 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-static 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-static 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-static 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-test 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-test 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-test 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-test 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-test-rpm-macros 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-test-rpm-macros 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-test-rpm-macros 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-test-rpm-macros 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-upgrade 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-upgrade 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-upgrade 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-upgrade 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:8 postgresql-upgrade-devel 0 12.22-1.module_el8.10.0+3927+7f0fab70
AlmaLinux:8 postgresql-upgrade-devel 0 15.10-1.module_el8.10.0+3929+38258aa5
AlmaLinux:8 postgresql-upgrade-devel 0 16.6-1.module_el8.10.0+3930+ecf33554
AlmaLinux:8 postgresql-upgrade-devel 0 13.18-1.module_el8.10.0+3928+8233d274
AlmaLinux:9 pg_repack 0 1.4.8-2.module_el9.5.0+120+4533eb20
AlmaLinux:9 pg_repack 0 1.5.1-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 pg_repack 0 1.5.1-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 pgaudit 0 1.7.0-1.module_el9.3.0+52+21733919
AlmaLinux:9 pgaudit 0 16.0-1.module_el9.4.0+66+eb9878bc
AlmaLinux:9 pgvector 0 0.6.2-1.module_el9.5.0+120+4533eb20
AlmaLinux:9 postgres-decoderbufs 0 1.9.7-1.Final.module_el9.3.0+52+21733919
AlmaLinux:9 postgres-decoderbufs 0 2.4.0-1.Final.module_el9.4.0+66+eb9878bc
AlmaLinux:9 postgresql 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql 0 13.18-1.el9_5
AlmaLinux:9 postgresql-contrib 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-contrib 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-contrib 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-contrib 0 13.18-1.el9_5
AlmaLinux:9 postgresql-docs 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-docs 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-docs 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-docs 0 13.18-1.el9_5
AlmaLinux:9 postgresql-plperl 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-plperl 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-plperl 0 13.18-1.el9_5
AlmaLinux:9 postgresql-plpython3 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-plpython3 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-plpython3 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-plpython3 0 13.18-1.el9_5
AlmaLinux:9 postgresql-pltcl 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-pltcl 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-pltcl 0 13.18-1.el9_5
AlmaLinux:9 postgresql-private-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-private-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-private-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-private-devel 0 13.18-1.el9_5
AlmaLinux:9 postgresql-private-libs 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-private-libs 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-private-libs 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-private-libs 0 13.18-1.el9_5
AlmaLinux:9 postgresql-server 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-server 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-server 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-server 0 13.18-1.el9_5
AlmaLinux:9 postgresql-server-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-server-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-server-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-server-devel 0 13.18-1.el9_5
AlmaLinux:9 postgresql-static 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-static 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-static 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-static 0 13.18-1.el9_5
AlmaLinux:9 postgresql-test 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-test 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-test 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-test 0 13.18-1.el9_5
AlmaLinux:9 postgresql-test-rpm-macros 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-test-rpm-macros 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-test-rpm-macros 0 13.18-1.el9_5
AlmaLinux:9 postgresql-upgrade 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-upgrade 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-upgrade 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-upgrade 0 13.18-1.el9_5
AlmaLinux:9 postgresql-upgrade-devel 0 15.10-1.module_el9.5.0+126+03d48c9f
AlmaLinux:9 postgresql-upgrade-devel 0 16.6-1.module_el9.5.0+127+50ff03a9
AlmaLinux:9 postgresql-upgrade-devel 0 16.6-1.module_el9.5.0+128+1095dce2
AlmaLinux:9 postgresql-upgrade-devel 0 13.18-1.el9_5
Alpine:v3.17 postgresql14 0 14.14-r0
Alpine:v3.17 postgresql15 0 15.9-r0
Alpine:v3.18 postgresql14 0 14.14-r0
Alpine:v3.18 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql16 0 16.5-r0
Alpine:v3.20 postgresql15 0 15.9-r0
Alpine:v3.20 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql17 0 17.1-r0
Alpine:v3.22 postgresql16 0 16.5-r0
Alpine:v3.22 postgresql17 0 17.1-r0
Bitnami postgresql 0 13.17.0
Bitnami postgresql 17.0.0 17.1.0
Chainguard ecpg-13 0 13.17-r0
Chainguard ecpg-14 0 14.14-r0
Chainguard ecpg-15 0 15.9-r0
Chainguard ecpg-16 0 16.5-r0
Chainguard ecpg-17 0 17.1-r0
Chainguard libecpg-12 0 12.21-r0
Chainguard libecpg-13 0 13.17-r0
Chainguard libecpg-13-dev 0 13.17-r0
Chainguard libecpg-14 0 14.14-r0
Chainguard libecpg-14-dev 0 14.14-r0
Chainguard libecpg-15 0 15.9-r0
Chainguard libecpg-15-dev 0 15.9-r0
Chainguard libecpg-16 0 16.5-r0
Chainguard libecpg-16-dev 0 16.5-r0
Chainguard libecpg-17 0 17.1-r0
Chainguard libecpg-17-dev 0 17.1-r0
Chainguard libpq-12 0 12.21-r0
Chainguard libpq-13 0 13.17-r0
Chainguard libpq-14 0 14.14-r0
Chainguard libpq-15 0 15.9-r0
Chainguard libpq-16 0 16.5-r0
Chainguard libpq-17 0 17.1-r0
Chainguard postgresql-12 0 12.21-r0
Chainguard postgresql-12-base 0 12.21-r0
Chainguard postgresql-12-bitnami-compat 0 12.21-r0
Chainguard postgresql-12-client 0 12.21-r0
Chainguard postgresql-12-client-base 0 12.21-r0
Chainguard postgresql-12-contrib 0 12.21-r0
Chainguard postgresql-12-dev 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint-base 0 12.21-r0
Chainguard postgresql-12-pgadmin-compat 0 12.21-r0
Chainguard postgresql-13 0 13.17-r0
Chainguard postgresql-13-base 0 13.17-r0
Chainguard postgresql-13-bitnami-compat 0 13.17-r0
Chainguard postgresql-13-client 0 13.17-r0
Chainguard postgresql-13-client-base 0 13.17-r0
Chainguard postgresql-13-contrib 0 13.17-r0
Chainguard postgresql-13-dev 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint-base 0 13.17-r0
Chainguard postgresql-13-pgadmin-compat 0 13.17-r0
Chainguard postgresql-14 0 14.14-r0
Chainguard postgresql-14-base 0 14.14-r0
Chainguard postgresql-14-bitnami-compat 0 14.14-r0
Chainguard postgresql-14-client 0 14.14-r0
Chainguard postgresql-14-client-base 0 14.14-r0
Chainguard postgresql-14-contrib 0 14.14-r0
Chainguard postgresql-14-dev 0 14.14-r0

Related vulnerabilities