CVE-2022-4223: Pgadmin4 Pgadmin4 Vulnerable To Code Injection Vulnerability

HIGH
Advisory Identifier: GHSA-3v6v-2x6p-32mc
CVSS 8.8
CWE-94 CWE-862
Published
Advisory Summary

CVE-2022-4223 is a HIGH (CVSS 8.8) pgadmin4 vulnerable to code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Pgadmin4 libraries in the PyPI ecosystem. The issue involves pgadmin4 vulnerable to code injection. Remediation is available by upgrading affected packages to version 6.17.

CVE-2022-4223 at a Glance

CVE Identifier CVE-2022-4223
GHSA Identifier GHSA-3v6v-2x6p-32mc
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Pgadmin4
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-4223

To remediate this vulnerability, upgrade all affected Pgadmin4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pgadmin4 fixed: 6.17
pip install pgadmin4>=6.17
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pgadmin4

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-4223, inspect your installed packages using pip:

pip show pgadmin4

Analyze the terminal output to locate any version of Pgadmin4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.17), your application is affected.

Note: The pip show pgadmin4 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Pgadmin4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 pg_dump and pg_restore. The utility is executed by the server to determine what PostgreSQL version it is from. Versions of pgAdmin prior to 6.17 failed to properly secure this API, which could allow an unauthenticated user to call it with a path of their choosing, such as a UNC path to a server they control on a Windows machine. This would cause an appropriately named executable in the target path to be executed by the pgAdmin server.

CVE-2022-4223 Affected Pgadmin4 Versions

1 component(s)
Fixed Versions:
6.17
Product / Package Ecosystem Affected Versions Fixed Version
pgadmin4
PyPI
< 6.17
6.17

References

Frequently Asked Questions

What is CVE-2022-4223?
CVE-2022-4223 is a security vulnerability in Pgadmin4 involving pgadmin4 vulnerable to Code Injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Pgadmin4 versions are affected?
Affected versions include releases prior to 6.17 across affected packages: pgadmin4.
What version fixes CVE-2022-4223?
Upgrading to 6.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pgadmin4 affected?
Yes, pgadmin4 is affected in releases prior to 6.17. Upgrade your dependency to 6.17 or later.
What is the CVSS score of CVE-2022-4223?
CVE-2022-4223 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-4223?
CVE-2022-4223 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2022-4223?
Run the dependency tree command: 'pip show pgadmin4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3v6v-2x6p-32mc",
  "modified" : "2025-03-17T21:33:57Z",
  "published" : "2022-12-13T18:30:34Z",
  "aliases" : [ "CVE-2022-4223" ],
  "summary" : "pgadmin4 vulnerable to Code Injection",
  "details" : "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 pg_dump and pg_restore. The utility is executed by the server to determine what PostgreSQL version it is from. Versions of pgAdmin prior to 6.17 failed to properly secure this API, which could allow an unauthenticated user to call it with a path of their choosing, such as a UNC path to a server they control on a Windows machine. This would cause an appropriately named executable in the target path to be executed by the pgAdmin server.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pgadmin4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.17"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4223"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgadmin-org/pgadmin4/issues/5593"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pgadmin-org/pgadmin4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R5EYTPKHVFSDCETBJI7LBZE4EYHBPN2Q"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/R5EYTPKHVFSDCETBJI7LBZE4EYHBPN2Q"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-19T21:09:48Z",
    "nvd_published_at" : "2022-12-13T16:15:00Z"
  }
}