Insecure Origin Check in Extension Requestly Leads to UXSS
1. Overview
Once a victim clicks on the malicious page.
An attacker can silently configure a rule inside the victim’s Requestly extension, which will result in arbitrary JavaScript code execution across all websites the victim visits.
2. Introduction to Requestly
Requestly is a popular(more than 200000users) Chrome extension that allows developers and testers to intercept, modify, and redirect network requests directly from the browser. It supports use cases such as:
- Modifying HTTP request/response headers
- Redirecting URLs
- Blocking requests
- Rewriting content
- Executing custom scripts
- …
2.1 How does Requestly work
It took me quite some time to figure this out. I found the vulnerable code firstly, but I didn’t where can I trigger it.
But there are only a few ways for browser extensions to interact with the page.
We can download the source code to review.
https://github.com/requestly/requestly
3. Vulnerability Detail
The vulnerable code resides in app.cs.js and is only loaded and executed on the websites app.requestly.io or app.requestly.com.
- using isAppURL to check event.origin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32export const initMessageHandler = () => {
window.addEventListener(
"message",
async (event: MessageEvent): Promise<void> => {
if (event && !isAppURL(event.origin)) {
if (config.logLevel === "debug") {
console.log("Ignoring message from the following domain", event.origin, event.data);
}
return;
}
```
2. isAppURL
use `includes` method to check, it can be bypassed easily.
```js
export const isAppURL = (url: string) => {
return !!url && getAllSupportedWebURLs().some((webURL) => url.includes(webURL));
};
export const getAllSupportedWebURLs = () => {
const webURLsSet = new Set([config.WEB_URL, ...config.OTHER_WEB_URLS]);
return [...webURLsSet];
};
WEB_URL: "https://app.requestly.io",
OTHER_WEB_URLS: ["https://app.requestly.com"],
So this check can be bypassed with such origins:
https://app.requestly.io.attacker.com
https://app.requestly.com.attacker.com
4. Proof of Concept
https://app.requestly.io.cdn.cloud.d33n.cn/requestly-poc.html
1 | <!DOCTYPE html> |
5. Recommendation
1 | const trustedOrigins = ["https://api.requestly.io", "https://api.requestly.com"]; |
6. Timeline
Date | Event |
---|---|
2025-04-10 | Vulnerability discovered |
2025-04-11 | Proof of concept developed |
2025-04-12 | Reported the issue to the Requestly |
2025-04-14 | Fixed |
7. Credits
This vulnerability was discovered by Deen.