Re:In search of the perfect URL validation regex
by billyhoffman on Thursday August 06, 2015 @10:22PM
(#10020647)
Ahh. Very true. Let me be a little more clear. I work on public web apps where there is literally an HTML text input for someone to submit a URL that we should audit. I'm not talking about people typing URLs directly into a browser.
At least once a month I get someone giving me a URL with embedded credentials to a dev or staging environment for an Alexa top 50K site. Things like https://qa:[email protected]/blah. It's pretty terrible, but makes for an interesting sales call :-)
Re:In search of the perfect URL validation regex
by moloch on Friday August 07, 2015 @01:31AM
(#10021038)
It can affect what domain you end up at though, for example:
http://foo:bar.com\@example.com
Chrome/Webkit browsers will go to `bar.com` but Firefox will end up at `example.com` for the same URL! There's a fantastic book called "The Tangled Web" that has lots of examples of these pitfalls.
FWIW, browsers don't send the user:pass in the URL - they automatically marshal it into the Authorization: Basic header. Obviously sending these over HTTP is still dumb, but they're not (typically) logged in plain-text in browser history/server request logs.