Skip to content

Conversation

@pahp
Copy link

@pahp pahp commented Nov 4, 2024

This commit adds a URL parameter, 'name', that is used in a welcome message if it exists. The name is unsanitized and so can include JS and thus cause an XSS that runs on the client side but does not exist on the server side (i.e., a "reflected XSS").

The behavior of the system is unchanged if you go to the bare URL, e.g., http://127.0.0.1:5000/ -- however, if you add a 'name' parameter to the URL, e.g., http://127.0.0.1:5000?name=Peter it will display a welcome message between "XSS Demo" and "Read, Search, and Post Comments".

The name parameter can contain JS, e.g.:
http://127.0.0.1:5000?name=Peter<script>alert("boo")</script>

... and this JS will run in the page.

Sanitization should be the same in either case, i.e., setting autoescape to true in the template.

pahp added 2 commits November 4, 2024 11:31
This commit adds a URL parameter, 'name', that is used in a
welcome message if it exists. The name is unsanitized and so
can include JS and thus cause an XSS that runs on the client
side but does not exist on the server side (i.e., a "reflected
XSS").

The behavior of the system is unchanged if you go to the bare URL,
e.g., http://127.0.0.1:5000/ -- however, if you add a 'name' parameter
to the URL, e.g., http://127.0.0.1:5000?name=Peter it will display
a welcome message between "XSS Demo" and "Read, Search, and Post
Comments".

The name parameter can contain JS, e.g.:
http://127.0.0.1:5000?name=Peter<script>alert("boo")</script>

... and this JS will run in the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant