Verify Host and Origin headers in dev server#10138
Conversation
|
Since you are concerned about breaking certain workflows, have you considered introducing a new config or CLI flag that would revert this patch? It's far from ideal but other bundlers have done this in the past. |
|
As a user of Parcel, I prefer Parcel to only allow local hosts and local IP addresses by default. If I need to customize the host name or release host verification and other functions, I can configure it manually, or there is an official plug-in that is specifically configured for the network. This plug-in allows all network access by default. Because I think most developers who use Parcel do so because of its simple and fast configuration. |
|
@devongovett it would be good if there could be some movement on this, as it's forcing us to re-evaluate if we stick with Parcel as our build tool. Personally, I've found it's often considered acceptable to do what could be considered a breaking change as patch release if they're for security issues as arguably they're a bug, but if you feel this is still too big of a change to ship like that I would recommend releasing it as a new major asap with that being the only breaking change - that way it should be very easy for downstream packages to upgrade to that new major without needing to do their own new major, and consumers like myself can safely use e.g. |
|
Our build stops if |
- Add .pnpmauditrc.yaml to acknowledge dev-only vulnerability - Document Parcel dev server origin validation error (CVSS 6.5) - Include risk assessment confirming no production/end-user impact - Provide behavioral and technical mitigation measures - Track upstream fix PR parcel-bundler/parcel#10138 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
First of all I don't think this is a particularly bad issue - if you are building a web app you generally expect people to download the code for it. Even with the mitigations here, anyone on the same network can still access the code. "Fixing" this makes Parcel worse for users, breaking common workflows like testing from different devices on your local network, or via proxy servers. An alternative would be a new CLI option |
|
as an official NIST CVE and GHSA, unfortunately, even if it doesn't feel particularly bad (and I agree, it feels like "yeah, that's what a dev server does, why is this a CVE?"), this now flags Parcel as a security vulnerability in literally every vulnerability tool. So without a patch and new version that can be pinned/set as new lowest version, Parcel effectively can't be used anymore by loads of folks because their orgs (some for legal reasons) don't allow code with security vulnerabilities to land or even continue to be used in development until a patch has been issued. Which also includes being able to use frameworks that use Parcel under the hood, like Gatsby, etc. |
|
Please see #10216 (comment). You are welcome to offer a better suggestion for a patch. This one is too restrictive and breaks too much. |
Previously we allowed all requests in the dev server, but this could potentially allow another website to access local source code.
This implements 3 mitigations:
Originheader matches an allowed host. By defaultlocalhostand local IP addresses are allowed. The existing--hostoption can be specified to use a different host. SetAccess-Control-Allow-Originto only that origin instead of*.Originheader when a WebSocket connects. This allows localhost by default, or the--hmr-host/--hostoption.Hostheader to prevent DNS rebinding attacks.One problem is that reverse proxy services such as Cloudflare Tunnels no longer work due to Host validation. Setting the
--hostoption does not work because that also sets the network interface, and the cloudflare host is not valid in that situation. We would need to add an additional option to either disable host validation or provide additional allowed hosts. Unfortunately we don't have a great place to put this. Environment variable? New CLI option? Seems important to solve this one.Another downside is if you use custom hostnames (e.g. configured via
/etc/hosts), these are not allowed by default. You'd need to manually set the--hostoption now, and only one at a time can be used. Would be nice if these could automatically be added to the allowed hosts (e.g. could do a reverse DNS lookup for127.0.0.1), but would this then be susceptible to DNS rebinding?Unless we can solve the above items this is also technically a breaking change...