Single endpoint race conditions
Last updated
Last updated
This lab's email change feature contains a race condition that enables you to associate an arbitrary email address with your account.
Someone with the address carlos@ginandjuice.shop
has a pending invite to be an administrator for the site, but they have not yet created an account. Therefore, any user who successfully claims this address will automatically inherit admin privileges.
To solve the lab:
Identify a race condition that lets you claim an arbitrary email address.
Change your email address to carlos@ginandjuice.shop
.
Access the admin panel.
Delete the user carlos
You can log in to your own account with the following credentials: wiener:peter
.
You also have access to an email client, where you can view all emails sent to @exploit-<YOUR-EXPLOIT-SERVER-ID>.exploit-server.net
addresses.
Upon logging into the system, I directed my attention to the update email functionality located at /my-account
. My initial objective was to scrutinize this feature for any anomalous behavior that could potentially lead to a vulnerability.
To begin, I created a tab group comprising 10 requests, each with a unique email address, and executed them sequentially (send group in sequence): ![[Pasted image 20240501181824.png]]
Upon inspecting the email server, I observed that only the validation link for the last email address was valid, indicating that only one email address was being stored. Suspecting a race condition, I modified the sending method to parallel. This adjustment revealed inconsistent recipient addresses on the mail server, suggesting the presence of a race window:
Subsequently, I devised a new tab group containing only two POST requests targeting /my-account/change-email
. The first request utilized a dummy email address similar to those used previously (dummy@@exploit-0ace009a049b8b1183fee65a013a0016.exploit-server.net
), while the second request employed the email address carlos@ginandjuice.shop
. By sending these requests in parallel and monitoring the mail server, I received a confirmation link associated with the address carlos@ginandjuice.shop
.
Clicking on this link and refreshing the homepage granted access to the admin panel. I then proceeded to delete the "carlos" user, thereby successfully completing the lab.