Friday, November 22, 2024
HomeCross site ScriptingOAuth Vulnerability Exposes 1 Million Websites To XSS Attacks

OAuth Vulnerability Exposes 1 Million Websites To XSS Attacks

Published on

Despite robust defenses, Cross-Site Scripting (XSS) remains a persistent web vulnerability, as its exploitation has become increasingly challenging.

A recent discovery highlights how integrating OAuth, a modern authentication standard, with vulnerable websites can resurrect XSS risks. 

By manipulating OAuth flows and leveraging existing XSS flaws, attackers can potentially compromise sensitive data and execute malicious actions, bypassing traditional protections and enabling account takeover on millions of websites. 

- Advertisement - SIEM as a Service

XSS, a longstanding web vulnerability, permits attackers to inject malicious scripts into legitimate web pages, tricking users into executing them.

How to Build a Security Framework With Limited Resources IT Security Team (PDF) - Free Guide

While traditional XSS defenses like input validation and output encoding have mitigated many risks, the evolution of web applications and the increasing reliance on OAuth for authentication have introduced new attack vectors. 

By leveraging XSS vulnerabilities, attackers can potentially steal OAuth tokens, granting them unauthorized access to user accounts and sensitive data across multiple platforms. 

A vulnerable website that echoes user input creates an XSS vulnerability. By injecting malicious HTML/JS disguised as user input, attackers can execute arbitrary code in the victim’s browser. 

It can be used for simple attacks like displaying an alert box, but it gets serious when the target site stores sensitive information like cookies.

A crafted XSS attack can steal these cookies, granting the attacker access to the victim’s account (full takeover) if the cookies contain authentication credentials. 

Developers can implement several strategies to prevent XSS attacks. Manual input sanitization and output encoding require developers to ensure user input isn’t interpreted as malicious code. 

Modern web frameworks provide automatic escaping to prevent embedded values from being executed. The HTTP-Only attribute protects cookies from being accessed by client-side scripts. 

reverse strategy of searching for “Sources”

Content Security Policy (CSP) allows administrators to specify trusted sources for content, blocking malicious scripts.

While these methods are essential, they are not foolproof, and attackers may still find ways to bypass them.  

Salt Security describes a security vulnerability in Hotjar, a web analytics tool, which uses a parameter called “next” in the URL to redirect users.

The attacker can exploit this vulnerability by inserting malicious code into the “next” parameter and have the browser redirect the user. 

HotJar censors data

They found this vulnerability by searching for sources of user input in the Hotjar JavaScript code and then debugging the code to see how it is processed.

An attacker exploited an XSS vulnerability on a website using OAuth for social login. The website’s cookies were protected with the HTTP-Only flag, making them inaccessible to JavaScript. 

However, the attacker leveraged the fact that the OAuth token was included in the URL after a successful login.

Malicious JavaScript code initiated a new OAuth login in a separate window, and then the token was read from the URL fragment of that window. 

This stolen token allowed the attacker to take over the victim’s account and potentially access sensitive information like recordings of user activity, including keyboard strokes and mouse movements.

Are you from SOC and DFIR Teams? – Analyse Malware Incidents & get live Access with ANY.RUN -> Free Access

Latest articles

Halo Security Launches Slack Integration for Real-Time Alerts on New Assets and Vulnerabilities

Halo Security, a leader in external attack surface management and penetration testing, has announced...

Researchers Detailed FrostyGoop Malware Attacking ICS Devices

FrostyGoop, a newly discovered OT-centric malware that exploited Modbus TCP to disrupt critical infrastructure...

5 Hackers Charged for Attacking Companies via Phishing Text Messages

Federal authorities have unsealed charges against five individuals accused of orchestrating sophisticated phishing schemes...

Two PyPi Malicious Package Mimic ChatGPT & Claude Steals Developers Data

Two malicious Python packages masquerading as tools for interacting with popular AI models ChatGPT...

Free Webinar

Protect Websites & APIs from Malware Attack

Malware targeting customer-facing websites and API applications poses significant risks, including compliance violations, defacements, and even blacklisting.

Join us for an insightful webinar featuring Vivek Gopalan, VP of Products at Indusface, as he shares effective strategies for safeguarding websites and APIs against malware.

Discussion points

Scan DOM, internal links, and JavaScript libraries for hidden malware.
Detect website defacements in real time.
Protect your brand by monitoring for potential blacklisting.
Prevent malware from infiltrating your server and cloud infrastructure.

More like this

Researchers Detailed FrostyGoop Malware Attacking ICS Devices

FrostyGoop, a newly discovered OT-centric malware that exploited Modbus TCP to disrupt critical infrastructure...

5 Hackers Charged for Attacking Companies via Phishing Text Messages

Federal authorities have unsealed charges against five individuals accused of orchestrating sophisticated phishing schemes...

Two PyPi Malicious Package Mimic ChatGPT & Claude Steals Developers Data

Two malicious Python packages masquerading as tools for interacting with popular AI models ChatGPT...