@@ -19,6 +19,22 @@ const host = process.env.HOST || '0.0.0.0';
19
19
20
20
module . exports = function ( proxy , allowedHost ) {
21
21
return {
22
+ // WebpackDevServer 2.4.3 introduced a security fix that prevents remote
23
+ // websites from potentially accessing local content through DNS rebinding:
24
+ // https://github.com/webpack/webpack-dev-server/issues/887
25
+ // https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
26
+ // However, it made several existing use cases such as development in cloud
27
+ // environment or subdomains in development significantly more complicated:
28
+ // https://github.com/facebookincubator/create-react-app/issues/2271
29
+ // https://github.com/facebookincubator/create-react-app/issues/2233
30
+ // While we're investigating better solutions, for now we will take a
31
+ // compromise. Since our WDS configuration only serves files in the `public`
32
+ // folder we won't consider accessing them a vulnerability. However, if you
33
+ // use the `proxy` feature, it gets more dangerous because it can expose
34
+ // remote code execution vulnerabilities in backends like Django and Rails.
35
+ // So we will disable the host check normally, but enable it if you have
36
+ // specified the `proxy` setting.
37
+ disableHostCheck : ! proxy ,
22
38
// Enable gzip compression of generated files.
23
39
compress : true ,
24
40
// Silence WebpackDevServer's own logs since they're generally not useful.
0 commit comments