You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although this might be technically correct (?), it seems like it's not what most people would think of as an absolute URL, and it could lead to a false sense of security that the input has been validated as a 'real' URL.
Possible solutions:
Release a new major version that ensures the protocol is http or https
Maybe with an option like { allowNonHttp: true } for people who want the old behaviour.
Or just add a warning in the readme that this will return true for any protocol, even javascript:.
The text was updated successfully, but these errors were encountered:
This package is really not meant as a security measure and javascript: is technically an absolute URL. However, I also guess the main use-case is to check HTTP URLs, so I'm willing to change the default behavior. How about an option called httpOnly which defaults to true?
Or just add a warning in the readme that this will return true for any protocol, even javascript:.
We can do this too for in case the user set httpOnly to false.
If anyone wants to work on this, see the feedback in #14 and #12.
sindresorhus
changed the title
XSS risk: returns true for "javascript:" protocol
Only allow HTTP URLs by default
Nov 12, 2019
Although this might be technically correct (?), it seems like it's not what most people would think of as an absolute URL, and it could lead to a false sense of security that the input has been validated as a 'real' URL.
Possible solutions:
http
orhttps
{ allowNonHttp: true }
for people who want the old behaviour.javascript:
.The text was updated successfully, but these errors were encountered: