IDOR on remoing Share
The wallet sharing deletion endpoint lacked server-side authorisation checks, allowing any user with access to a wallet to delete other users' shares. An attacker could remove other users from a shared wallet without being the owner.
- Triaged in 25 hours
- Fixed in 10 days
- Paid in 10 days
- Disclosed after 3 months
Issue
In case of Operator Wallets, only Owner has the permission to delete share with any user. But It is possible for any user to delete share for any other user.
POC
-
Suppose a wallet
BITCOINSis created by user A and shared with user B and C. -
User B can send the following request and delete User C as there are no server side verifications
POST /dashboard/account/<accountID>/sharing/delete HTTP/1.1 Host: wallet.romit.io User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0 Accept: / 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 Referer: https://wallet.romit.io/dashboard Content-Length: 90 Cookie: <redatcted> Connection: keep-alive Pragma: no-cache Cache-Control: no-cache
bankUserId=<User C's ID>&_csrf=3b919c4a-776f-4144-84b7-88d315f57815
Solution Verify that the user who is deleting the user is actually an owner for that wallet.
Thanks Sparsh
Context
The target is the wallet application at wallet.romit.io, a product that lets users create wallets and share them with other users. The report focuses on Operator Wallets, where a wallet has an Owner and can be shared with additional users. Sharing is managed from the dashboard, and the delete action for a share is a form-encoded POST to the account's sharing endpoint.
According to the report, only the Owner is supposed to have permission to delete a share with any user. The feature normally lets the owner revoke another user's access to the wallet.
Setup
Two conditions are needed to reproduce the issue:
- A wallet, referred to in the report as
BITCOINS, created by user A and shared with user B and user C. - A session as user B, a non-owner who has been granted access to that wallet.
The request is sent from the dashboard with the browser's own headers, including the X-Requested-With: XMLHttpRequest header and a CSRF token in the body, so the attacker is acting as a legitimate logged-in user of the application.
Finding it
The report states that any user can delete a share for any other user, although only the Owner should have that permission. The permission model says only Owner may delete a share, but the server accepts the delete request from any user who has been shared the wallet. The report attributes this to the absence of server-side verification: the application does not check that the user performing the deletion is the owner of the wallet.
Exploitation
Step 1: Establish the sharing arrangement
A wallet BITCOINS is created by user A and shared with user B and user C. User B therefore has access to the wallet but is not its owner.
Step 2: Delete another user's share as a non-owner
User B sends the following request, which removes user C from the wallet:
POST /dashboard/account/<accountID>/sharing/delete HTTP/1.1
Host: wallet.romit.io
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: */*
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
Referer: https://wallet.romit.io/dashboard
Content-Length: 90
Cookie: <redatcted>
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
bankUserId=<User C's ID>&_csrf=3b919c4a-776f-4144-84b7-88d315f57815
The important parts are:
- The path
/dashboard/account/<accountID>/sharing/deleteidentifies the wallet's account and the delete-share action. The account ID is placed in the URL, while the target user is identified by thebankUserIdbody parameter. bankUserId=<User C's ID>selects the share to remove. Because the value is supplied by the client, user B can name user C even though user B is not the owner._csrf=3b919c4a-776f-4144-84b7-88d315f57815is the CSRF token from user B's own session, so the request is a valid, authenticated action rather than a cross-site forgery.- The
Cookieheader carries user B's session. The report redacts its value.
The report presents the request as deleting user C, attributing this to the absence of server-side verifications. It does not include the response body or status code.
Root cause
The report attributes the issue to the absence of server-side verifications: the server does not check that the user deleting the share is an owner of the wallet. The request carries a session cookie and a CSRF token, but the report says the server does not verify that the caller is an owner of the wallet. The report's own diagnosis is that there are no server-side verifications, and its proposed solution is to verify that the user deleting the share is actually an owner of that wallet.
Impact
Any user with whom a wallet has been shared can remove other users from that wallet, even though only the owner should be able to do so. In the reported scenario, user B removes user C from user A's wallet. The report does not describe any further consequence, such as loss of funds or access to wallet contents, and does not state whether the removed user can be re-added or whether the owner is notified.
Fix
The report recommends verifying that the user performing the deletion is an owner of the wallet before the share is removed. The report does not state whether or how the issue was fixed.
Variants to test
- Change
bankUserIdto another user's identifier while authenticated as a non-owner. A positive result is that the other user's share disappears from the wallet. - Change the
<accountID>in the path to a wallet the attacker does not own. A positive result is that a share on someone else's wallet is modified. - Apply the same pattern to other sharing actions, such as adding a user or changing a role, if such endpoints exist. A positive result is that a non-owner can change the wallet's sharing configuration.
- Replay the request with the CSRF token and session of a different account to confirm the check is on the session, not on a value in the body.
Hunting notes
This kind of bug tends to appear wherever a resource is shared between users and the action on a share is addressed by a client-supplied user identifier. The signal during recon is a sharing or permissions feature with separate owner and member roles, and requests whose body names the target user directly. The report illustrates the issue with a minimal, concrete scenario: two shared users, one request from the non-owner, and the removal of the other user.
What happened, in plain words
A website called wallet.romit.io lets people create digital wallets and share them with other people. Think of it like a shared bank account: one person owns it and can invite others to look at it or use it. The owner is the only one who is supposed to be able to remove someone from the shared wallet.
The report says the rule was not enforced by the server. Any person the wallet had been shared with could send a request that removed a different person from the wallet, even though they were not the owner. The report attributes the issue to the absence of server-side verifications.
This kind of mistake is called an IDOR, short for Insecure Direct Object Reference. In plain terms, it means the website lets you name an object (here, another user's share) directly in a request, and it does not check whether you are allowed to touch that object. It is like a hotel where any guest can walk up to the front desk, say "cancel room 204 for Mr Smith", and the receptionist does it without asking who you are.
The product and the feature
The target is the wallet application at wallet.romit.io. Users can create wallets and share them with other users. The report focuses on Operator Wallets, a type of wallet that has an Owner and can be shared with additional users. Sharing is managed from the dashboard, a web page where the logged-in user sees their wallets and their settings.
When the owner wants to remove someone from a wallet, the dashboard sends a request to a sharing endpoint. An endpoint is simply a specific address on the server that performs one action, like a counter in a shop that handles one kind of transaction. The delete action for a share is a form-encoded POST to the account's sharing endpoint. "Form-encoded" means the data is sent in the same simple name=value&name=value format a browser uses when you submit a normal HTML form.
According to the report, only the Owner is supposed to have permission to delete a share with any user. The feature normally lets the owner revoke another user's access to the wallet.
Setting up the test
Two conditions are needed to reproduce the issue:
- A wallet, referred to in the report as
BITCOINS, created by user A and shared with user B and user C. - A session as user B, a non-owner who has been granted access to that wallet.
A session is how a website remembers that you are logged in. After you sign in, the server gives your browser a small piece of data (usually stored in a cookie) and your browser sends it back with every request. It is like a wristband at an event: the staff gave it to you when you showed your ticket, and from then on they just check the wristband instead of asking for your ticket again.
The request is sent from the dashboard with the browser's own headers, including the X-Requested-With: XMLHttpRequest header and a CSRF token in the body, so the attacker is acting as a legitimate logged-in user of the application. A header is extra information attached to a request, like the label on a parcel that says what is inside and where it came from. CSRF stands for Cross-Site Request Forgery: a protection where the server puts a secret value (the CSRF token) into the page, and the browser must send that value back with any action request. It proves the request came from the real page and not from a malicious site that tricked your browser.
Finding it
The report states that any user can delete a share for any other user, although only the Owner should have that permission. The permission model says only Owner may delete a share, but the server accepts the delete request from any user who has been shared the wallet. The report attributes this to the absence of server-side verification: the application does not check that the user performing the deletion is the owner of the wallet.
"Server-side verification" means the check happens on the server, the computer that holds the data, rather than only in the browser. A check that only happens in the browser is like a shop that puts a "staff only" sign on a door but never locks it: anyone who ignores the sign can walk in. The server must do the checking, because the browser belongs to the user and can be made to send anything.
Exploitation
Step 1: Establish the sharing arrangement
A wallet BITCOINS is created by user A and shared with user B and user C. User B therefore has access to the wallet but is not its owner. This step matters because it recreates the normal, legitimate situation in which the bug appears: a wallet with one owner and two people it has been shared with.
Step 2: Delete another user's share as a non-owner
User B sends the following request, which removes user C from the wallet:
POST /dashboard/account/<accountID>/sharing/delete HTTP/1.1
Host: wallet.romit.io
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: */*
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
Referer: https://wallet.romit.io/dashboard
Content-Length: 90
Cookie: <redatcted>
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
bankUserId=<User C's ID>&_csrf=3b919c4a-776f-4144-84b7-88d315f57815
Line by line, in plain words:
POST /dashboard/account/<accountID>/sharing/delete HTTP/1.1is the request line.POSTis the method used when you are sending data that changes something on the server, as opposed to just asking to view a page. The path/dashboard/account/<accountID>/sharing/deleteis the address of the action: it points at the dashboard, then at a specific account (the wallet), then at the sharing feature, then at the delete action.<accountID>is a placeholder for the wallet's identifier.Host: wallet.romit.iotells the server which website the request is for. One server can host many sites, so this is how it knows which one you mean.User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0identifies the browser and operating system that sent the request. Here it says the request came from Firefox on Ubuntu Linux.Accept: */*says the browser will accept any kind of response.Accept-Language: en-US,en;q=0.5says the browser prefers English (US) content.Accept-Encoding: gzip, deflatesays the browser can accept compressed responses, which saves bandwidth.Content-Type: application/x-www-form-urlencoded; charset=UTF-8says the body of the request is in the simple form format, with UTF-8 text encoding.X-Requested-With: XMLHttpRequestis a header that browsers add when a page uses JavaScript to send a request in the background instead of loading a new page. It is a hint that the request came from the application's own code.Referer: https://wallet.romit.io/dashboardsays which page the request was sent from, here the dashboard.Content-Length: 90says the body is 90 bytes long.Cookie: <redatcted>carries the session cookie that identifies user B. The report hides its value, which is the right thing to do because anyone holding that value could act as user B.Connection: keep-aliveasks the server to keep the network connection open for further requests.Pragma: no-cacheandCache-Control: no-cacheask that the request and response not be stored in a cache.- The blank line separates the headers from the body.
bankUserId=<User C's ID>&_csrf=3b919c4a-776f-4144-84b7-88d315f57815is the body. It has two fields joined by&.bankUserIdnames the user whose share should be deleted, here user C._csrfis the CSRF token from user B's own session.
The important parts are:
- The path
/dashboard/account/<accountID>/sharing/deleteidentifies the wallet's account and the delete-share action. The account ID is placed in the URL, while the target user is identified by thebankUserIdbody parameter. A parameter is a named value in a request, like a field on a form. bankUserId=<User C's ID>selects the share to remove. Because the value is supplied by the client, user B can name user C even though user B is not the owner. The client is the browser, which the user controls, so anything it sends can be changed._csrf=3b919c4a-776f-4144-84b7-88d315f57815is the CSRF token from user B's own session, so the request is a valid, authenticated action rather than a cross-site forgery. In other words, the request is not an attack from an outside site; it is user B genuinely asking the server to do this.- The
Cookieheader carries user B's session. The report redacts its value.
The report presents the request as deleting user C, attributing this to the absence of server-side verifications. It does not include the response body or status code.
Root cause
The report attributes the issue to the absence of server-side verifications: the server does not check that the user deleting the share is an owner of the wallet. The request carries a session cookie and a CSRF token, but the report says the server does not verify that the caller is an owner of the wallet.
These two words are easy to mix up. Authentication answers "who are you?", like showing your passport at the airport. Authorisation answers "what are you allowed to do?", like the boarding pass that says which seat and which flight you may use. Here the server checked the passport but never looked at the boarding pass. The report's own diagnosis is that there are no server-side verifications, and its proposed solution is to verify that the user deleting the share is actually an owner of that wallet.
Impact
Any user with whom a wallet has been shared can remove other users from that wallet, even though only the owner should be able to do so. In the reported scenario, user B removes user C from user A's wallet. The report does not describe any further consequence, such as loss of funds or access to wallet contents, and does not state whether the removed user can be re-added or whether the owner is notified.
Fix
The report recommends verifying that the user performing the deletion is an owner of the wallet before the share is removed. The report does not state whether or how the issue was fixed.
Variants to test
These are follow-up checks in the same spirit, to see whether the same gap exists elsewhere:
- Change
bankUserIdto another user's identifier while authenticated as a non-owner. A positive result is that the other user's share disappears from the wallet. - Change the
<accountID>in the path to a wallet the attacker does not own. A positive result is that a share on someone else's wallet is modified. - Apply the same pattern to other sharing actions, such as adding a user or changing a role, if such endpoints exist. A positive result is that a non-owner can change the wallet's sharing configuration.
- Replay the request with the CSRF token and session of a different account to confirm the check is on the session, not on a value in the body. Replaying means sending the same request again, possibly with small changes, to see how the server reacts.
Hunting notes
This kind of bug tends to appear wherever a resource is shared between users and the action on a share is addressed by a client-supplied user identifier. The signal during recon is a sharing or permissions feature with separate owner and member roles, and requests whose body names the target user directly. Recon means the early exploration of a site to understand what it does and where the interesting features are. The report illustrates the issue with a minimal, concrete scenario: two shared users, one request from the non-owner, and the removal of the other user.
Glossary
- API: a way for one piece of software to talk to another by sending requests to specific addresses and getting structured answers back.
- Authentication: the process of proving who you are, usually by logging in.
- Authorisation: the process of deciding what a proven user is allowed to do.
- Body: the part of a request that carries the actual data, separate from the headers.
- Client: the software on the user's side, usually the browser, which sends requests to the server.
- Cookie: a small piece of data a website stores in your browser and your browser sends back with each request, often used to keep you logged in.
- CSRF (Cross-Site Request Forgery): an attack where a malicious site makes your browser send an unwanted action to another site; a CSRF token is a secret value that prevents it.
- CSRF token: a secret value placed in a page and required in action requests, proving the request came from the real page.
- Endpoint: a specific address on a server that performs one action.
- Form-encoded: a request format where data is sent as
name=valuepairs joined by&, like a submitted HTML form. - Header: extra information attached to a request or response, such as the browser type or the content format.
- IDOR (Insecure Direct Object Reference): a flaw where a request names an object directly and the server does not check that the user is allowed to access it.
- Impact: the real-world effect of a vulnerability, such as who can do what to whom.
- Parameter: a named value in a request, like a field on a form.
- Permission model: the set of rules describing which roles may perform which actions.
- POST: an HTTP method used to send data that changes something on the server.
- Recon: the early exploration of a target to understand its features and find interesting areas.
- Replay: sending the same request again, sometimes with small changes, to observe the server's behaviour.
- Root cause: the underlying reason a vulnerability exists, as opposed to its visible symptom.
- Server: the computer that stores the data and runs the application, answering requests from clients.
- Server-side verification: a check performed on the server, which the user cannot bypass by changing their browser.
- Session: the server's record that you are logged in, usually tied to a cookie.
- Status code: a number in a response saying how the request went, such as success or not found.
- Vulnerability: a weakness in software that allows someone to do something they should not be able to do.