Git Product home page Git Product logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
> An image candidate string consists of the following components, in order, 
with the
> further restrictions described below this list:
> 1. Zero or more space characters.
> 2. A valid non-empty URL referencing a non-interactive, optionally animated,
>  image resource that is neither paged nor scripted.
> 3. Zero or more space characters.

I believe (3) is a spec error and should read "One or more", as the spec is 
ambiguous as written unless you assume all matching is greedy left-to right and 
that the additional restrictions cause backtracking so that

   foo10w,bar10h

is equivalent to

    foo 10w , bar 10h

We need to test around commas at the end of and inside URLs:

foo,,bar
foo, bar
foo,bar , baz

Comma is a sub-delim in RFC 3986, but should be safe to re-encode (%2c) in URIs.

Even given that commas are properly guarded, "valid non-empty URL" ( 
http://dev.w3.org/html5/spec-LC/urls.html ) could allow internal white-space, 
so we will need to enforce additional restrictions and re-encode all potential 
white-space inside URLs to guard against URL splitting attacks like

    http://foo/10w,javascript:alert(1337) 10h

being interpreted as 2 URLs.

Original comment by [email protected] on 21 Jan 2014 at 4:50

from java-html-sanitizer.

jmanico avatar jmanico commented on August 16, 2024

Bump to revisit.

from java-html-sanitizer.

mikesamuel avatar mikesamuel commented on August 16, 2024

Closing in favor of issue #112

from java-html-sanitizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.