-
Notifications
You must be signed in to change notification settings - Fork 214
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
CSS URLs longer than 1024 characters are not allowed #187
Comments
I believe the thought was that long URLs can be a denial-of-service vector. That decision was made before data: URLs were widely used for images, so could be reconsidered. Do you know of a good cutoff? https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers seems to conflate the address bar length and length limits to fetch.spec.whatwg.org. |
Thanks for the reply. I am not aware of what a good cutoff would be. I thought that maybe the justification for a limit of 1024 was Those who are concerned about the max lengths could still enforce a 1024 character limit (or any limit) using a custom |
Is there a workaround to allow any size data:image blocks? I have a size check on the whole payload of HTTP request, so I don't need to check individual properties length. |
Length limits avoid a lot of boundary problems in downstream code so seem in scope for sanitizers. https://stackoverflow.com/a/417184/20394 suggests that maybe the limit should be 2000 instead of 1024 |
When trying to sanitize large data URIs used as background images in CSS properties, there is a hard-coded URL limit of 1024 characters (this is in
StylingPolicy.sanitizeAndAppendUrl
). Any value larger than 1024 characters is removed.The output for TOO_LONG will not include the background-image property, but the output for NOT_TOO_LONG will. Is there a reason for the limit?
The text was updated successfully, but these errors were encountered: