{"answers":{"affected":"7 open source packages ship an affected version, including sanic. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-35920 exists.","fix":"Upgrade sanic to a fixed version for your release line: 20.12.7, 22.6.1 or 21.12.2.","what":"CVE-2022-35920 is a high-severity path traversal vulnerability in sanic-org sanic, published on 1 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-35920 and fix it if it is affected.\n\nWhat it is: CVE-2022-35920 is a high-severity path traversal vulnerability in sanic-org sanic, published on 1 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-35920 exists.\n\nAffected packages and fixed versions:\n- sanic (PyPI): affected all versions; fixed in 20.12.7, 22.6.1, 21.12.2\n- sanic (PyPI): affected all versions; fixed in 20.12.7\n- sanic (PyPI): affected all versions; fixed in 20.12.7\n- sanic (PyPI): affected from 21.0.0; fixed in 21.12.2\n- sanic (PyPI): affected from 21.0.0; fixed in 21.12.2\n- sanic (PyPI): affected from 22.0.0; fixed in 22.6.1\n- sanic (PyPI): affected from 22.0.0; fixed in 22.6.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-2022-35920/ (Markdown: https://insights.sbomify.com/CVE-2022-35920/index.md)","id":"CVE-2022-35920","markdown":"https://insights.sbomify.com/CVE-2022-35920/index.md","name":"CVE-2022-35920","record":{"aliases":["GHSA-8cw9-5hmv-77w6","PYSEC-2026-918"],"analysis":{"component_type":"web_application","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Python web framework","requires_auth":"none","summary":"Attackers can access lateral directories via encoded URLs in Sanic's static file serving, potentially exposing sensitive files.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"sanic","vendor":"sanic_project"}],"cvss":{"score":8.3,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"Sanic is an opensource python web server/framework. Affected versions of sanic allow access to lateral directories when using `app.static` if using encoded `%2F` URLs. Parent directory traversal is not impacted. Users are advised to upgrade. There is no known workaround for this issue.","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":"Improper Limitation of a Pathname to a Restricted Directory in sanic","id":"CVE-2022-35920","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2022"},"n_packages":7,"n_references":3,"next":{"headline":"User preference to prevent private discussions not respected in fof/byobu","id":"CVE-2022-35921"},"packages":[{"ecosystem":"PyPI","fixed":["20.12.7","22.6.1","21.12.2"],"introduced":["0","22.0.0","21.0.0"],"last_affected":[],"package":"sanic","purl":"pkg:pypi/sanic","source":"PYSEC-2026-918"},{"ecosystem":"PyPI","fixed":["20.12.7"],"introduced":["0"],"last_affected":[],"package":"sanic","purl":null,"source":"GHSA-8cw9-5hmv-77w6"},{"ecosystem":"PyPI","fixed":["20.12.7"],"introduced":["0"],"last_affected":[],"package":"sanic","purl":"pkg:pypi/sanic","source":"GHSA-8cw9-5hmv-77w6"},{"ecosystem":"PyPI","fixed":["21.12.2"],"introduced":["21.0.0"],"last_affected":[],"package":"sanic","purl":null,"source":"GHSA-8cw9-5hmv-77w6"},{"ecosystem":"PyPI","fixed":["21.12.2"],"introduced":["21.0.0"],"last_affected":[],"package":"sanic","purl":"pkg:pypi/sanic","source":"GHSA-8cw9-5hmv-77w6"},{"ecosystem":"PyPI","fixed":["22.6.1"],"introduced":["22.0.0"],"last_affected":[],"package":"sanic","purl":null,"source":"GHSA-8cw9-5hmv-77w6"},{"ecosystem":"PyPI","fixed":["22.6.1"],"introduced":["22.0.0"],"last_affected":[],"package":"sanic","purl":"pkg:pypi/sanic","source":"GHSA-8cw9-5hmv-77w6"}],"prev":{"headline":"Authenticated requests for server update admin API allows path traversal in minio","id":"CVE-2022-35919"},"products":["sanic"],"published":"2022-08-01","related":[{"cvss_score":7.5,"headline":"Sanic arbitrary file read and directory traversal","id":"CVE-2017-16762","kev_date_added":null,"published":"2017-11-10"}],"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":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["sanic-org"]},"summary":"Attackers can access lateral directories via encoded URLs in Sanic's static file serving, potentially exposing sensitive files.","url":"https://insights.sbomify.com/CVE-2022-35920/"}