Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe Deserialization and Remote Code Execution by an Authenticated user in pgAdmin 4 (CVE-2024-2044) #7258

Closed
adityatoshniwal opened this issue Mar 4, 2024 · 2 comments

Comments

@adityatoshniwal
Copy link
Contributor

adityatoshniwal commented Mar 4, 2024

Reported by: Davide TheZero thezero@shielder.it along with attachment path_traversal_leads_to_unsafe_deserialization.md for reproducing.

Summary:
pgAdmin 4 uses a file-based session management approach. The session files are saved on disk as pickle objects. When a user performs a request, the value of the session cookie 'pga4_session' is used to retrieve the file, then its content is deserialised, and finally its signature verified.
The cookie value is split in 2 parts at the first '!' character. The first part is the session ID (sid), while the second is the session digest.
The vulnerability lies in versions of pgAdmin prior to 8.4 where a method loads session files by concatenating the sessions folder - located inside the pgAdmin 4 DATA_DIR - with the session ID. Precisely, the two values are concatenated using the ['os.path.join'] function. It does not set a trusted base-path which should not be escaped

This issue does not affect users running pgAdmin in desktop mode.

@kperuma3
Copy link

I’m using pgadmin4 v 7.3 and installed locally on my laptop to connect GCP (Google cloud platform) instances. Will this CVE-2024-2044 - pgAdmin (<=8.3) Path Traversal in Session Handling Leads to Unsafe Deserialization and Remote Code Execution (RCE) impact me?

@adityatoshniwal
Copy link
Contributor Author

I’m using pgadmin4 v 7.3 and installed locally on my laptop to connect GCP (Google cloud platform) instances. Will this CVE-2024-2044 - pgAdmin (<=8.3) Path Traversal in Session Handling Leads to Unsafe Deserialization and Remote Code Execution (RCE) impact me?

It is mentioned in the issue description - This issue does not affect users running pgAdmin in desktop mode.

zeme-wana pushed a commit to input-output-hk/nixpkgs that referenced this issue May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants