Skip to content
RCE Write-up Advanced

Uber 遠端代碼執行- Uber.com Remote Code Execution via Flask Jinja2 Template Injection

The name field on the rider profile page was rendered by a Jinja2 template without sanitisation, so template syntax in the name was evaluated by the server. An attacker could run limited Python code inside the Jinja2 sandbox and have the output sent to their own email.

blog.orange.tw

Published on blog.orange.tw

幾天前,Uber � �佈了 Bug Bounty 計畫,從 Hackerone 上看到獎金不低,最少的 XSS / CSRF 都有 3000 美金起就跳下來看一下有什麼好玩的XD

The author, on blog.orange.tw

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

Impact

An attacker could execute limited Python code on the server within the Jinja2 sandbox, and the text does not show that the sandbox was fully escaped.

What the attacker needed

An Uber rider account; ability to edit the profile name

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 template engine is software that fills in a web page by combining a fixed layout with values such as a user's name. If a site puts user input into the template itself instead of into a plain value slot, the engine treats that input as instructions and runs it. Here the name field was treated as template code, so the author could make the server do small calculations and loops.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.