This website uses cookies

To provide the highest level of service we use cookies on this site.
Your continued use of the site means that you agree to their use in accordance with our terms and conditions.

Pentest Chronicles

1-Click Account Takeover via Trusted Email and XSS Chain

Robert Kruczek

August 19, 2026

During a recent penetration test, we discovered an interesting vulnerability chain that perfectly illustrates why seemingly harmless issues, when combined, can lead to critical system compromises. The tested application was vulnerable to Reflected Cross-Site Scripting. While XSS is a well-known vector for unauthorized operations or account hijacking, the real danger emerged when we chained it with a Link Manipulation flaw in the application's auto-login feature.

This combination allowed us to craft a 1-click Account Takeover exploit delivered directly through the application's official, highly trusted e-mail address.

Here is how we put the pieces together. The Foundation: Reflected XSS (SECURITUM-XYZ-001) The initial finding was a standard Reflected XSS vulnerability present in multiple endpoints of the application. We identified that the application failed to properly sanitize user input in several areas, including the login form, reset password form, and invoice payment endpoints.

A particularly interesting example was found in the password reset form, where the payload was stored inside a base64-encoded placeholder parameter.

By sending a crafted GET request, we could inject arbitrary attributes into an input tag. The raw, base64-decoded version of our payload looked like this: Decoded value: When the application responded, the malicious content was injected directly into the HTML body: While demonstrating the XSS was straightforward, the classic prerequisite applied: the victim had to click a malicious link sent by the attacker. We needed a better delivery mechanism.

The Delivery Mechanism: Link Manipulation (SECURITUM-XYZ-003) Our focus shifted to the application's "AutoLogin Link" functionality, designed to allow users to log in seamlessly via an auto-login e-mail.

We discovered that the application did not correctly validate the URL to which a user was being redirected after clicking the autologin link. Specifically, an attacker could generate a autologin link request for a valid victim's e-mail while simultaneously manipulating the returnUrl parameter.

We intercepted the POST /index.php?option=com_xyz&task=sendAutoLogin request and injected our previously discovered XSS payload into the returnUrl. The application accepted this without any validation, returning a success message.

The Exploit Chain: Turning a AutoLogin Link into ATO With both vulnerabilities identified, the attack scenario unfolded beautifully.

1. The Trap is Set: The attacker requests a AutoLogin Link for the victim's email address by sending a POST request to the /index.php?option=com_xyz&task=sendAutoLogin endpoint. They embed the XSS payload in the returnUrl parameter, but with a crucial modification: a URL-encoded hash character (%23) is appended at the end of the payload. 2. The Trusted Delivery: The application processes the request and sends an e-mail to the victim. Because the e-mail originates from the company's verified, legitimate address, it effortlessly bypasses spam filters and earns the victim's trust. 3. The Click: The victim clicks the "Click here to login" button inside the e-mail.

4. The Redirection and Execution: The link initially points to a tracking domain (redacted_xyz.com), which then issues an HTTP/2 302 Found redirect. The victim is immediately redirected to the infected endpoint containing our XSS payload.

This is where the final, critical piece of the puzzle fell into place. Normally, when the autologin link redirects the user, the application appends a sensitive authentication token directly to the query string via the h parameter (e.g., &h=token_value...). This triggers a server-side auto-login, consuming the token and logging the user in.

However, because we injected the # character into our returnUrl payload, the redirection URL was altered. The application blindly appended the token after our injected hash, resulting in a URL that looked like this: #&h=token_value....

This seemingly minor manipulation achieved two critical goals:

• It completely blocked the server-side auto-login process because everything after the # fragment is not sent to the server. This kept the user stranded on our XSS-vulnerable password reset page.

• It forced the highly sensitive authentication token (h) to be stored directly in the browser's DOM (location.hash), making it accessible to client-side scripts.

Because our Reflected XSS payload was executing in this exact context, we simply crafted a JavaScript snippet designed to read the token from the URL fragment and exfiltrate it to our server: Impact: By clicking a single link in a highly trusted, official e-mail, the victim unknowingly executes JavaScript. The attacker's clever use of the # character traps the authentication token in the browser long enough for the XSS payload to steal it from the address bar. This results in an immediate, stealthy 1-click Account Takeover. Remediation To prevent this chain of vulnerabilities, the application must implement defense-in-depth:

• Validate Redirects: Ensure strict validation of all data received from the user, especially redirect URLs. Implement a strict whitelist approach to reject values that are inconsistent with expected templates or formats.

• Context-Aware Output Encoding: All user-supplied data must be properly encoded on the output in relation to the context in which it is embedded (HTML body, attributes, JavaScript, etc.). This should be applied uniformly across the entire application. Developers should verify if the application's framework has built-in functions that implement these recommendations automatically.





Next Pentest Chronicles

When Usernames Become Passwords: A Real-World Case Study of Weak Password Practices

Michał WNękowicz

9 June 2023

In today's world, ensuring the security of our accounts is more crucial than ever. Just as keys protect the doors to our homes, passwords serve as the first line of defense for our data and assets. It's easy to assume that technical individuals, such as developers and IT professionals, always use strong, unique passwords to keep ...

SOCMINT – or rather OSINT of social media

Tomasz Turba

October 15 2022

SOCMINT is the process of gathering and analyzing the information collected from various social networks, channels and communication groups in order to track down an object, gather as much partial data as possible, and potentially to understand its operation. All this in order to analyze the collected information and to achieve that goal by making …

PyScript – or rather Python in your browser + what can be done with it?

michał bentkowski

10 september 2022

PyScript – or rather Python in your browser + what can be done with it? A few days ago, the Anaconda project announced the PyScript framework, which allows Python code to be executed directly in the browser. Additionally, it also covers its integration with HTML and JS code. An execution of the Python code in …

Any questions?

Happy to get a call or email
and help!