-
Notifications
You must be signed in to change notification settings - Fork 1
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
Configure webpack to allow host requests inside docker containers #69
Comments
This security feature was added in webpack 2.4.3 (released late April). An article explaining the issue is here: Webpack Dev Server Security Issues. Here's the issue that was addressed. Webpack-dev-server wants to know, at startup, its host and the URL it will be accessed with. It will refuse requests to any other URL in order to prevent DNS rebinding attacks (the attacker pretends to be hosted on the same server as the defender in order to gain the special access normally reserved for processes on the same machine). Where proxies or containers are involved and the address webpack is accessed with isn't the obvious one it's expecting, this check rather complicates things. Possible solutions:
|
Yeah, we're using webpack to compile and server our code for efficiency, not for obfuscation. We really don't care if someone gets our source code from webpack.
Yeah... that's kind of what we're intending to do! One thing that we may want to consider is having a dev profile that has The only thing that might be of concern is from here:
That sounds super sketchy. Would you be able to investigate that a bit more? As an alternative, we could also just allow the server process to take an environment variable that specifies the correct host, and then run docker with that variable set. |
I think the concern is that if webpack is acting as a proxy to another service, compromising webpack gives the attacker the ability to have webpack use its privileged access to forward arbitrary requests of the attacker's choosing to the other service too. Depending on what the second service is, this could be a larger vulnerability than just letting someone read your all JS code. It could give the attacker the ability to request whatever they want from your backend databases or write things into your databases or something. We don't use webpack as a proxy to anything or give it access to anything beside the web frontend and development environment code, so I don't think this particular concern affects us at all. I'm going to talk to Matthew about it Wednesday or Thursday to double-check that conclusion. |
Possibly a better option I've just learned about: webpack added the ability to list multiple expected hostnames. So I think we could put all the docker servers into the config file as allowable hostnames, and then should be able to run webpack in a container on any of them without trouble and move the containers around as needed, put images on our docker repository, etc, without disabling the security feature. Described here: webpack/webpack-dev-server#899 That seems like the best solution to me, unless we don't want the names of the development docker servers to be publically visible in a config file on github. |
Per conversation we just had, since we're not planning to use webpack dev server in production, and development instances aren't accessible outside PCIC, there's no reason not to just disable the host check. |
Disable webpack-dev-server host checking, fix #69
No description provided.
The text was updated successfully, but these errors were encountered: