Blind XSS to Account Takeover?

8 min readMay 16, 2024


Hi Everyone, I want to share my recent finding on medium for all the bug bounty hunters and penetration testers. Before we jump into the juicy stuff, beginners go through the following piece of Information.

Open Redirect: An attacker can construct a URL within the vulnerable web application that causes a redirection to an arbitrary external domain i.e. Malicious web application like

Blind XSS: B-XSS is a sub-type of stored/persistent cross-site scripting where the web application stores the payload sent by an attacker and only executes it later — at a different time or in a different place, possibly even in another web application.

CSRF: A cross site request forgery attack allows an attacker to perform an action on behalf of the user which they do not intend to.

Keeping the program While exploring the web application, I like to keep my burp-suite running so I can collect all the traffic for future analysis.

After exploring for a while, I noticed a request with a RedirectUrl parameter and I started my hunt for Open Redirect. I started passing different host names like to the parameter and waited for the response. The input was being reflected in the response like,

I quickly logged into my account but I was not redirected to /app/ nor getting a 404 Not Found error. Instead I was on the path

So after going through a bunch of JavaScript, I learnt how the parameter worked. On login if a user has inject a custom URL in the RedirectUrl parameter, the value gets replaced by /app/workspaces. It was like a prevention.

After login if a user clicks on the link again, they would still be redirected to /app/workspaces. So I gave up on Open Redirect and started looking for Reflected-XSS on the parameter. I supplied a bunch of HTML and JavaScript payloads like <script> and <img> tags but I was only getting reflection in the path of URL.

To break out of the URL I decided to do something smart for once. I supplied an Additional parameter to the URL like<img src=x onerror=alert(1)>

It escaped the Parameter and was now part of the Web page. I usually hunt for XSS in burp suite repeater so on seeing my payload being reflected back to me, I quickly copied the URL to see my popup and to my surprise I had no pop up.

P.S. my session had run out and the repeater was being treated like an Unauthenticated user.

I was logged into my account and the RedirectUrl was being defaulted to /app/workspace. I tried the payload on a different browser with different account but still got the same response. I logged out of my account and then pasted the URL and to my surprise it worked.<img src=x onerror=alert(1)>

I was happy with the alert popup but I quickly realized that it was just a P3 Reflected-XSS that had very low impact. I kept trying to execute the payload while the user was logged in but I had no luck with it.

Just to make sure, I executed alert(document.cookie) payload and though it worked the main session handling cookie was invalidated when a user was logged out and had an HTTPOnly flag set. This flag is used to prevent vulnerabilities like XSS from stealing session cookies. So I reported the Reflected XSS as it is with some not so convincing impact like taking control of the page of the user, manipulating JavaScript etc.

I kept looking for ways to exploit the user and that’s when I noticed something weird. I saw in the JavaScript that the web application had hardcoded a User’s CSRF Token.

let Email = $('#Email').val();
let Password = $('#Password').val();
const CsrfToken = '1_v7chmmhxvdd3cy0';

I quickly logged into my account to find out that my token had stayed the same. I realized that I could steal this token using my XSS. So I started doing a bunch of stuff like calling the parameter using DOM while taking help from ChatGPT, but I was missing an easy exploit in the process.

After working my brain for hours, it decided to remind me of Blind XSS.


Yes, I could inject my Blind XSS payload in order to steal the user’s CSRF Token. I crafted my payload and sent to my other browser in a private window.

a good sign

I checked my bxss dashboard and the payload had successfully fired. I had user’s cookies and their CSRF Token. I was very happy with the results. I had already seen how the Token was being used throughout the web app, and I knew what functionalities I wanted to target.

a good sign
  1. Privilege Escalation:

To achieve escalation I needed details, some really important details.

The request to change a user’s permissions from Low to High looked like this:

POST /internal_api/app.php?UserId=992117 HTTP/2
Cookie: <cookies>
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 913
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers

