Skip to content

Redirects can be used for XSS #24

@fprochazka

Description

@fprochazka

If the attacker finds a hole, where he can provide an URL that is passed directly to Http\Response::redirect(), then he's able to create XSS.

for example

/some/page?redirect=%0Ajavascript:alert(/xss/)

Which executes to

public function actionPage($redirect)
{
    $this->redirectUri($redirect);
}

The browser won't redirect, because it's not a valid url, but HTML will be printed

Location: %0Ajavascript:alert(/xss/)


<h1>Redirect</h1>

<p><a href="
javascript:alert(/xss/)">Please click here to continue</a>.</p>

This happened to us in our mailing click-through counter.


Also relevant http://forum.nette.org/cs/21315-parsovani-absolutni-url-routerem-aplikace#p146150

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions