Kept internal under SECURITY.md: this one is exploitable. The GitHub advisory goes out with the fix.
The traversal guard in staticResolver (src/views.ts:118) compares resolved paths lexically, and then stat and readFile follow symlinks. A link inside public/ that points outside it, left there by a build step, a dependency or an upload, serves whatever it points at.
Fix: take fs.promises.realpath of the root once and of the target on each hit, and refuse any target outside the real root. Test:public/leak -> /etc/hosts gives a 404.
Kept internal under SECURITY.md: this one is exploitable. The GitHub advisory goes out with the fix.
The traversal guard in `staticResolver` (src/views.ts:118) compares resolved paths lexically, and then `stat` and `readFile` follow symlinks. A link inside `public/` that points outside it, left there by a build step, a dependency or an upload, serves whatever it points at.
**Fix:** take `fs.promises.realpath` of the root once and of the target on each hit, and refuse any target outside the real root. **Test:** `public/leak -> /etc/hosts` gives a 404.
Fixed in 26.11.0-rc.1 (53660ad). From the changelog:
static no longer serves files outside its root through a symlink (#106). The traversal guard compared paths lexically, and the file read then followed symlinks, so public/leak -> /etc/hosts was served. Containment now compares real paths: the requested file, and a directory's index.html, must resolve beneath the root's real path. Links that stay inside the root, and a root that is itself a symlink, keep working. A link that resolves outside the root, or a dangling link, is a 404 — the same miss as a file that does not exist, rendered through onError like any other, and 405/204 where the path has routes. It is deliberately not a 403, so a probe cannot tell "exists outside the root" from "does not exist". The content-type still follows the requested name, not the link target. The root's real path is resolved on the first request and cached, so re-pointing a root symlink while the app runs needs a restart to take effect. A link swapped inside the root between the check and the read can still escape; exploiting that needs write access to the served directory.
Fixed in **26.11.0-rc.1** (`53660ad`). From the changelog:
- **`static` no longer serves files outside its root through a symlink** (#106). The traversal guard compared paths lexically, and the file read then followed symlinks, so `public/leak -> /etc/hosts` was served. Containment now compares real paths: the requested file, and a directory's `index.html`, must resolve beneath the root's real path. Links that stay inside the root, and a root that is itself a symlink, keep working. A link that resolves outside the root, or a dangling link, is a **404** — the same miss as a file that does not exist, rendered through `onError` like any other, and `405`/`204` where the path has routes. It is deliberately not a `403`, so a probe cannot tell "exists outside the root" from "does not exist". The content-type still follows the requested name, not the link target. The root's real path is resolved on the first request and cached, so **re-pointing a root symlink while the app runs needs a restart** to take effect. A link swapped inside the root between the check and the read can still escape; exploiting that needs write access to the served directory.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Kept internal under SECURITY.md: this one is exploitable. The GitHub advisory goes out with the fix.
The traversal guard in
staticResolver(src/views.ts:118) compares resolved paths lexically, and thenstatandreadFilefollow symlinks. A link insidepublic/that points outside it, left there by a build step, a dependency or an upload, serves whatever it points at.Fix: take
fs.promises.realpathof the root once and of the target on each hit, and refuse any target outside the real root. Test:public/leak -> /etc/hostsgives a 404.Fixed in 26.11.0-rc.1 (
53660ad). From the changelog:staticno longer serves files outside its root through a symlink (#106). The traversal guard compared paths lexically, and the file read then followed symlinks, sopublic/leak -> /etc/hostswas served. Containment now compares real paths: the requested file, and a directory'sindex.html, must resolve beneath the root's real path. Links that stay inside the root, and a root that is itself a symlink, keep working. A link that resolves outside the root, or a dangling link, is a 404 — the same miss as a file that does not exist, rendered throughonErrorlike any other, and405/204where the path has routes. It is deliberately not a403, so a probe cannot tell "exists outside the root" from "does not exist". The content-type still follows the requested name, not the link target. The root's real path is resolved on the first request and cached, so re-pointing a root symlink while the app runs needs a restart to take effect. A link swapped inside the root between the check and the read can still escape; exploiting that needs write access to the served directory.