GHSL-2020-213: Server-Side Template Injection in BrowserUp Proxy - CVE-2020-26282
BrowserUp Proxy's REST API used Java Bean Validation custom constraint validators that interpolated attacker-controlled input into error message templates, allowing Java EL injection. An unauthenticated attacker could execute arbitrary Java code on the server running the proxy.
Originally disclosed on GitHub Security Lab
A Server-Side Template Injection was identified in BrowserUp Proxy enabling attackers to inject arbitrary Java EL expressions, leading to an unauthenticated Remote Code Execution (RCE) vulnerability.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The custom constraint validator built an error message template containing untrusted input and passed it to buildConstraintViolationWithTemplate(), which evaluates Java EL expressions.
Impact
An unauthenticated attacker could execute arbitrary code on the machine running BrowserUp Proxy, as the REST API binds to all interfaces by default and requires no authentication.
What the attacker needed
BrowserUp Proxy REST API reachable; No authentication required
The fix
The vulnerability was fixed in a release on 12/22/2020.
How it was found
- Start BrowserUp Proxy on port 8080.
- Create a proxy instance on port 8081 via POST /proxy.
- Create a new HAR via PUT /proxy/8081/har.
- Send a GET request to /proxy/8081/har/entries with a urlPattern containing an unclosed parenthesis and a Java EL payload.
- Observe the error response showing the evaluated expression result, confirming code execution.
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 report has not been written yet. The Original tab links to the source.
BrowserUp Proxy is a tool for testing web traffic. Its REST API accepted a URL parameter that was checked as a regular expression, and when the check failed, the error message included the user's input. Because the error message system also evaluated special expressions, an attacker could put code in that parameter and have it run on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.