-
Notifications
You must be signed in to change notification settings - Fork 0
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
Provided URLs are not validated #17
Comments
A unique resource identifier can be |
In that case, I think you shouldn't be able to click it as if it links to a web-page unless it is clearly an absolute URL (which would again break |
This field is called URI to mean Unique Resource Identifier. It's nothing more than a user-defined string of characters which identifies that particular resource: A unique-key. The World Wide Web adopted a similar way to identify resources and created URI: Uniform Resource Identifier. The latter has a strict specification attached to it, but Webistor should not enforce WWW URI's. However, since it will be the most common use for our URI field in Webistor, we can assume that we're generally providing some ease of access to our users by creating a link for them. The problem lies with how these links are created. Right now we're just throwing it into an
The issue of sharing executable links with friends will be resolved by implementing Content Security Policy. |
Does the latter also protect against scripts that fit in the URI field without external resources? A memory flooding "practical joke" script for example. |
The way CSP is set up in my pull-request, in-line scripts are not loaded/executed. So yes, it would protect against such attacks. |
That's pretty sweet :] how does it tell actual scripts and scripts found in a json search result from the API apart? Based on the mime type? Or does it simply not include the API subdomain. |
The browser simply looks at the source of the script before executing it. If the source was not amongst the white-listed script-sources (defined by headers), it will not be executed. Script sources include generic URL's, but also keywords like |
Ahaa, so unless we would insert it into the DOM as a |
{edited twice} With the comments above I think we indeed need to fix the issue, "Provided URLs are not validated #17", by trying to recognize the URI the best way we can. (But lets implement most of the other enhancements first.) Oh, and first I mistood the concept
Avaq said: lets make non-recognized URI's clickable, so the Webistor resource clicked on opens in full-view mode. If you click recognized URI's though, send the user along to linked web-resource in a new tab.. I thought of this / I thought this would be nice too:
Referencing other Webistor resources is a good way to create links between different resources. We could change the anchor target for this type of URI's to "_self" instead of "_blank". This way chains develop. |
While I do think URL validation should not be too strict, no validation may be a bit much freedom.
Using
javascript:alert('hello world');
as URL works (which may result in issues when sharing with friends is enabled) as well asmistake
which then points tohttp(s)://webistor.net/mistake
.Bigger usability problems happen with this example:
www.website.com
which will point tohttp(s)://webistor.net/www.website.com
The text was updated successfully, but these errors were encountered: