My Expense Report resulted in a Server-Side Request Forgery (SSRF) on Lyft
The Lyft app allowed users to inject HTML into expense notes, which was rendered by the WeasyPrint PDF generator. By using a link tag with a file:// URL, an attacker could read local files and include their contents in the generated PDF.
Published on nahamsec.com
Written by Ben Sadeghipour
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, the application failed to sanitise user-supplied HTML before passing it to WeasyPrint, which supports link tags that can fetch local files.
Impact
An attacker could read local files on the server that generates the PDF, potentially exposing sensitive information.
What the attacker needed
A Lyft account; ability to take rides; victim takes a ride and requests PDF
The fix
The vulnerability was fixed by Lyft after the report.
How it was found
- Enter an HTML tag in the expense notes field.
- Request an expense report PDF.
- Observe that the HTML tag is rendered in the PDF.
- Use a link tag with a file:// URL to include a local file.
- Unpack the PDF to read the file contents.
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.
When you request a PDF of your ride expenses, Lyft uses a tool called WeasyPrint to turn HTML into a PDF. The app didn't properly clean the HTML you could put in your expense notes, so you could sneak in a special tag that tells WeasyPrint to include the contents of a file from the server. That means someone could read private files on Lyft's servers.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.