{"answers":{"affected":"3 open source packages ship an affected version, including esphome. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-27081 exists.","fix":"Upgrade esphome to 2024.2.1 or later.","what":"CVE-2024-27081 is a high-severity path traversal vulnerability in esphome, published on 26 Feb 2024. An attacker needs administrator access to exploit it, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-27081 and fix it if it is affected.\n\nWhat it is: CVE-2024-27081 is a high-severity path traversal vulnerability in esphome, published on 26 Feb 2024. An attacker needs administrator access to exploit it, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-27081 exists.\n\nAffected packages and fixed versions:\n- esphome (PyPI): affected from 2023.12.9; fixed in 2024.2.1\n- esphome (PyPI): affected from 2023.12.9; fixed in 2024.2.1\n- esphome (PyPI): affected from 2023.12.9; fixed in 2024.2.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-2024-27081/ (Markdown: https://insights.sbomify.com/CVE-2024-27081/index.md)","id":"CVE-2024-27081","markdown":"https://insights.sbomify.com/CVE-2024-27081/index.md","name":"CVE-2024-27081","record":{"aliases":["GHSA-8p25-3q46-8q2p","PYSEC-2026-1328"],"analysis":{"component_type":"iot_embedded","fix_type":"upgrade","impacts":["code_execution","data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"ESPHome IoT framework","requires_auth":"high_privilege","summary":"Authenticated attackers can read and write arbitrary files via path traversal in the dashboard API, leading to remote code execution on ESPHome devices.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"esphome","vendor":"esphome"}],"cvss":{"score":7.2,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"ESPHome is a system to control your ESP8266/ESP32. A security misconfiguration in the edit configuration file API in the dashboard component of ESPHome version 2023.12.9 (command line installation) allows authenticated remote attackers to read and write arbitrary files under the configuration directory rendering remote code execution possible.  This vulnerability is patched in 2024.2.1.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"ESPHome remote code execution via arbitrary file write","id":"CVE-2024-27081","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2024"},"n_packages":3,"n_references":2,"next":{"headline":"Cacti Cross-site Scripting vulnerability when managing trees","id":"CVE-2024-27082"},"packages":[{"ecosystem":"PyPI","fixed":["2024.2.1"],"introduced":["2023.12.9"],"last_affected":[],"package":"esphome","purl":null,"source":"GHSA-8p25-3q46-8q2p"},{"ecosystem":"PyPI","fixed":["2024.2.1"],"introduced":["2023.12.9"],"last_affected":[],"package":"esphome","purl":"pkg:pypi/esphome","source":"GHSA-8p25-3q46-8q2p"},{"ecosystem":"PyPI","fixed":["2024.2.1"],"introduced":["2023.12.9"],"last_affected":[],"package":"esphome","purl":"pkg:pypi/esphome","source":"PYSEC-2026-1328"}],"prev":{"headline":"btrfs: fix race when detecting delalloc ranges during fiemap","id":"CVE-2024-27080"},"products":["esphome"],"published":"2024-02-26","related":[{"cvss_score":6.5,"headline":"ESPHome vulnerable to stored Cross-site Scripting in edit configuration file API","id":"CVE-2024-27287","kev_date_added":null,"published":"2024-03-06"},{"cvss_score":1.7,"headline":"ESPHome vulnerable to denial-of-service via out-of-bounds check bypass in the API component","id":"CVE-2026-23833","kev_date_added":null,"published":"2026-01-19"}],"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":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-08-27","vendors":["esphome"]},"summary":"Authenticated attackers can read and write arbitrary files via path traversal in the dashboard API, leading to remote code execution on ESPHome devices.","url":"https://insights.sbomify.com/CVE-2024-27081/"}