DescriptionA flaw was found in the psql interactive terminal of PostgreSQL in versions before 13.1, before 12.5, before 11.10, before 10.15, before 9.6.20 and before 9.5.24. If an interactive psql session uses \gset when querying a compromised server, the attacker can execute arbitrary code as the operating system account running psql. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, bugtraq, EDB, Metasploit, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, Mageia, GitHub code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
postgresql-11 (PTS)buster11.9-0+deb10u1vulnerable
buster (security)11.7-0+deb10u1vulnerable
postgresql-12 (PTS)sid12.4-3vulnerable
postgresql-13 (PTS)bullseye, sid13.1-1fixed
postgresql-9.6 (PTS)stretch9.6.17-0+deb9u1vulnerable
stretch (security)9.6.19-0+deb9u1vulnerable

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs


[buster] - postgresql-11 <no-dsa> (Minor issue)
[stretch] - postgresql-9.6 <no-dsa> (Minor issue)

Search for package or bug name: Reporting problems