CVE-2022-42906: Powerline gitstatus Powerline Gitstatus Vulnerable To Arbitrary Vulnerability
HIGHCVE-2022-42906 is a HIGH (CVSS 7.8) powerline gitstatus vulnerable to arbitrary vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Powerline gitstatus libraries in the PyPI ecosystem. The issue involves powerline gitstatus vulnerable to arbitrary code execution. Remediation is available by upgrading affected packages to version 1.3.2.
CVE-2022-42906 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-42906
To remediate this vulnerability, upgrade all affected Powerline gitstatus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install powerline-gitstatus>=1.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show powerline-gitstatus
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-42906, inspect your installed packages using pip:
pip show powerline-gitstatus
Analyze the terminal output to locate any version of Powerline gitstatus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), your application is affected.
Note: The pip show powerline-gitstatus 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 Powerline gitstatus, 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
CVE-2022-42906 Affected Powerline gitstatus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
powerline-gitstatus
|
PyPI |
< 1.3.2
|
1.3.2
|
References
Frequently Asked Questions
What is CVE-2022-42906?
Which Powerline gitstatus versions are affected?
What version fixes CVE-2022-42906?
Is powerline-gitstatus affected?
What is the CVSS score of CVE-2022-42906?
What CWE is associated with CVE-2022-42906?
How can I check PyPI dependencies for CVE-2022-42906?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w67g-6gjv-c599",
"modified" : "2023-01-20T22:03:09Z",
"published" : "2022-10-13T12:00:26Z",
"aliases" : [ "CVE-2022-42906" ],
"summary" : "Powerline Gitstatus vulnerable to arbitrary code execution",
"details" : "powerline-gitstatus (aka Powerline Gitstatus) before 1.3.2 allows arbitrary code execution. git repositories can contain per-repository configuration that changes the behavior of git, including running arbitrary commands. When using powerline-gitstatus, changing to a directory automatically runs git commands in order to display information about the current repository in the prompt. If an attacker can convince a user to change their current directory to one controlled by the attacker, such as in a shared filesystem or extracted archive, powerline-gitstatus will run arbitrary commands under the attacker's control. NOTE: this is similar to CVE-2022-20001.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "powerline-gitstatus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-42906"
}, {
"type" : "WEB",
"url" : "https://github.com/jaspernbrouwer/powerline-gitstatus/issues/45"
}, {
"type" : "WEB",
"url" : "https://github.com/jaspernbrouwer/powerline-gitstatus/commit/fe8e963b3489e4cceaa2c1f26f2bcc2ef405364c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jaspernbrouwer/powerline-gitstatus"
}, {
"type" : "WEB",
"url" : "https://github.com/jaspernbrouwer/powerline-gitstatus/releases/tag/v1.3.2"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/01/msg00017.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-13T19:13:14Z",
"nvd_published_at" : "2022-10-13T03:15:00Z"
}
}