CVE-2023-5002: Pgadmin4: remote code execution by an authenticated user
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 pgdump and pgrestore. 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.
Other sources
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 pgdump and pgrestore. Versions of pgAdmin prior to 7.7 failed to properly control the server code executed on this API, allowing an authenticated user to run arbitrary commands on the server.
— GitHub
The pgAdmin server includes an HTTP API that is intended to be used to validate the path a user selects to external PostgreSQL utilities such as pgdump and pgrestore. The utility is executed by the server to determine what PostgreSQL version it is from.
Versions of pgAdmin prior to 7.7 failed to properly control the server code executed on this API, which could allow an authenticated user to run arbitrary commands on the server. Users can use the commands as filenames and check for validating the path using the API. This would inject the command in the path validator and execute the command on the pgAdmin server.
This issue does not affect users running pgAdmin in desktop mode.
Reference: https://github.com/pgadmin-org/pgadmin4/issues/6763
— Red Hat
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the vulnerability ID for this flaw?
The vulnerability ID for this flaw is CVE-2023-5002.
What is the severity level of CVE-2023-5002?
CVE-2023-5002 has a severity level of high.
Which versions of pgAdmin are affected by this vulnerability?
Versions of pgAdmin prior to 7.7 are affected by this vulnerability.
What is the risk associated with this vulnerability?
The risk associated with CVE-2023-5002 is rated at 8.8 (high).
Are there any references or additional resources related to this vulnerability?
Yes, you can find more information about CVE-2023-5002 in the following references: [NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-5002), [GitHub Issue](https://github.com/pgadmin-org/pgadmin4/issues/6763), [Red Hat Bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=2239164)