highVulnerability

GHSA-c2m8-h5v5-343r

### Summary StaticFileHandler allows an unauthenticated attacker to read arbitrary files from the server's filesystem by requesting a path that resolves to a symbolic link placed inside the static root directory. Any application that serves user-uploadable content, or whose static directory is populated by a build/deploy pipeline that creates symlinks (e.g. npm link, webpack, Docker volume mounts, CDN sync tools), is affected. An attacker who can trigger the creation of a symlink pointing outside the static root—or exploit one that already exists—can retrieve sensitive files such as /etc/passwd, private keys, configuration files, or application secrets. ### Details The vulnerability is in tornado.web.StaticFileHandler, specifically in the interaction between two methods in [tornado/web.py](vscode-webview://1grdaaa6v64itrol06qu70pq3d1b9h9im5c3npvvc9snaprc1q9f/tornado/web.py): - [get_absolute_path](https://github.com/tornadoweb/tornado/blob/0ca3c5f8279d402b245718d16522bc18a8f5d958/tornado/web.py#L2932) uses `os.path.abspath()` to resolve the requested path: - [validate_absolute_path](https://github.com/tornadoweb/tornado/blob/0ca3c5f8279d402b245718d16522bc18a8f5d958/tornado/web.py#L2935) uses the same `os.path.abspath()` on the root, then performs a string prefix check: `os.path.abspath()` normalises . and .. segments but does not resolve symbolic links. As a result, a path like `/var/www/static/link` passes the `startswith("/var/www/static/")` check regardless of where `link` actually points. Immediately after, `os.path.exists()` and `os.path.isfile()` **do follow symlinks**, so the file they ultimately open is the symlink's target. The fix would be to replace os.path.abspath() with os.path.realpath() in both methods, so the resolved real path of the symlink target is validated against the root, not just its string representation inside the static directory. ### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerabilit

Properties

ghsa_id
GHSA-c2m8-h5v5-343r
severity
high
summary
Tornado: StaticFileHandler follows symlinks outside static root (path traversal)
last_source
GitHub Advisory Database
cve_id
GHSA-c2m8-h5v5-343r
signal_observed_at
2026-09-30T23:58:31+00:00
is_ghsa_only
true
retrieved_at
2026-09-30T23:58:31+00:00
ghsa_published
2026-09-30T23:48:55Z
source_url
https://github.com/advisories/GHSA-c2m8-h5v5-343r
ghsa_updated
2026-09-30T23:48:56Z

Related Entities (4)

VULNERABLE_TO (1)

←[Software]pip/tornado

AFFECTS (1)

→[Software]pip/tornado

HAS_WEAKNESS (1)

→[Weakness]Improper Link Resolution Before File Access ('Link Following')

REPORTED_BY (1)

→[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-c2m8-h5v5-343r — Ninja Signal Threat Intelligence | Ninja Signal