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] Can't use disableHostCheck option - v2.4.3 #883

Closed
nwoltman opened this issue Apr 23, 2017 · 11 comments
Closed

[bug] Can't use disableHostCheck option - v2.4.3 #883

nwoltman opened this issue Apr 23, 2017 · 11 comments

Comments

@nwoltman
Copy link

When trying to use the disableHostCheck option with v2.4.3, I get:

Warning: Invalid configuration object. webpack-dev-server has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'disableHostCheck'. These properties are valid:
   object { hot?, hotOnly?, lazy?, host?, filename?, publicPath?, port?, socket?, watchOptions?, headers?, clientLogLevel?, overlay?, key?, cert?, ca?, pfx?, pfxPassphrase?, inline?, public?, https?, contentBase?, watchContentBase?, open?, features?, compress?, proxy?, historyApiFallback?, staticOptions?, setup?, stats?, reporter?, noInfo?, quiet?, serverSideRender?, index?, log?, warn? } Use --force to continue.

I'm guessing disableHostCheck just needs to be added to optionsSchema.json.

@sokra
Copy link
Member

sokra commented Apr 23, 2017

Could you explain why you want to disable this security feature?

@sokra sokra closed this as completed in 988f9c9 Apr 23, 2017
@sokra
Copy link
Member

sokra commented Apr 23, 2017

released in v2.4.4

@karolyi
Copy link

karolyi commented Apr 23, 2017

@sokra, can it be that this is connected with #533 (comment)?

@nwoltman
Copy link
Author

@sokra Sometimes I need to test out features directly on my phone, and to do that I need to use the IP address of my computer that's running webpack-dev-server as the host to be able to connect to it.

I'm not totally sure that this security feature is necessary for me because when I use webpack-dev-server I'm either on a network with people I trust (home or work), or if I'm on a public network I keep my ports closed.

@edmorley
Copy link

This security feature protects against a DNS rebinding attack I reported privately to the webpack team, which may still affect you depending on your exact setup.

@nwoltman
Copy link
Author

nwoltman commented Apr 23, 2017

Oh I see. In that case I'll leave the host check enabled and only disable it when I absolutely need to (which is rarely anyway).
@edmorley At some point in the future, would you be able to share this attack with the community?

@bdwain
Copy link
Contributor

bdwain commented Apr 24, 2017

@edmorley @sokra is there a recommended solution for hitting a local dev server from a tablet without having to enable this flag then? That's a pretty common workflow for me at work and it sounds like @nwoltman is in the same boat.

@edmorley
Copy link

@edmorley At some point in the future, would you be able to share this attack with the community?

I've filed a retrospective GitHub issue with the original private disclosure email wording, which should hopefully make things a bit clearer: #887 - happy to answer any additional questions.

I've also made a suggestion about improving the UX for the "use a dynamic IP to access from a mobile device" case in #882 (comment)

@grgur
Copy link

grgur commented May 16, 2017

@bdwain have you tried setting host: 0.0.0.0?

@tanzeelrana
Copy link

I am still unable to use disableHostCheck flag -_-

ng serve --host 0.0.0.0 --disableHostCheck=true

help please

@chai-jay
Copy link

chai-jay commented May 9, 2018

@tanzeelrana That sounds like a feature request to open with Angular CLI project. Their CLI has to support disableHostCheck option and pass it to Webpack.

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

No branches or pull requests

8 participants