Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG Fix: arbitrary remote code execution within wrangler dev Workers sandbox #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lamcodeofpwnosec
Copy link

The V8 inspector intentionally allows arbitrary code execution within the Workers sandbox for debugging. wrangler dev would previously start an inspector server listening on all network interfaces. This would allow an attacker on the local network to connect to the inspector and run arbitrary code. Additionally, the inspector server did not validate Origin/Host headers, granting an attacker that can trick any user on the local network into opening a malicious website the ability to run code. If wrangler dev --remote was being used, an attacker could access production resources if they were bound to the worker.

$ lsof -nPiTCP -sTCP:LISTEN
COMMAND   PID USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
node    51399  pwu   33u  IPv6 0xe8478a1f17ba37f      0t0  TCP *:9229 (LISTEN)
node    51399  pwu   37u  IPv4 0xe8478b51682305f      0t0  TCP *:56781 (LISTEN)
node    51399  pwu   38u  IPv6 0xe8478a1f17bab7f      0t0  TCP *:6284 (LISTEN)
workerd 51401  pwu   11u  IPv4 0xe8478b515f2f98f      0t0  TCP 127.0.0.1:56779 (LISTEN)
workerd 51401  pwu   12u  IPv6 0xe8478a1f17bb37f      0t0  TCP [::1]:56779 (LISTEN)
workerd 51401  pwu   14u  IPv4 0xe8478b5166e64ff      0t0  TCP *:8787 (LISTEN)
 export const openInspector = async ( 
 	inspectorPort: number, 
 	worker: string | undefined 
 ) => { 
 	const query = new URLSearchParams(); 
 	query.set("theme", "systemPreferred"); 
 	query.set("ws", `localhost:${inspectorPort}/ws`); 

CVE-2023-7080
CWE-269

Signed-off-by: ANDRI ANDRI  <47277287+lamcodeofpwnosec@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant