Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-36070
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 18:07 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 7 Sept 2022, 18:30 UTC

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.

osv:CVE-2022-36070
Complete source record
{
  "id": "46df9cbdc8f557e7565e06086a81b38d3592604e5a3e38df0e752de5678c500e",
  "url": "https://osv.dev/vulnerability/CVE-2022-36070",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Poetry's Untrusted Search Path can lead to Local Code Execution on Windows",
    "summary": "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.",
    "evidence": "osv:CVE-2022-36070",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2022-36070",
      "aliases": [
        "CVE-2022-36070",
        "GHSA-j4j9-7hg9-97g6",
        "PYSEC-2022-43179"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/python-poetry/poetry",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "69bd6820e320f84900103fdf867e24b355d6aa5d"
                },
                {
                  "fixed": "dca6ff2699a06c0217ed6d5a278fa3146e4136ff"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:python-poetry:poetry:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.1.9"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "69bd6820e320f84900103fdf867e24b355d6aa5d"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "1.1.9"
                  },
                  {
                    "range": [
                      {
                        "fixed": "dca6ff2699a06c0217ed6d5a278fa3146e4136ff"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "1.2.0b1"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.1.2",
            "1.0.5",
            "1.0.4",
            "1.0.3",
            "1.0.2",
            "1.0.1",
            "1.0.0",
            "1.0.0b9",
            "1.0.0b8",
            "1.0.0b7",
            "1.0.0b6",
            "1.0.0b5",
            "1.0.0b4",
            "1.0.0b3",
            "1.0.0b2",
            "1.0.0b1",
            "1.0.0a5",
            "1.0.0a4",
            "1.0.0a3",
            "1.0.0a2",
            "1.0.0a1",
            "1.0.0a0",
            "0.12.4",
            "0.12.3",
            "0.12.2",
            "0.12.1",
            "0.12.0",
            "0.12.0a5",
            "0.12.0a4",
            "0.12.0a3",
            "0.12.0a2",
            "0.12.0a1",
            "0.12.0a0",
            "0.10.3",
            "0.10.2",
            "0.10.1",
            "0.10.0",
            "0.9.1",
            "0.9.0",
            "0.8.3",
            "0.8.2",
            "0.8.1",
            "0.8.0",
            "0.7.1",
            "0.7.0",
            "0.6.5",
            "0.6.4",
            "0.6.3",
            "0.6.2",
            "0.6.1",
            "0.6.0",
            "0.5.0",
            "0.4.2",
            "0.4.1",
            "0.4.0",
            "0.3.0",
            "0.2.0",
            "0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-36070.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:38.446186424Z",
      "provider": "osv",
      "references": [
        "https://github.com/python-poetry/poetry/releases/tag/1.1.9",
        "https://github.com/python-poetry/poetry/releases/tag/1.2.0b1",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/36xxx/CVE-2022-36070.json",
        "https://github.com/python-poetry/poetry/security/advisories/GHSA-j4j9-7hg9-97g6",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-36070"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-426"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/36xxx/CVE-2022-36070.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-36070",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 505582,
  "published_at": "2022-09-07T18:30:14+00:00"
}