Poetry's Untrusted Search Path can lead to Local Code Execution on Windows Fix available

CVE-2022-36070

Assigned byThe organization (CNA) that assigned this CVE ID and published the record, usually the vendor.
GitHub, Inc. (opens in new tab)
Published
Last modified
NVD status
Modified
CVSS 3.17.3High

Description

Poetry is a dependency manager for Python. To handle dependencies that come from a Git repository, Poetry executes various commands, e.g. git config. These commands are being executed using the executable’s name and not its absolute path. This can lead to the execution of untrusted code due to the way Windows resolves executable names to paths. Unlike Linux-based operating systems, Windows searches for the executable in the current directory first and looks in the paths that are defined in the PATH environment variable afterward. This vulnerability can lead to Arbitrary Code Execution, which would lead to the takeover of the system. If a developer is exploited, the attacker could steal credentials or persist their access. If the exploit happens on a server, the attackers could use their access to attack other internal systems. Since this vulnerability requires a fair amount of user interaction, it is not as dangerous as a remotely exploitable one. However, it still puts developers at risk when dealing with untrusted files in a way they think is safe. The victim could also not protect themself by vetting any Git or Poetry config files that might be present in the directory, because the behavior is undocumented. Versions 1.1.9 and 1.2.0b1 contain patches for this issue.

Exploitation

Whether attackers are exploiting this vulnerability, and how likely they are to try in the next 30 days.

CISA SSVC assessmentAbout SSVC (opens in new tab)

CISA's assessment of whether it's exploited, whether attacks can be automated and how much control an attacker gains.

ExploitationWhether CISA has seen exploit code or attacks for this vulnerability.
None known
AutomatableWhether attackers can exploit it at scale without manual steps.
No
Technical impactHow much control of the affected system an attacker gains.
Full control
Assessed

FIRST Exploit Prediction Scoring System (EPSS)About EPSS (opens in new tab)

FIRST's estimate of the chance attackers try to exploit this vulnerability in the next 30 days.

Probability of exploitationIt predicts attempts, not success, and is updated daily.
0.362%
Compared with other CVEs
At or above 30.596% of scored CVEs
Scored

Affected products

The products and versions with the vulnerability.

Listed by CNA

The products and versions affected, according to the organization that published this CVE.

VendorProductAffected versions
python-poetrypoetry
  • < 1.1.9

Severity

How serious the vulnerability is if exploited, scored from 0 to 10 with the CVSS standard (opens in new tab).

  • 7.3 HighCVSS 3.1 · PrimaryPrimary scores are NVD's own. Secondary scores come from the organization that published the CVE, or from CISA. · Scored by NVD (opens in new tab)
    Attack vectorWhere the attacker has to be. Network is the widest: anywhere on the Internet.
    Local
    Attack complexityWhether the attack depends on conditions the attacker doesn't control.
    Low
    Privileges requiredThe access the attacker needs before attacking.
    Low
    User interactionWhether someone other than the attacker has to do something, like open a link.
    Required
    ScopeWhether the attack can reach beyond the vulnerable component.
    Unchanged
    ConfidentialityHow much data the attacker can read.
    High
    IntegrityHow much data the attacker can change.
    High
    AvailabilityHow much the attacker can disrupt the system or service.
    High

    CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HView in FIRST's calculator (opens in new tab)

  • 7.3 HighCVSS 3.1 · SecondaryPrimary scores are NVD's own. Secondary scores come from the organization that published the CVE, or from CISA. · Scored by GitHub, Inc. (opens in new tab)
    Attack vectorWhere the attacker has to be. Network is the widest: anywhere on the Internet.
    Local
    Attack complexityWhether the attack depends on conditions the attacker doesn't control.
    Low
    Privileges requiredThe access the attacker needs before attacking.
    Low
    User interactionWhether someone other than the attacker has to do something, like open a link.
    Required
    ScopeWhether the attack can reach beyond the vulnerable component.
    Unchanged
    ConfidentialityHow much data the attacker can read.
    High
    IntegrityHow much data the attacker can change.
    High
    AvailabilityHow much the attacker can disrupt the system or service.
    High

    CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HView in FIRST's calculator (opens in new tab)

Weaknesses and attack patterns

The type of bug behind the vulnerability, and how attackers exploit that type.

  • Untrusted Search Path · CWE-426 (opens in new tab)

    The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.

    Likelihood of exploitHow likely MITRE rates attacks on this type of weakness, in general rather than for this vulnerability.
    High
    Abstraction
    Base
    Mapping guidance
    Allowed with review

References

Advisories, patches, exploits and more about this vulnerability.

This product uses the NVD API but is not endorsed or certified by the NVD (opens in new tab). CVE records from the CVE List (opens in new tab), weakness types from MITRE's CWE (opens in new tab)™ and attack patterns from its CAPEC (opens in new tab)™ are © The MITRE Corporation, used under the CVE (opens in new tab), CWE (opens in new tab) and CAPEC (opens in new tab) terms of use. Known exploited vulnerabilities and SSVC assessments are from CISA. Exploit predictions are from FIRST's EPSS (opens in new tab). About this data