{"answers":{"affected":"3 open source packages ship an affected version, including pyinstaller. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-49797 in the wild and no public exploit code.","fix":"Upgrade pyinstaller to 5.13.1 or later.","what":"CVE-2023-49797 is a high-severity vulnerability in pyinstaller, published on 9 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-49797 and fix it if it is affected.\n\nWhat it is: CVE-2023-49797 is a high-severity vulnerability in pyinstaller, published on 9 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-49797 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pyinstaller (PyPI): affected all versions; fixed in 5.13.1\n- pyinstaller (PyPI): affected all versions; fixed in 5.13.1\n- pyinstaller (PyPI): affected all versions; fixed in 5.13.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-49797/ (Markdown: https://insights.sbomify.com/CVE-2023-49797/index.md)","id":"CVE-2023-49797","markdown":"https://insights.sbomify.com/CVE-2023-49797/index.md","name":"CVE-2023-49797","record":{"aliases":["GHSA-9w2p-rh8c-v9g5","OESA-2024-1742","PYSEC-2023-292"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["privilege_escalation","data_modify"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Python packaging tool","requires_auth":"low_privilege","summary":"An unprivileged attacker can delete protected files via a race condition in PyInstaller-built apps running as admin with insecure temp directories.","user_interaction":"not_required","vuln_class":"race_condition"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"pyinstaller","vendor":"pyinstaller"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-732","name":"Incorrect Permission Assignment for Critical Resource"},{"id":"CWE-379","name":"Creation of Temporary File in Directory with Insecure Permissions"}],"description":"PyInstaller bundles a Python application and all its dependencies into a single package. A PyInstaller built application, elevated as a privileged process, may be tricked by an unprivileged attacker into deleting files the unprivileged user does not otherwise have access to. A user is affected if **all** the following are satisfied: 1. The user runs an application containing either `matplotlib` or `win32com`. 2. The application is ran as administrator (or at least a user with higher privileges than the attacker). 3. The user's temporary directory is not locked to that specific user (most likely due to `TMP`/`TEMP` environment variables pointing to an unprotected, arbitrary, non default location). Either: A. The attacker is able to very carefully time the replacement of a temporary file with a symlink. This switch must occur exactly between `shutil.rmtree()`'s builtin symlink check and the deletion itself B: The application was built with Python 3.7.x or earlier which has no protection against Directory Junctions links. The vulnerability has been addressed in PR #7827 which corresponds to `pyinstaller \u003e= 5.13.1`. Users are advised to upgrade. There are no known workarounds for this vulnerability.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Local Privilege Escalation in pyinstaller on Windows","id":"CVE-2023-49797","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"race_condition","year":"2023"},"n_packages":3,"n_references":5,"next":{"headline":"Duplicated execution of subcalls in OpenZeppelin Contracts","id":"CVE-2023-49798"},"packages":[{"ecosystem":"PyPI","fixed":["5.13.1"],"introduced":["0"],"last_affected":[],"package":"pyinstaller","purl":null,"source":"GHSA-9w2p-rh8c-v9g5"},{"ecosystem":"PyPI","fixed":["5.13.1"],"introduced":["0"],"last_affected":[],"package":"pyinstaller","purl":"pkg:pypi/pyinstaller","source":"GHSA-9w2p-rh8c-v9g5"},{"ecosystem":"PyPI","fixed":["5.13.1"],"introduced":["0"],"last_affected":[],"package":"pyinstaller","purl":"pkg:pypi/pyinstaller","source":"PYSEC-2023-292"}],"prev":{"headline":"MindsDB Arbitrary File Write vulnerability","id":"CVE-2023-49796"},"products":["pyinstaller"],"published":"2023-12-09","related":[{"cvss_score":7,"headline":"Local Privilege Escalation present only on the Windows version of PyInstaller","id":"CVE-2019-16784","kev_date_added":null,"published":"2020-01-14"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2025-02-13","vendors":["pyinstaller"]},"summary":"An unprivileged attacker can delete protected files via a race condition in PyInstaller-built apps running as admin with insecure temp directories.","url":"https://insights.sbomify.com/CVE-2023-49797/"}