Path Traversal Vulnerability in Lila Project on Lichess.org
The /assets/ endpoint on Lichess.org failed to block directory traversal sequences, allowing an attacker to read files outside the intended assets folder. This enabled access to source files and internal configuration files such as build.sbt and .git/config.
medium.com
Published on medium.com
Path traversal vulnerabilities are subtle yet impactful — they allow attackers to break out of intended directories and access arbitrary files on the server. This can result in serious information disclosure or act as a stepping stone for deeper exploitation.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely insufficient sanitisation of user-supplied input in the /assets/ route, allowing directory traversal sequences to escape the intended folder.
Impact
An attacker could read arbitrary files, potentially exposing internal project structure and secrets, though sensitive files were protected by restricted Linux permissions in production.
What the attacker needed
None
The fix
The vulnerability was fixed by sanitising user input and avoiding development-specific routing logic in production.
How it was found
- Send a request to the /assets/ endpoint with a path traversal sequence to access build.sbt.
- Send a request to the /assets/ endpoint with a path traversal sequence to access .git/config.
- Observe that the server returns the contents of these files.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A path traversal bug lets someone trick a website into reading files it shouldn't, by using special characters like '../' in a web address. Here, the /assets/ folder was supposed to serve only public files, but the server didn't check properly, so it returned private files like build.sbt and .git/config.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.