Cross-site Scripting (XSS)
Imagine you are the owner of breddit.com, the number one social media site for the baking industry. You have an avid community of commenters who love sharing their bread knowledge.
Because the main use of your website is to facilitate discussion, users can add comments, which are saved to the database and displayed to other users.
Unfortunately the popularity of your site has also attracted the attention of hackers, who want to access your site for nefarious purposes.
Unless you are careful when constructing the HTML, hackers can abuse the comment function by injecting JavaScript.
Watch how Mal injects some malicious JavaScript.
A real attack might use cross-site scripting to steal another user's cookie, which can permit session hijacking.
Now you try. Inject a script tag to call the upvote() function whenever the page is viewed.
Skull
We'd better learn how to protect against cross-site scripting then.
Mal
Bread

breddit

How much do you guys like bread?

roll_with_it
I dream of baking tins.
I_knead_you_right_now
I love it so much, I think I might be part duck.
butter_you_than_me
...
butter_you_than_me
...
Vic
Rude.
That's not good.
Bread

breddit

How much do you guys like bread?

roll_with_it
I dream of baking tins.
butter_you_than_me
...
butter_you_than_me
...
Haxxed 0
Bread

breddit

Bakers Are Fat-Handed Yeast Monsters

roll_with_it
That's mean. Why would you say that?
Is your website vulnerable to XSS?
Netsparker n
Check today. Scan your website for Cross-site Scripting (XSS) and other vulnerabilities with Netsparker Web Application Security Scanner.