pentesting, updated

Testing for JavaScript execution

Check whether a feature meant to accept data ends up executing it as JavaScript.

Goal

Confirm no feature (a “custom theme” field, a saved search, a URL parameter used in a dynamic script tag) turns user data into executed JS.

How to test

Look for places user input constructs a <script> tag, a javascript: URI, or an eval-like sink, and probe each:

javascript:alert(1)
curl -s "https://example.com/redirect?url=javascript:alert(1)"

What to look for

The JS executing — in a javascript: link that’s actually followed, or in a value that reaches eval/Function().

References

§ home
~/knubertus/home/
1,1 Top