Id%22%3A%22992123%22%2C%22FirstName\22%3A%22Lov%22%2C%22LastName\22%3A%22Priv$22%2C%22Email%22%3A%22porakas314%40 Is Admin\22%3Afalse%2C%22LimitedUser Permissions 22%3A%5B%7B%22ServiceName÷22%3A%22A11Deletions%22%2C%22ISA llowed%22%3Atrue%7D%5D%2C%22BlockExports%22%3Afalse%2C%22Other User Contact Permissions%22%3A%5B%7B%22 User Id%22%3A%22992117%22 $2C%22Access%22%3A%22None%22%7D%5D%2C%22Contact Permissions%22%3A%5B%7B%22 User Id%22%3A%22992117%22%2C%22Access 22%3A%22Write $22%7D%5D%2C%22Other UserCalendar Permissions%22%3A%5B%7B%22 User Id%22%3A%22992117%22%2C%22Access 22%3A%22None%22%7D%5D%2C%22C
alendar Permissions%22%3A%5B%7B%22UserId%22%3A%22992117%22%2C%22Access 22%3A%22Write%22%7D%5D%2C%22SelectedUsers%22%3A%5B%5D
$2C%22UserFilter%22%3A%22%22%2C%22AccessLevel%22%3A%22Write%22%7D&Function-AdminUpdate User &VersionNumber=|essionTimeout%22%3A10080%2C%22DateCreated%22%3A%222024-05-02T05%3A21%3A08-04%3A00%22%2C%22DateArchived%22%3Anull%2C%22IsAdmin%22%3Atrue%2C%22IsOwner%22%3Atrue%2C%22BlockExports%22%3Afalse%2C%22LimitedUs

Let me decode it for better understanding, I needed the following parameters and their values in order to increase my permissions:

ExpectedUserId: This parameter contained the UserId of the user updating my permissions, so in our case Admin’s UserId.
UserId: UserId of the Low Privileged user whose permissions are being updated.
Email Address: Email Address of the Low Privileged user.
Token: This parameter was responsible for protecting users from CSRF attacks.

Apart from all the parameters, I needed to be part of the Victim portal.

Now that would require further Privileges and User Interaction which could drastically reduce the severity of my bug.

I was not happy with that, so I decided to go with the other Exploit i.e. change the password of the Admin.

2. Change Password:

So on this particular web app, I got lucky. How? The developers were too confident in their CSRF protection, they implemented Change Password functionality like below:

no password confirmation or old password required

I started crafting my malicious HTTP request and I needed the following parameters in order to make my CSRF PoC work.

POST /internal_api/app.php?BatchRequest=true&UserId=992117 HTTP/2
Cookie: cookies
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers


Just like in the Priv Escalation, I needed the following parameters and their values in order to make my exploit work.

ExpectedUserId: This parameter contained the UserId of the Admin
UserId: UserId of the Admin.
Email Address: Email Address of the Admin.
Token: CSRF Token of the Admin.

I had access to the Admin CSRF Token and I can get the email address by doing some social engineering. How do I get the UserId?
That’s when I noticed something I had received from the Blind XSS exploit.

A CloudFront Policy cookie!

Base64 Encoded cookie

Now how is this helpful in getting UserId? I decoded the cookie and It contained the URL to the Company logo set by the client. The URL structure was something like this,

It belonged to the User who first made the Account so technically it was our Admin UserId.

P.S. If I had stolen cookies of non admin users like developers, they would still have the same URL as the Devs of the vulnerable web app designed a security policy for the S3 bucket content, which is why every user had access to their admin UserId.

Now we have a UserId, Email Address, a CSRF Token, and Motive. We just needed to exploit our User. But before we crafted our PoC, there was a tiny little problem. Our request is a POST based request, now CSRF poc usually work the best with GET based HTTP request. So I simply changed the request method using Burp suite, and generated my CSRF PoC.

I was exhausted

I quickly made a new account and started my attack flow:

  1. Let the user login once, we assume the admin is using their usual browser.
  2. Logout or make them logout, Logout CSRF are out of scope and usually working on every website. I included it in the report just in case devs decided to outplay me. [If not logged out, send URL]
  3. Send the Blind XSS payload to steal the UserId cookie and CSRF Token.
  4. Craft our malicious HTTP request to perform CSRF.
  5. Serve the request and login as victim.

I had successfully changed the admin password. The reason why I chose change password had one more reason. The web application would sent an email to the admin whenever a user’s permissions were changed, but when a Admin changes their password no Email notifications were sent. This made my attack sneaky. I was very happy with what I had found and I sent over 4 reports and 5 video PoCs to demonstrate my attack.

intial response

I was disappointed to my core. I wrote a big paragraph on why the $100 reward was too low and how long it took me to put all the pieces together. Their second response was:

they just ignored the severity

I sent another huge paragraph explaining why I was asking for so much. They stopped replying to my emails, I waited for 7 days and couldn’t wait any longer. I sent them my PayPal address and they just sent the money without communicating at all.

Regardless, super proud of my finding. Hope this article helps other hackers and hunters.






[] I hack stuff and talk about it. Open to collaborating on Cool Cyber Security projects. Exploring Mobile Pentesting