Wysoka

Tornado: StaticFileHandler follows symlinks outside static root (path traversal)

  • Ujawniono: 30.09.2026
  • Aktualizacja: 11.10.2026 15:18

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:

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 vulnerability. Prerequisites: Python 3.x, Tornado installed.

  1. Create the environment
bash
mkdir -p /tmp/static
echo "DB_PASSWORD=s3cr3t" > /tmp/secret.conf   
ln -s /tmp/secret.conf /tmp/static/config.conf
  1. Minimal vulnerable server (server.py):
import tornado.web, tornado.ioloop

app = tornado.web.Application([
    (r"/static/(.*)", tornado.web.StaticFileHandler, {"path": "/tmp/static"}),
])
app.listen(8888)
tornado.ioloop.IOLoop.current().start()
  1. Exploit: curl http://localhost:8888/static/config.conf

Impact

Any application using StaticFileHandler is potentially affected if:

  • the static directory contains symlinks pointing outside it (common with build tooling), or
  • the application allows file uploads into the static directory without stripping symlinks.

An unauthenticated remote attacker can read any file readable by the process user: application secrets, private TLS keys, database credentials, /etc/shadow, SSH keys, or source code (depending on the process's filesystem permissions).

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) tornado < 6.5.9 6.5.9

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Słabość (CWE)
CWE-59
Platforma
Python (PyPI)
Paczka
tornado
Ujawniono
30.09.2026
Aktualizacja
11.10.2026 15:18

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-c2m8-h5v5-343r - CC BY 4.0

Historia podatności: tornado

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (23) w archiwum
Wszystkich wpisów
23
Pierwsza → ostatnia
05.2012 09.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Wysoka 13
  • Średnia 8
  • Niska 2

Ujawnienia w latach

  1. 2017: 0
  2. 2018: 0
  3. 2019: 0
  4. 2020: 1
  5. 2021: 0
  6. 2022: 0
  7. 2023: 2
  8. 2024: 3
  9. 2025: 4
  10. 2026: 12

wcześniej: 1

Istotność:
  1. Tornado: StaticFileHandler follows symlinks outside static root (path traversal) ten wpis
    Wysoka CVE-2026-103263 < 6.5.9 6.5.9
  2. Wysoka · 7.5 CVE-2026-31958 < 6.5.5 6.5.5
  3. Wysoka · 7.5 CVE-2025-67726 < 6.5.3 6.5.3
  4. Wysoka · 7.5 CVE-2025-67725 < 6.5.3 6.5.3
  5. Wysoka · 7.5 CVE-2024-52804 < 6.4.2 6.4.2

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.