Skip to content

Consider What Happens to XSS Surface Area With No Whitelist #10507

@sebmarkbage

Description

@sebmarkbage

Consider the case in #10506 but let's say we've fix it by special casing dangerouslySetInnerHTML to use a symbol.

Now consider this URL:

?{"content":"Click%20Me","onclick":"alert(%27p0wned%27)"}

If onclick (or any other event name, current or future) gets passed through as a plain old string, then this is a XSS vulnerability.

The tricky part about this one is that it's plain old strings and it's a potentially infinite long list since it also includes future event names.

Now I think a safe strategy might be to hard blacklist (meaning they don't get added to the DOM) any attribute that starts with on. Does that cover everything?

cc @nhunzaker

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions