How dangerous is XSS?What is DOM based XSS? And How to prevent it?Difference in Web Language Compilation and ExecutionIs this reflected or DOM-based XSS?Dangers of XSS on the server-side vs client-sideHow dangerous is reflected request query strings?HOW is the malicious URL/payload is delivered to the user on a DOM based XSS attack?How does CORS prevent XSS?Is echoing GET parameters into a script tag reflected or DOM based XSS?Burpsuite - finding xss vulnerabilities in the vaadin frameworkWhat is client side non-DOM XSS?
What exploit Are these user agents trying to use?
How could indestructible materials be used in power generation?
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
CAST throwing error when run in stored procedure but not when run as raw query
Intersection Puzzle
Could the museum Saturn V's be refitted for one more flight?
Why can't we play rap on piano?
Do scales need to be in alphabetical order?
Why is consensus so controversial in Britain?
How badly should I try to prevent a user from XSSing themselves?
What killed these X2 caps?
Why didn't Miles's spider sense work before?
Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?
Little known, relatively unlikely, but scientifically plausible, apocalyptic (or near apocalyptic) events
Why is this clock signal connected to a capacitor to gnd?
Im going to France and my passport expires June 19th
Unlock My Phone! February 2018
Plagiarism or not?
Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?
Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?
Personal Teleportation: From Rags to Riches
If human space travel is limited by the G force vulnerability, is there a way to counter G forces?
Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?
Why do bosons tend to occupy the same state?
How dangerous is XSS?
What is DOM based XSS? And How to prevent it?Difference in Web Language Compilation and ExecutionIs this reflected or DOM-based XSS?Dangers of XSS on the server-side vs client-sideHow dangerous is reflected request query strings?HOW is the malicious URL/payload is delivered to the user on a DOM based XSS attack?How does CORS prevent XSS?Is echoing GET parameters into a script tag reflected or DOM based XSS?Burpsuite - finding xss vulnerabilities in the vaadin frameworkWhat is client side non-DOM XSS?
I am a software engineer and have been watching a lot of videos about XSS.
But I fail to understand how is it dangerous if it runs on the client side and does not execute on the server side which contains the databases, and many important files.
web-application xss vulnerability
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 8 more comments
I am a software engineer and have been watching a lot of videos about XSS.
But I fail to understand how is it dangerous if it runs on the client side and does not execute on the server side which contains the databases, and many important files.
web-application xss vulnerability
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
8
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
14
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
8
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
49
It's about 12 dangerous.
– Paul D. Waite
yesterday
2
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago
|
show 8 more comments
I am a software engineer and have been watching a lot of videos about XSS.
But I fail to understand how is it dangerous if it runs on the client side and does not execute on the server side which contains the databases, and many important files.
web-application xss vulnerability
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am a software engineer and have been watching a lot of videos about XSS.
But I fail to understand how is it dangerous if it runs on the client side and does not execute on the server side which contains the databases, and many important files.
web-application xss vulnerability
web-application xss vulnerability
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 15 hours ago
Peter Mortensen
71049
71049
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Apr 1 at 3:26


Sai KumarSai Kumar
16825
16825
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Sai Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
8
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
14
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
8
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
49
It's about 12 dangerous.
– Paul D. Waite
yesterday
2
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago
|
show 8 more comments
8
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
14
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
8
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
49
It's about 12 dangerous.
– Paul D. Waite
yesterday
2
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago
8
8
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
14
14
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
8
8
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
49
49
It's about 12 dangerous.
– Paul D. Waite
yesterday
It's about 12 dangerous.
– Paul D. Waite
yesterday
2
2
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago
|
show 8 more comments
9 Answers
9
active
oldest
votes
Below are the things an attacker can do if there is XSS vulnerability. Content taken from somdev blog
Ad-Jacking - If you manage to get stored XSS on a website, just
inject your ads in it to make money ;)
Click-Jacking - You can create a hidden overlay on a page to hijack clicks of the victim to perform malicious actions.
Session Hijacking - HTTP cookies can be accessed
by JavaScript if the HTTP ONLY flag is not present in the cookies.
Content Spoofing - JavaScript has full access to client side code of
a web app and hence you can use it show/modify desired content.
Credential Harvesting - The most fun part. You can use a fancy popup
to harvest credentials. WiFi firmware has been updated, re-enter your
credentials to authenticate.
Forced Downloads - So the victim isn’t
downloading your malicious flash player from absolutely-safe.com?
Don’t worry, you will have more luck trying to force a download from
the trusted website your victim is visiting.
Crypto Mining - Yes, you
can use the victim’s CPU to mine some bitcoin for you!
Bypassing CSRF
protection - You can make POST requests with JavaScript, you can
collect and submit a CSRF token with JavaScript, what else do you
need?
Keylogging - You know what this is.
Recording Audio - It
requires authorization from the user but you access victim’s
microphone. Thanks to HTML5 and JavaScript.
Taking pictures - It
requires authorization from the user but you access victim’s webcam.
Thanks to HTML5 and JavaScript.
Geo-location - It requires
authorization from the user but you access victim’s Geo-location.
Thanks to HTML5 and JavaScript. Works better with devices with GPS.
Stealing HTML5 web storage data - HTML5 introduced a new feature, web
storage. Now a website can store data in the browser for later use
and of course, JavaScript can access that storage via
window.localStorage() and window.webStorage() Browser & System
Fingerprinting - JavaScript makes it a piece of cake to find your
browser name, version, installed plugins and their versions, your
operating system, architecture, system time, language and screen
resolution.
Network Scanning - Victim’s browser can be abused to scan
ports and hosts with JavaScript.
Crashing Browsers - Yes! You can
crash browser with flooding them with….stuff.
Stealing Information -
Grab information from the webpage and send it to your server. Simple!
Redirecting - You can use javascript to redirect users to a webpage
of your choice.
Tabnapping - Just a fancy version of redirection.
For example, if no keyboard or mouse events have been received for
more than a minute, it could mean that the user is afk and you can
sneakily replace the current webpage with a fake one.
Capturing
Screenshots - Thanks to HTML5 again, now you can take screenshot of a
webpage. Blind XSS detection tools have been doing this before it was
cool.
Perform Actions - You are controlling the browser,
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
|
show 5 more comments
Attacker-controlled code, which runs within the context of the web application on the client side, has full control over what the client does and can also read the DOM of the HTML page, etc.
This means it can both steal secrets which are inside this page (passwords, etc.) and also do things as logged in client (like buy something, send bomb threats in a mail client, etc.). Note that this kind of activity can often be hidden from the client so that he/she does not realize that he/she is currently attacked.
add a comment |
Maybe a real life example would help to understand how dangerous an apparently minor security flaw, like XSS, can be.
As part of a security assessment my company was tasked with trying to access the CEO personal e-mails.
I managed to get its personal e-mail address through some OSint, now one could go for a spear phishing with a custom version of one of the many info stealer malware but I prolonged the information gathering phase a little longer.
It turned out the CEO loved boats and it was selling one of theirs in a boat-selling site.
The site seems pretty amateur, I registered and fooled around a bit. And what have I found?
The site lets you manage your password prefilling a password field with the current one, spurred on by this I investigate the site a little bit more.
I came across a stored XSS vulnerability: when you answer an offer you can put arbitrary HTML code, including scripting, in it and it will be executed in the reader browser!
Seem pretty "innocuous", doesn't it? What if you combine it with the badly management of the password?
So I crafted a script that fetched the password page (it's an intra-domain request, SOP is satisfied), extracted the password and the client information (UA, OS and similar) and send it to a C&C of mine.
Then instilled a sense of urge to the CEO by carefully writing an e-mail informing them about my "intention" to buy.
After a day I received the password they used to log in the boats site.
As expected it was the same password used for their e-mail (there was no 2FA, I can't remember if it was a thing yet) and I was able to access the webmail (the client information was used to simulate a legitimate access, in case it was necessary to keep a low profile).
Long story short, an attack is not a single atomic step, it's made of little conquers. If you give your adversary room for a step, you'll never know what they can do from there.
An XSS is room for the attacker, as you have seen quite a bit of it.
add a comment |
When XSS was first becoming widely known in the web application
security community, some professional penetration testers were
inclined to regard XSS as a “lame” vulnerability
source: Web Application Hackers Handbook
XSS is a command injection of the client side, like the other user pointed out, it can result in any action that can be performed by the user. Mostly XSS is used for session hijacking where the attacker using javascript makes the victim transmit session cookies to an attacker-controlled server and from there the attacker can perform "session riding".
But XSS can also result in complete application takeover. Consider a scenario in which you inject javascript and it gets stored. The admin then loads that into a web browser (usually logs or CMS). If an XSS is present there you now have the admin session tokens. That is why XSS can be very dangerous.
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
add a comment |
An XSS attack is not a danger to the server. It's a danger to the reason you have a server. Not in a technical sense but very much a human one, as any kind of XSS attack originating from your site usually ends with your reputation down the toilet. A few test cases:
- Someone redirects from your site to a fake login page. Now you have a potential mass security breach of user accounts on your site.
- Someone puts a cryptominer on your site. This will make your visitors' machines work overtime and when spotted, makes you look either grossly greedy and/or grossly incompetent as a sysadmin. Neither of which is a good look.
- Someone redirects traffic from your site to a competitor. I shouldn't have to explain why this is bad.
- Someone puts some javascript in there that makes your site unusable or even crash browsers. Again, should be obvious why this is bad.
- Someone puts DDOS code in your site to try take down your site or a third party. If aimed at you, should be obvious why this is bad. If aimed at someone else and your site is deemed culpable, your hosting provider can cut you off if you do not fix your site for breach of contract.
- Someone replaces your ads with their own. If you rely on ad revenue, they're stealing that revenue.
- Someone uses it to snoop on your users. Hel-lo, breach of GDPR.
add a comment |
Most of the possible consequences of XSS vulnerabilities affect the user, not your server. So if you don't care about your user getting their accounts on your website compromised or your users seeing content on your website which doesn't come from your server, sure, ignore those vulnerabilities.
But if your users have admin rights, then an XSS vulnerability can easily lead to unintentional admin actions. A classic case of that is a log viewer in your admin area which isn't XSS-proof. Some javascript snippets in your access logs might get executed by your admins and perform administrative actions under their account. This is why you sometimes see javascript snippets in the HTTP headers of the bots which try to hack your website.
add a comment |
To give you a real life example where XSS was used to directly take over the server in an incident about 10 years ago (although I have forgotten the name of the (small/unimportant) website and I doubt it exists anymore):
Report to webmaster: "There is XSS vulnerability on your website. You should fix this. How should I send you the details?"
Answer of the wannabe webmaster: "Show me how you would misuse this. My server is super secure! Try it if you want but you will have no chance."
Answer of the reporter: "Then take a look at my profile page on your website."
The webmaster did this and suddenly the whole website was dead. What happened? The reporter used a XSS vulnerability to insert JavaScript code on his profile page.
The JavaScript code (running in the browser and session of the webmaster) sent requests to the server to:
- add a new account with with highest rights (for demonstration purposes)
- to rename PHP-files and SQL-tables on the server (the website had a administration section which allowed this for administration purposes like updates or installing widgets similar to many CMS-systems)
Additional damage could have been done by sending a request to the hosting company to cancel the subscription of the server and of the domain and transfer money from his banking account (provided the webmaster was logged in the hoster/domain registrar/bank and they had no CSRF-protection which wasn't that uncommon 10 years ago).
Also don't forget XSS-worms like the MySpace-worm Samy that spread over all profile pages and might DDOS your server or harm your users.
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
add a comment |
It looks like you're looking for danger to the server (including SQL etc.), not the client, so many dangers don't apply.
But there is a danger to the server from what the client is allowed to do on the server. If the client has permission to change the database, so can an attacker. And the same goes for anything a client has permission to do on the server.
add a comment |
You have from other answers a very good list of technical reasons why XSS is a problem. I will give another perspective.
XSS is a vulnerability which is quite easy to bring into your code, and is discoverable by scanners. This is probably one of the reasons why it is relatively well known to the "general public", including journalists (in the sense of "I heard about that").
If you have one publicly available, it may then be described as
Sai Kumar LLC has an extremely vulnerable site, because it has an XSS.
XSS is a Very Dangerous Vulnerability. Very. It is.
It allows all
your data to be stolen. It does. The͟ ̨da҉t͘a̵ ͢haś ̴al͞r̀ead́y
͠b̷e̷e̶n̨ s͝t͜o̢l͝e͜n. Įt̨ ̷ha̵s.
You can then do all kind of belly dancing explaining that it is not the vulnerability, the erratum will be posted in font 3 pt on page 74, grayed out.
This is why I systematically raise the CVSS of XSS findings on my public web sites (when they are revealed by a pentest, scan or other tests).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "162"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sai Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206520%2fhow-dangerous-is-xss%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
Below are the things an attacker can do if there is XSS vulnerability. Content taken from somdev blog
Ad-Jacking - If you manage to get stored XSS on a website, just
inject your ads in it to make money ;)
Click-Jacking - You can create a hidden overlay on a page to hijack clicks of the victim to perform malicious actions.
Session Hijacking - HTTP cookies can be accessed
by JavaScript if the HTTP ONLY flag is not present in the cookies.
Content Spoofing - JavaScript has full access to client side code of
a web app and hence you can use it show/modify desired content.
Credential Harvesting - The most fun part. You can use a fancy popup
to harvest credentials. WiFi firmware has been updated, re-enter your
credentials to authenticate.
Forced Downloads - So the victim isn’t
downloading your malicious flash player from absolutely-safe.com?
Don’t worry, you will have more luck trying to force a download from
the trusted website your victim is visiting.
Crypto Mining - Yes, you
can use the victim’s CPU to mine some bitcoin for you!
Bypassing CSRF
protection - You can make POST requests with JavaScript, you can
collect and submit a CSRF token with JavaScript, what else do you
need?
Keylogging - You know what this is.
Recording Audio - It
requires authorization from the user but you access victim’s
microphone. Thanks to HTML5 and JavaScript.
Taking pictures - It
requires authorization from the user but you access victim’s webcam.
Thanks to HTML5 and JavaScript.
Geo-location - It requires
authorization from the user but you access victim’s Geo-location.
Thanks to HTML5 and JavaScript. Works better with devices with GPS.
Stealing HTML5 web storage data - HTML5 introduced a new feature, web
storage. Now a website can store data in the browser for later use
and of course, JavaScript can access that storage via
window.localStorage() and window.webStorage() Browser & System
Fingerprinting - JavaScript makes it a piece of cake to find your
browser name, version, installed plugins and their versions, your
operating system, architecture, system time, language and screen
resolution.
Network Scanning - Victim’s browser can be abused to scan
ports and hosts with JavaScript.
Crashing Browsers - Yes! You can
crash browser with flooding them with….stuff.
Stealing Information -
Grab information from the webpage and send it to your server. Simple!
Redirecting - You can use javascript to redirect users to a webpage
of your choice.
Tabnapping - Just a fancy version of redirection.
For example, if no keyboard or mouse events have been received for
more than a minute, it could mean that the user is afk and you can
sneakily replace the current webpage with a fake one.
Capturing
Screenshots - Thanks to HTML5 again, now you can take screenshot of a
webpage. Blind XSS detection tools have been doing this before it was
cool.
Perform Actions - You are controlling the browser,
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
|
show 5 more comments
Below are the things an attacker can do if there is XSS vulnerability. Content taken from somdev blog
Ad-Jacking - If you manage to get stored XSS on a website, just
inject your ads in it to make money ;)
Click-Jacking - You can create a hidden overlay on a page to hijack clicks of the victim to perform malicious actions.
Session Hijacking - HTTP cookies can be accessed
by JavaScript if the HTTP ONLY flag is not present in the cookies.
Content Spoofing - JavaScript has full access to client side code of
a web app and hence you can use it show/modify desired content.
Credential Harvesting - The most fun part. You can use a fancy popup
to harvest credentials. WiFi firmware has been updated, re-enter your
credentials to authenticate.
Forced Downloads - So the victim isn’t
downloading your malicious flash player from absolutely-safe.com?
Don’t worry, you will have more luck trying to force a download from
the trusted website your victim is visiting.
Crypto Mining - Yes, you
can use the victim’s CPU to mine some bitcoin for you!
Bypassing CSRF
protection - You can make POST requests with JavaScript, you can
collect and submit a CSRF token with JavaScript, what else do you
need?
Keylogging - You know what this is.
Recording Audio - It
requires authorization from the user but you access victim’s
microphone. Thanks to HTML5 and JavaScript.
Taking pictures - It
requires authorization from the user but you access victim’s webcam.
Thanks to HTML5 and JavaScript.
Geo-location - It requires
authorization from the user but you access victim’s Geo-location.
Thanks to HTML5 and JavaScript. Works better with devices with GPS.
Stealing HTML5 web storage data - HTML5 introduced a new feature, web
storage. Now a website can store data in the browser for later use
and of course, JavaScript can access that storage via
window.localStorage() and window.webStorage() Browser & System
Fingerprinting - JavaScript makes it a piece of cake to find your
browser name, version, installed plugins and their versions, your
operating system, architecture, system time, language and screen
resolution.
Network Scanning - Victim’s browser can be abused to scan
ports and hosts with JavaScript.
Crashing Browsers - Yes! You can
crash browser with flooding them with….stuff.
Stealing Information -
Grab information from the webpage and send it to your server. Simple!
Redirecting - You can use javascript to redirect users to a webpage
of your choice.
Tabnapping - Just a fancy version of redirection.
For example, if no keyboard or mouse events have been received for
more than a minute, it could mean that the user is afk and you can
sneakily replace the current webpage with a fake one.
Capturing
Screenshots - Thanks to HTML5 again, now you can take screenshot of a
webpage. Blind XSS detection tools have been doing this before it was
cool.
Perform Actions - You are controlling the browser,
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
|
show 5 more comments
Below are the things an attacker can do if there is XSS vulnerability. Content taken from somdev blog
Ad-Jacking - If you manage to get stored XSS on a website, just
inject your ads in it to make money ;)
Click-Jacking - You can create a hidden overlay on a page to hijack clicks of the victim to perform malicious actions.
Session Hijacking - HTTP cookies can be accessed
by JavaScript if the HTTP ONLY flag is not present in the cookies.
Content Spoofing - JavaScript has full access to client side code of
a web app and hence you can use it show/modify desired content.
Credential Harvesting - The most fun part. You can use a fancy popup
to harvest credentials. WiFi firmware has been updated, re-enter your
credentials to authenticate.
Forced Downloads - So the victim isn’t
downloading your malicious flash player from absolutely-safe.com?
Don’t worry, you will have more luck trying to force a download from
the trusted website your victim is visiting.
Crypto Mining - Yes, you
can use the victim’s CPU to mine some bitcoin for you!
Bypassing CSRF
protection - You can make POST requests with JavaScript, you can
collect and submit a CSRF token with JavaScript, what else do you
need?
Keylogging - You know what this is.
Recording Audio - It
requires authorization from the user but you access victim’s
microphone. Thanks to HTML5 and JavaScript.
Taking pictures - It
requires authorization from the user but you access victim’s webcam.
Thanks to HTML5 and JavaScript.
Geo-location - It requires
authorization from the user but you access victim’s Geo-location.
Thanks to HTML5 and JavaScript. Works better with devices with GPS.
Stealing HTML5 web storage data - HTML5 introduced a new feature, web
storage. Now a website can store data in the browser for later use
and of course, JavaScript can access that storage via
window.localStorage() and window.webStorage() Browser & System
Fingerprinting - JavaScript makes it a piece of cake to find your
browser name, version, installed plugins and their versions, your
operating system, architecture, system time, language and screen
resolution.
Network Scanning - Victim’s browser can be abused to scan
ports and hosts with JavaScript.
Crashing Browsers - Yes! You can
crash browser with flooding them with….stuff.
Stealing Information -
Grab information from the webpage and send it to your server. Simple!
Redirecting - You can use javascript to redirect users to a webpage
of your choice.
Tabnapping - Just a fancy version of redirection.
For example, if no keyboard or mouse events have been received for
more than a minute, it could mean that the user is afk and you can
sneakily replace the current webpage with a fake one.
Capturing
Screenshots - Thanks to HTML5 again, now you can take screenshot of a
webpage. Blind XSS detection tools have been doing this before it was
cool.
Perform Actions - You are controlling the browser,
Below are the things an attacker can do if there is XSS vulnerability. Content taken from somdev blog
Ad-Jacking - If you manage to get stored XSS on a website, just
inject your ads in it to make money ;)
Click-Jacking - You can create a hidden overlay on a page to hijack clicks of the victim to perform malicious actions.
Session Hijacking - HTTP cookies can be accessed
by JavaScript if the HTTP ONLY flag is not present in the cookies.
Content Spoofing - JavaScript has full access to client side code of
a web app and hence you can use it show/modify desired content.
Credential Harvesting - The most fun part. You can use a fancy popup
to harvest credentials. WiFi firmware has been updated, re-enter your
credentials to authenticate.
Forced Downloads - So the victim isn’t
downloading your malicious flash player from absolutely-safe.com?
Don’t worry, you will have more luck trying to force a download from
the trusted website your victim is visiting.
Crypto Mining - Yes, you
can use the victim’s CPU to mine some bitcoin for you!
Bypassing CSRF
protection - You can make POST requests with JavaScript, you can
collect and submit a CSRF token with JavaScript, what else do you
need?
Keylogging - You know what this is.
Recording Audio - It
requires authorization from the user but you access victim’s
microphone. Thanks to HTML5 and JavaScript.
Taking pictures - It
requires authorization from the user but you access victim’s webcam.
Thanks to HTML5 and JavaScript.
Geo-location - It requires
authorization from the user but you access victim’s Geo-location.
Thanks to HTML5 and JavaScript. Works better with devices with GPS.
Stealing HTML5 web storage data - HTML5 introduced a new feature, web
storage. Now a website can store data in the browser for later use
and of course, JavaScript can access that storage via
window.localStorage() and window.webStorage() Browser & System
Fingerprinting - JavaScript makes it a piece of cake to find your
browser name, version, installed plugins and their versions, your
operating system, architecture, system time, language and screen
resolution.
Network Scanning - Victim’s browser can be abused to scan
ports and hosts with JavaScript.
Crashing Browsers - Yes! You can
crash browser with flooding them with….stuff.
Stealing Information -
Grab information from the webpage and send it to your server. Simple!
Redirecting - You can use javascript to redirect users to a webpage
of your choice.
Tabnapping - Just a fancy version of redirection.
For example, if no keyboard or mouse events have been received for
more than a minute, it could mean that the user is afk and you can
sneakily replace the current webpage with a fake one.
Capturing
Screenshots - Thanks to HTML5 again, now you can take screenshot of a
webpage. Blind XSS detection tools have been doing this before it was
cool.
Perform Actions - You are controlling the browser,
edited yesterday


Paul D. Waite
1033
1033
answered 2 days ago


GoronGoron
732110
732110
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
|
show 5 more comments
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
1
1
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
So I have one question.. Let's say a web app had an xss vulnerability, and someone had used this to exploit some other user by running some malicious js code. Let's say this code key logs and sends the key strokes to another website by making a request. Now will this malicious js code keep running as long as the browser is open or will it keep running as long as the vulnerable tab within the browser is open?
– Sai Kumar
2 days ago
2
2
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
It still depends on how the attacker program's it. basically depending on user events or triggering the code on specific time intervals.
– Goron
2 days ago
10
10
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
@SaiKumar In general, an XSS vulnerability can do anything with the client you as a website administrator can do with the client.
– Philipp
yesterday
2
2
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
For the points with "requires authorization" - it must be noted that if the user already gave that permission to the webpage, you have free rein and don't need to ask.
– John Dvorak
yesterday
2
2
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
It's worth mentioning for the entries labeled "it requires authorization from the user" - the user is likely to authorize because it's a site they trust, and the XSS on that site gets it for free if that site is already authorized. Edit: someone else already partly said this, sorry
– thomasrutter
yesterday
|
show 5 more comments
Attacker-controlled code, which runs within the context of the web application on the client side, has full control over what the client does and can also read the DOM of the HTML page, etc.
This means it can both steal secrets which are inside this page (passwords, etc.) and also do things as logged in client (like buy something, send bomb threats in a mail client, etc.). Note that this kind of activity can often be hidden from the client so that he/she does not realize that he/she is currently attacked.
add a comment |
Attacker-controlled code, which runs within the context of the web application on the client side, has full control over what the client does and can also read the DOM of the HTML page, etc.
This means it can both steal secrets which are inside this page (passwords, etc.) and also do things as logged in client (like buy something, send bomb threats in a mail client, etc.). Note that this kind of activity can often be hidden from the client so that he/she does not realize that he/she is currently attacked.
add a comment |
Attacker-controlled code, which runs within the context of the web application on the client side, has full control over what the client does and can also read the DOM of the HTML page, etc.
This means it can both steal secrets which are inside this page (passwords, etc.) and also do things as logged in client (like buy something, send bomb threats in a mail client, etc.). Note that this kind of activity can often be hidden from the client so that he/she does not realize that he/she is currently attacked.
Attacker-controlled code, which runs within the context of the web application on the client side, has full control over what the client does and can also read the DOM of the HTML page, etc.
This means it can both steal secrets which are inside this page (passwords, etc.) and also do things as logged in client (like buy something, send bomb threats in a mail client, etc.). Note that this kind of activity can often be hidden from the client so that he/she does not realize that he/she is currently attacked.
edited 15 hours ago
Peter Mortensen
71049
71049
answered Apr 1 at 4:26


Steffen UllrichSteffen Ullrich
120k15209277
120k15209277
add a comment |
add a comment |
Maybe a real life example would help to understand how dangerous an apparently minor security flaw, like XSS, can be.
As part of a security assessment my company was tasked with trying to access the CEO personal e-mails.
I managed to get its personal e-mail address through some OSint, now one could go for a spear phishing with a custom version of one of the many info stealer malware but I prolonged the information gathering phase a little longer.
It turned out the CEO loved boats and it was selling one of theirs in a boat-selling site.
The site seems pretty amateur, I registered and fooled around a bit. And what have I found?
The site lets you manage your password prefilling a password field with the current one, spurred on by this I investigate the site a little bit more.
I came across a stored XSS vulnerability: when you answer an offer you can put arbitrary HTML code, including scripting, in it and it will be executed in the reader browser!
Seem pretty "innocuous", doesn't it? What if you combine it with the badly management of the password?
So I crafted a script that fetched the password page (it's an intra-domain request, SOP is satisfied), extracted the password and the client information (UA, OS and similar) and send it to a C&C of mine.
Then instilled a sense of urge to the CEO by carefully writing an e-mail informing them about my "intention" to buy.
After a day I received the password they used to log in the boats site.
As expected it was the same password used for their e-mail (there was no 2FA, I can't remember if it was a thing yet) and I was able to access the webmail (the client information was used to simulate a legitimate access, in case it was necessary to keep a low profile).
Long story short, an attack is not a single atomic step, it's made of little conquers. If you give your adversary room for a step, you'll never know what they can do from there.
An XSS is room for the attacker, as you have seen quite a bit of it.
add a comment |
Maybe a real life example would help to understand how dangerous an apparently minor security flaw, like XSS, can be.
As part of a security assessment my company was tasked with trying to access the CEO personal e-mails.
I managed to get its personal e-mail address through some OSint, now one could go for a spear phishing with a custom version of one of the many info stealer malware but I prolonged the information gathering phase a little longer.
It turned out the CEO loved boats and it was selling one of theirs in a boat-selling site.
The site seems pretty amateur, I registered and fooled around a bit. And what have I found?
The site lets you manage your password prefilling a password field with the current one, spurred on by this I investigate the site a little bit more.
I came across a stored XSS vulnerability: when you answer an offer you can put arbitrary HTML code, including scripting, in it and it will be executed in the reader browser!
Seem pretty "innocuous", doesn't it? What if you combine it with the badly management of the password?
So I crafted a script that fetched the password page (it's an intra-domain request, SOP is satisfied), extracted the password and the client information (UA, OS and similar) and send it to a C&C of mine.
Then instilled a sense of urge to the CEO by carefully writing an e-mail informing them about my "intention" to buy.
After a day I received the password they used to log in the boats site.
As expected it was the same password used for their e-mail (there was no 2FA, I can't remember if it was a thing yet) and I was able to access the webmail (the client information was used to simulate a legitimate access, in case it was necessary to keep a low profile).
Long story short, an attack is not a single atomic step, it's made of little conquers. If you give your adversary room for a step, you'll never know what they can do from there.
An XSS is room for the attacker, as you have seen quite a bit of it.
add a comment |
Maybe a real life example would help to understand how dangerous an apparently minor security flaw, like XSS, can be.
As part of a security assessment my company was tasked with trying to access the CEO personal e-mails.
I managed to get its personal e-mail address through some OSint, now one could go for a spear phishing with a custom version of one of the many info stealer malware but I prolonged the information gathering phase a little longer.
It turned out the CEO loved boats and it was selling one of theirs in a boat-selling site.
The site seems pretty amateur, I registered and fooled around a bit. And what have I found?
The site lets you manage your password prefilling a password field with the current one, spurred on by this I investigate the site a little bit more.
I came across a stored XSS vulnerability: when you answer an offer you can put arbitrary HTML code, including scripting, in it and it will be executed in the reader browser!
Seem pretty "innocuous", doesn't it? What if you combine it with the badly management of the password?
So I crafted a script that fetched the password page (it's an intra-domain request, SOP is satisfied), extracted the password and the client information (UA, OS and similar) and send it to a C&C of mine.
Then instilled a sense of urge to the CEO by carefully writing an e-mail informing them about my "intention" to buy.
After a day I received the password they used to log in the boats site.
As expected it was the same password used for their e-mail (there was no 2FA, I can't remember if it was a thing yet) and I was able to access the webmail (the client information was used to simulate a legitimate access, in case it was necessary to keep a low profile).
Long story short, an attack is not a single atomic step, it's made of little conquers. If you give your adversary room for a step, you'll never know what they can do from there.
An XSS is room for the attacker, as you have seen quite a bit of it.
Maybe a real life example would help to understand how dangerous an apparently minor security flaw, like XSS, can be.
As part of a security assessment my company was tasked with trying to access the CEO personal e-mails.
I managed to get its personal e-mail address through some OSint, now one could go for a spear phishing with a custom version of one of the many info stealer malware but I prolonged the information gathering phase a little longer.
It turned out the CEO loved boats and it was selling one of theirs in a boat-selling site.
The site seems pretty amateur, I registered and fooled around a bit. And what have I found?
The site lets you manage your password prefilling a password field with the current one, spurred on by this I investigate the site a little bit more.
I came across a stored XSS vulnerability: when you answer an offer you can put arbitrary HTML code, including scripting, in it and it will be executed in the reader browser!
Seem pretty "innocuous", doesn't it? What if you combine it with the badly management of the password?
So I crafted a script that fetched the password page (it's an intra-domain request, SOP is satisfied), extracted the password and the client information (UA, OS and similar) and send it to a C&C of mine.
Then instilled a sense of urge to the CEO by carefully writing an e-mail informing them about my "intention" to buy.
After a day I received the password they used to log in the boats site.
As expected it was the same password used for their e-mail (there was no 2FA, I can't remember if it was a thing yet) and I was able to access the webmail (the client information was used to simulate a legitimate access, in case it was necessary to keep a low profile).
Long story short, an attack is not a single atomic step, it's made of little conquers. If you give your adversary room for a step, you'll never know what they can do from there.
An XSS is room for the attacker, as you have seen quite a bit of it.
answered yesterday


Margaret BloomMargaret Bloom
575310
575310
add a comment |
add a comment |
When XSS was first becoming widely known in the web application
security community, some professional penetration testers were
inclined to regard XSS as a “lame” vulnerability
source: Web Application Hackers Handbook
XSS is a command injection of the client side, like the other user pointed out, it can result in any action that can be performed by the user. Mostly XSS is used for session hijacking where the attacker using javascript makes the victim transmit session cookies to an attacker-controlled server and from there the attacker can perform "session riding".
But XSS can also result in complete application takeover. Consider a scenario in which you inject javascript and it gets stored. The admin then loads that into a web browser (usually logs or CMS). If an XSS is present there you now have the admin session tokens. That is why XSS can be very dangerous.
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
add a comment |
When XSS was first becoming widely known in the web application
security community, some professional penetration testers were
inclined to regard XSS as a “lame” vulnerability
source: Web Application Hackers Handbook
XSS is a command injection of the client side, like the other user pointed out, it can result in any action that can be performed by the user. Mostly XSS is used for session hijacking where the attacker using javascript makes the victim transmit session cookies to an attacker-controlled server and from there the attacker can perform "session riding".
But XSS can also result in complete application takeover. Consider a scenario in which you inject javascript and it gets stored. The admin then loads that into a web browser (usually logs or CMS). If an XSS is present there you now have the admin session tokens. That is why XSS can be very dangerous.
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
add a comment |
When XSS was first becoming widely known in the web application
security community, some professional penetration testers were
inclined to regard XSS as a “lame” vulnerability
source: Web Application Hackers Handbook
XSS is a command injection of the client side, like the other user pointed out, it can result in any action that can be performed by the user. Mostly XSS is used for session hijacking where the attacker using javascript makes the victim transmit session cookies to an attacker-controlled server and from there the attacker can perform "session riding".
But XSS can also result in complete application takeover. Consider a scenario in which you inject javascript and it gets stored. The admin then loads that into a web browser (usually logs or CMS). If an XSS is present there you now have the admin session tokens. That is why XSS can be very dangerous.
When XSS was first becoming widely known in the web application
security community, some professional penetration testers were
inclined to regard XSS as a “lame” vulnerability
source: Web Application Hackers Handbook
XSS is a command injection of the client side, like the other user pointed out, it can result in any action that can be performed by the user. Mostly XSS is used for session hijacking where the attacker using javascript makes the victim transmit session cookies to an attacker-controlled server and from there the attacker can perform "session riding".
But XSS can also result in complete application takeover. Consider a scenario in which you inject javascript and it gets stored. The admin then loads that into a web browser (usually logs or CMS). If an XSS is present there you now have the admin session tokens. That is why XSS can be very dangerous.
edited 2 days ago
schroeder♦
78.7k30175211
78.7k30175211
answered 2 days ago


Vipul NairVipul Nair
18412
18412
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
add a comment |
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
1
1
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Not just stored XSS but what if you send a malicious URL to the admin? The same threat applies.
– schroeder♦
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
Absolutely.I didnt write it because i only wanted to add what steffen wrote.
– Vipul Nair
2 days ago
add a comment |
An XSS attack is not a danger to the server. It's a danger to the reason you have a server. Not in a technical sense but very much a human one, as any kind of XSS attack originating from your site usually ends with your reputation down the toilet. A few test cases:
- Someone redirects from your site to a fake login page. Now you have a potential mass security breach of user accounts on your site.
- Someone puts a cryptominer on your site. This will make your visitors' machines work overtime and when spotted, makes you look either grossly greedy and/or grossly incompetent as a sysadmin. Neither of which is a good look.
- Someone redirects traffic from your site to a competitor. I shouldn't have to explain why this is bad.
- Someone puts some javascript in there that makes your site unusable or even crash browsers. Again, should be obvious why this is bad.
- Someone puts DDOS code in your site to try take down your site or a third party. If aimed at you, should be obvious why this is bad. If aimed at someone else and your site is deemed culpable, your hosting provider can cut you off if you do not fix your site for breach of contract.
- Someone replaces your ads with their own. If you rely on ad revenue, they're stealing that revenue.
- Someone uses it to snoop on your users. Hel-lo, breach of GDPR.
add a comment |
An XSS attack is not a danger to the server. It's a danger to the reason you have a server. Not in a technical sense but very much a human one, as any kind of XSS attack originating from your site usually ends with your reputation down the toilet. A few test cases:
- Someone redirects from your site to a fake login page. Now you have a potential mass security breach of user accounts on your site.
- Someone puts a cryptominer on your site. This will make your visitors' machines work overtime and when spotted, makes you look either grossly greedy and/or grossly incompetent as a sysadmin. Neither of which is a good look.
- Someone redirects traffic from your site to a competitor. I shouldn't have to explain why this is bad.
- Someone puts some javascript in there that makes your site unusable or even crash browsers. Again, should be obvious why this is bad.
- Someone puts DDOS code in your site to try take down your site or a third party. If aimed at you, should be obvious why this is bad. If aimed at someone else and your site is deemed culpable, your hosting provider can cut you off if you do not fix your site for breach of contract.
- Someone replaces your ads with their own. If you rely on ad revenue, they're stealing that revenue.
- Someone uses it to snoop on your users. Hel-lo, breach of GDPR.
add a comment |
An XSS attack is not a danger to the server. It's a danger to the reason you have a server. Not in a technical sense but very much a human one, as any kind of XSS attack originating from your site usually ends with your reputation down the toilet. A few test cases:
- Someone redirects from your site to a fake login page. Now you have a potential mass security breach of user accounts on your site.
- Someone puts a cryptominer on your site. This will make your visitors' machines work overtime and when spotted, makes you look either grossly greedy and/or grossly incompetent as a sysadmin. Neither of which is a good look.
- Someone redirects traffic from your site to a competitor. I shouldn't have to explain why this is bad.
- Someone puts some javascript in there that makes your site unusable or even crash browsers. Again, should be obvious why this is bad.
- Someone puts DDOS code in your site to try take down your site or a third party. If aimed at you, should be obvious why this is bad. If aimed at someone else and your site is deemed culpable, your hosting provider can cut you off if you do not fix your site for breach of contract.
- Someone replaces your ads with their own. If you rely on ad revenue, they're stealing that revenue.
- Someone uses it to snoop on your users. Hel-lo, breach of GDPR.
An XSS attack is not a danger to the server. It's a danger to the reason you have a server. Not in a technical sense but very much a human one, as any kind of XSS attack originating from your site usually ends with your reputation down the toilet. A few test cases:
- Someone redirects from your site to a fake login page. Now you have a potential mass security breach of user accounts on your site.
- Someone puts a cryptominer on your site. This will make your visitors' machines work overtime and when spotted, makes you look either grossly greedy and/or grossly incompetent as a sysadmin. Neither of which is a good look.
- Someone redirects traffic from your site to a competitor. I shouldn't have to explain why this is bad.
- Someone puts some javascript in there that makes your site unusable or even crash browsers. Again, should be obvious why this is bad.
- Someone puts DDOS code in your site to try take down your site or a third party. If aimed at you, should be obvious why this is bad. If aimed at someone else and your site is deemed culpable, your hosting provider can cut you off if you do not fix your site for breach of contract.
- Someone replaces your ads with their own. If you rely on ad revenue, they're stealing that revenue.
- Someone uses it to snoop on your users. Hel-lo, breach of GDPR.
answered 2 days ago
520520
48724
48724
add a comment |
add a comment |
Most of the possible consequences of XSS vulnerabilities affect the user, not your server. So if you don't care about your user getting their accounts on your website compromised or your users seeing content on your website which doesn't come from your server, sure, ignore those vulnerabilities.
But if your users have admin rights, then an XSS vulnerability can easily lead to unintentional admin actions. A classic case of that is a log viewer in your admin area which isn't XSS-proof. Some javascript snippets in your access logs might get executed by your admins and perform administrative actions under their account. This is why you sometimes see javascript snippets in the HTTP headers of the bots which try to hack your website.
add a comment |
Most of the possible consequences of XSS vulnerabilities affect the user, not your server. So if you don't care about your user getting their accounts on your website compromised or your users seeing content on your website which doesn't come from your server, sure, ignore those vulnerabilities.
But if your users have admin rights, then an XSS vulnerability can easily lead to unintentional admin actions. A classic case of that is a log viewer in your admin area which isn't XSS-proof. Some javascript snippets in your access logs might get executed by your admins and perform administrative actions under their account. This is why you sometimes see javascript snippets in the HTTP headers of the bots which try to hack your website.
add a comment |
Most of the possible consequences of XSS vulnerabilities affect the user, not your server. So if you don't care about your user getting their accounts on your website compromised or your users seeing content on your website which doesn't come from your server, sure, ignore those vulnerabilities.
But if your users have admin rights, then an XSS vulnerability can easily lead to unintentional admin actions. A classic case of that is a log viewer in your admin area which isn't XSS-proof. Some javascript snippets in your access logs might get executed by your admins and perform administrative actions under their account. This is why you sometimes see javascript snippets in the HTTP headers of the bots which try to hack your website.
Most of the possible consequences of XSS vulnerabilities affect the user, not your server. So if you don't care about your user getting their accounts on your website compromised or your users seeing content on your website which doesn't come from your server, sure, ignore those vulnerabilities.
But if your users have admin rights, then an XSS vulnerability can easily lead to unintentional admin actions. A classic case of that is a log viewer in your admin area which isn't XSS-proof. Some javascript snippets in your access logs might get executed by your admins and perform administrative actions under their account. This is why you sometimes see javascript snippets in the HTTP headers of the bots which try to hack your website.
answered 2 days ago
PhilippPhilipp
44.9k7115142
44.9k7115142
add a comment |
add a comment |
To give you a real life example where XSS was used to directly take over the server in an incident about 10 years ago (although I have forgotten the name of the (small/unimportant) website and I doubt it exists anymore):
Report to webmaster: "There is XSS vulnerability on your website. You should fix this. How should I send you the details?"
Answer of the wannabe webmaster: "Show me how you would misuse this. My server is super secure! Try it if you want but you will have no chance."
Answer of the reporter: "Then take a look at my profile page on your website."
The webmaster did this and suddenly the whole website was dead. What happened? The reporter used a XSS vulnerability to insert JavaScript code on his profile page.
The JavaScript code (running in the browser and session of the webmaster) sent requests to the server to:
- add a new account with with highest rights (for demonstration purposes)
- to rename PHP-files and SQL-tables on the server (the website had a administration section which allowed this for administration purposes like updates or installing widgets similar to many CMS-systems)
Additional damage could have been done by sending a request to the hosting company to cancel the subscription of the server and of the domain and transfer money from his banking account (provided the webmaster was logged in the hoster/domain registrar/bank and they had no CSRF-protection which wasn't that uncommon 10 years ago).
Also don't forget XSS-worms like the MySpace-worm Samy that spread over all profile pages and might DDOS your server or harm your users.
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
add a comment |
To give you a real life example where XSS was used to directly take over the server in an incident about 10 years ago (although I have forgotten the name of the (small/unimportant) website and I doubt it exists anymore):
Report to webmaster: "There is XSS vulnerability on your website. You should fix this. How should I send you the details?"
Answer of the wannabe webmaster: "Show me how you would misuse this. My server is super secure! Try it if you want but you will have no chance."
Answer of the reporter: "Then take a look at my profile page on your website."
The webmaster did this and suddenly the whole website was dead. What happened? The reporter used a XSS vulnerability to insert JavaScript code on his profile page.
The JavaScript code (running in the browser and session of the webmaster) sent requests to the server to:
- add a new account with with highest rights (for demonstration purposes)
- to rename PHP-files and SQL-tables on the server (the website had a administration section which allowed this for administration purposes like updates or installing widgets similar to many CMS-systems)
Additional damage could have been done by sending a request to the hosting company to cancel the subscription of the server and of the domain and transfer money from his banking account (provided the webmaster was logged in the hoster/domain registrar/bank and they had no CSRF-protection which wasn't that uncommon 10 years ago).
Also don't forget XSS-worms like the MySpace-worm Samy that spread over all profile pages and might DDOS your server or harm your users.
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
add a comment |
To give you a real life example where XSS was used to directly take over the server in an incident about 10 years ago (although I have forgotten the name of the (small/unimportant) website and I doubt it exists anymore):
Report to webmaster: "There is XSS vulnerability on your website. You should fix this. How should I send you the details?"
Answer of the wannabe webmaster: "Show me how you would misuse this. My server is super secure! Try it if you want but you will have no chance."
Answer of the reporter: "Then take a look at my profile page on your website."
The webmaster did this and suddenly the whole website was dead. What happened? The reporter used a XSS vulnerability to insert JavaScript code on his profile page.
The JavaScript code (running in the browser and session of the webmaster) sent requests to the server to:
- add a new account with with highest rights (for demonstration purposes)
- to rename PHP-files and SQL-tables on the server (the website had a administration section which allowed this for administration purposes like updates or installing widgets similar to many CMS-systems)
Additional damage could have been done by sending a request to the hosting company to cancel the subscription of the server and of the domain and transfer money from his banking account (provided the webmaster was logged in the hoster/domain registrar/bank and they had no CSRF-protection which wasn't that uncommon 10 years ago).
Also don't forget XSS-worms like the MySpace-worm Samy that spread over all profile pages and might DDOS your server or harm your users.
To give you a real life example where XSS was used to directly take over the server in an incident about 10 years ago (although I have forgotten the name of the (small/unimportant) website and I doubt it exists anymore):
Report to webmaster: "There is XSS vulnerability on your website. You should fix this. How should I send you the details?"
Answer of the wannabe webmaster: "Show me how you would misuse this. My server is super secure! Try it if you want but you will have no chance."
Answer of the reporter: "Then take a look at my profile page on your website."
The webmaster did this and suddenly the whole website was dead. What happened? The reporter used a XSS vulnerability to insert JavaScript code on his profile page.
The JavaScript code (running in the browser and session of the webmaster) sent requests to the server to:
- add a new account with with highest rights (for demonstration purposes)
- to rename PHP-files and SQL-tables on the server (the website had a administration section which allowed this for administration purposes like updates or installing widgets similar to many CMS-systems)
Additional damage could have been done by sending a request to the hosting company to cancel the subscription of the server and of the domain and transfer money from his banking account (provided the webmaster was logged in the hoster/domain registrar/bank and they had no CSRF-protection which wasn't that uncommon 10 years ago).
Also don't forget XSS-worms like the MySpace-worm Samy that spread over all profile pages and might DDOS your server or harm your users.
answered yesterday
H. IddenH. Idden
2,7741715
2,7741715
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
add a comment |
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
Thank you. I now clearly understood how can xss be used to break a website. But how do you rename the php files and sql tables on the server? can javascript be used to rename a file sitting on the server? and what if the file was not within the same directory as the webpage? and can we run sql queries using javascript?
– Sai Kumar
yesterday
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
The Website had a web administration tool similar to phpMyAdmin which allows editing SQL tables and PHP files with a web gui instead of needing SSH or similar. The JavaScript sent a request similar as the one that tool would do. What files are in danger depends on the capabilities, security and permissions of the administration tool.
– H. Idden
21 hours ago
add a comment |
It looks like you're looking for danger to the server (including SQL etc.), not the client, so many dangers don't apply.
But there is a danger to the server from what the client is allowed to do on the server. If the client has permission to change the database, so can an attacker. And the same goes for anything a client has permission to do on the server.
add a comment |
It looks like you're looking for danger to the server (including SQL etc.), not the client, so many dangers don't apply.
But there is a danger to the server from what the client is allowed to do on the server. If the client has permission to change the database, so can an attacker. And the same goes for anything a client has permission to do on the server.
add a comment |
It looks like you're looking for danger to the server (including SQL etc.), not the client, so many dangers don't apply.
But there is a danger to the server from what the client is allowed to do on the server. If the client has permission to change the database, so can an attacker. And the same goes for anything a client has permission to do on the server.
It looks like you're looking for danger to the server (including SQL etc.), not the client, so many dangers don't apply.
But there is a danger to the server from what the client is allowed to do on the server. If the client has permission to change the database, so can an attacker. And the same goes for anything a client has permission to do on the server.
edited 2 days ago
answered 2 days ago
User42User42
1974
1974
add a comment |
add a comment |
You have from other answers a very good list of technical reasons why XSS is a problem. I will give another perspective.
XSS is a vulnerability which is quite easy to bring into your code, and is discoverable by scanners. This is probably one of the reasons why it is relatively well known to the "general public", including journalists (in the sense of "I heard about that").
If you have one publicly available, it may then be described as
Sai Kumar LLC has an extremely vulnerable site, because it has an XSS.
XSS is a Very Dangerous Vulnerability. Very. It is.
It allows all
your data to be stolen. It does. The͟ ̨da҉t͘a̵ ͢haś ̴al͞r̀ead́y
͠b̷e̷e̶n̨ s͝t͜o̢l͝e͜n. Įt̨ ̷ha̵s.
You can then do all kind of belly dancing explaining that it is not the vulnerability, the erratum will be posted in font 3 pt on page 74, grayed out.
This is why I systematically raise the CVSS of XSS findings on my public web sites (when they are revealed by a pentest, scan or other tests).
add a comment |
You have from other answers a very good list of technical reasons why XSS is a problem. I will give another perspective.
XSS is a vulnerability which is quite easy to bring into your code, and is discoverable by scanners. This is probably one of the reasons why it is relatively well known to the "general public", including journalists (in the sense of "I heard about that").
If you have one publicly available, it may then be described as
Sai Kumar LLC has an extremely vulnerable site, because it has an XSS.
XSS is a Very Dangerous Vulnerability. Very. It is.
It allows all
your data to be stolen. It does. The͟ ̨da҉t͘a̵ ͢haś ̴al͞r̀ead́y
͠b̷e̷e̶n̨ s͝t͜o̢l͝e͜n. Įt̨ ̷ha̵s.
You can then do all kind of belly dancing explaining that it is not the vulnerability, the erratum will be posted in font 3 pt on page 74, grayed out.
This is why I systematically raise the CVSS of XSS findings on my public web sites (when they are revealed by a pentest, scan or other tests).
add a comment |
You have from other answers a very good list of technical reasons why XSS is a problem. I will give another perspective.
XSS is a vulnerability which is quite easy to bring into your code, and is discoverable by scanners. This is probably one of the reasons why it is relatively well known to the "general public", including journalists (in the sense of "I heard about that").
If you have one publicly available, it may then be described as
Sai Kumar LLC has an extremely vulnerable site, because it has an XSS.
XSS is a Very Dangerous Vulnerability. Very. It is.
It allows all
your data to be stolen. It does. The͟ ̨da҉t͘a̵ ͢haś ̴al͞r̀ead́y
͠b̷e̷e̶n̨ s͝t͜o̢l͝e͜n. Įt̨ ̷ha̵s.
You can then do all kind of belly dancing explaining that it is not the vulnerability, the erratum will be posted in font 3 pt on page 74, grayed out.
This is why I systematically raise the CVSS of XSS findings on my public web sites (when they are revealed by a pentest, scan or other tests).
You have from other answers a very good list of technical reasons why XSS is a problem. I will give another perspective.
XSS is a vulnerability which is quite easy to bring into your code, and is discoverable by scanners. This is probably one of the reasons why it is relatively well known to the "general public", including journalists (in the sense of "I heard about that").
If you have one publicly available, it may then be described as
Sai Kumar LLC has an extremely vulnerable site, because it has an XSS.
XSS is a Very Dangerous Vulnerability. Very. It is.
It allows all
your data to be stolen. It does. The͟ ̨da҉t͘a̵ ͢haś ̴al͞r̀ead́y
͠b̷e̷e̶n̨ s͝t͜o̢l͝e͜n. Įt̨ ̷ha̵s.
You can then do all kind of belly dancing explaining that it is not the vulnerability, the erratum will be posted in font 3 pt on page 74, grayed out.
This is why I systematically raise the CVSS of XSS findings on my public web sites (when they are revealed by a pentest, scan or other tests).
answered 13 hours ago
WoJWoJ
7,20512544
7,20512544
add a comment |
add a comment |
Sai Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Sai Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Sai Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Sai Kumar is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Information Security Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206520%2fhow-dangerous-is-xss%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
8
It's as dangerous as a friend lying to you on your face about pretty important stuff. In above analogy friend is genuine web application and face is it User Interface.
– user101
2 days ago
14
What you seem to be missing is that it's dangerous to your user more than to your server.
– jpmc26
2 days ago
8
But you are aware that it is dangerous to clients, right?
– schroeder♦
2 days ago
49
It's about 12 dangerous.
– Paul D. Waite
yesterday
2
Imagine you steal an admin's session, and take control of the server if this admin has these privileges.
– Accountant م
13 hours ago