Bug 2063759 (CVE-2022-0959)

Summary: CVE-2022-0959 pgadmin: Unrestricted file upload in pgAdmin
Product: [Other] Security Response Reporter: Sandipan Roy <saroy>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: astra, devrim, extras-orphan, stuart
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pgadmin 6.7 Doc Type: If docs needed, set a value
Doc Text:
A malicious, but authorised and authenticated user can construct an HTTP request using their existing CSRF token and session cookie to manually upload files to any location that the operating system user account under which pgAdmin is running has permission to write.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-14 17:02:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2063761, 2063762, 2063763    
Bug Blocks: 2063861    

Description Sandipan Roy 2022-03-14 10:50:12 UTC
Vulnerable versions: All prior to v6.7.

When run in server mode, pgAdmin 4 allows users to store files on the
server under individual storage directories. Files such as SQL scripts may
be uploaded through the user interface. The URI to which upload requests
are made fails to validate the upload path to prevent path traversal
techniques being used to store files outside of the storage directory. A
malicious, but authorised and authenticated user can construct an HTTP
request using their existing CSRF token and session cookie to manually
upload files to any location that the operating system user account under
which pgAdmin is running has permission to write.

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

Comment 1 Sandipan Roy 2022-03-14 10:53:36 UTC
Created pgadmin3 tracking bugs for this issue:

Affects: epel-7 [bug 2063761]
Affects: fedora-34 [bug 2063762]
Affects: fedora-35 [bug 2063763]

Comment 3 David Kaufmann 2022-03-14 16:05:53 UTC
should this affect pgadmin3? it looks a lot like only the re-implementation pgadmin4 is affected - pgadmin3 doesn't seem to have a server mode, or to use http at all.

Comment 4 Product Security DevOps Team 2022-03-14 17:01:59 UTC
This CVE Bugzilla entry is for community support informational purposes only as it does not affect a package in a commercially supported Red Hat product. Refer to the dependent bugs for status of those individual community products.