Packages / wrangler / Security
Arbitrary remote file read in Wrangler dev server
Affected releases · wrangler
- 3.x3.9.0 – 3.18.0Fixed in 3.19.0
On 3.x, the newest line:
npm install wrangler@3.19.0Not affected
4.0.0 – 4.151.3
225 releases, latest
Not affected
3.0.0 – 3.8.0
13 releases
Affected
3.9.0 – 3.18.0
15 releases
Fixed
3.19.0 – 3.114.17
169 releases
Is your project affected?
Paste your package.json, or type the range you declare for wrangler. It is read in your browser and sent nowhere.
What happens
Impact
Sending specially crafted HTTP requests and inspector messages to Wrangler's dev server could result in any file on the user's computer being accessible over the local network. An attacker that could trick any user on the local network into opening a malicious website could also read any file.
Patches
This issue was fixed in wrangler@3.19.0. Wrangler will now only serve files that are part of your bundle, or referenced by your bundle's source maps.
Workarounds
Configure Wrangler to listen on local interfaces instead with wrangler dev --ip 127.0.0.1. This is the default as of wrangler@3.16.0, and removes the local network as an attack vector, but does not prevent an attack from visiting a malicious website.
References