CVE-2023-5002 Pgadmin4: remote code execution by an authenticated user

Medium 6.0 Published Updated

An authenticated user can execute arbitrary commands on the server via improper validation of PostgreSQL utility paths in pgAdmin.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-5002?

CVE-2023-5002 is a medium-severity command injection vulnerability in Fedoraproject Fedora, published on 22 Sep 2023. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

A flaw was found in pgAdmin. This issue occurs when the pgAdmin server HTTP API validates the path a user selects to external PostgreSQL utilities such as pg_dump and pg_restore. Versions of pgAdmin prior to 7.6 failed to properly control the server code executed on this API, allowing an authenticated user to run arbitrary commands on the server.

Weakness: CWE-78

Which versions are affected by CVE-2023-5002?

3 open source packages ship an affected version, including pgadmin4. It affects 2 products.

PackageAffectedFixed in
pgadmin4 PyPIAll versions7.7
pgadmin4 PyPIAll versions7.7
pgadmin4 PyPIAll versions7.7
Linux distribution packages (1)
pgadmin4 openSUSE:TumbleweedAll versions7.8-1.1

Products include Fedoraproject Fedora, Pgadmin Pgadmin 4.

How do I fix CVE-2023-5002?

Upgrade pgadmin4 to 7.7 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2023-5002 being exploited?

There is no known exploitation of CVE-2023-5002 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as GHSA-ghp8-52vx-77j4, PYSEC-2026-1774, openSUSE-SU-2024:13379-1.

Is CVE-2023-5002 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free