T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/share_local_path.sh:12- Finding
HTTP file server binds to all network interfaces
- Content
View full analysis
/tmp/trycloudflare-file-server.log 2>&1 & ``` ### Technical Analysis Python's `http.server` binds to all available network interfaces by default when no `--bind` argument is supplied. Although the Cloudflare tunnel connects to `127.0.0.1`, the origin server is also directly accessible through the host's other network interfaces. The server exposes the entire directory selected through `SERVE_DIR`, including directory listings and every readable file below that directory. Its network exposure is therefore broader than the intended localhost-to-tunnel communication path and broader than the single `REL_PATH` printed by the script. ### Attack Path 1. A user runs the script with a directory containing the intended shared file and other readable files. 2. The Python HTTP server listens on `0.0.0.0` or the equivalent wildcard address at the selected port. 3. An attacker on a network capable of reaching the host identifies the open port. 4. The attacker connects directly to `http://HOST:PORT/`, bypassing the public tunnel URL. 5. The attacker uses directory listings or predictable paths to retrieve other files under `SERVE_DIR`. ### Impact Assessment A network-adjacent attacker may obtain unauthorized read access to files beneath the served directory. The process does not grant operating-system privileges beyond those of the invoking user, but it exposes every file that the HTTP server process can read under `SERVE_DIR`. The disclosure scope is particularly significant if the caller selects a home directory, project root, or another directory containing credentials, source code, or private artifacts. ]]>- Remediation
View remediation
