How a simple IDOR become a $4K User Impersonation vulnerability
The support request endpoint accepted a userid parameter that could be changed to another user's ID, allowing an attacker to submit support requests on behalf of that user. This could let the attacker request password resets or internal information through the support channel.
Published on shahmeeramir.com
Busy with my Masters these days, so i write whenever i can. Be sure to comment below about did you like this article or not.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a business logic vulnerability found in a private HackerOne program earlier in 2017. The researcher refers to the target as vulntome.com to protect the program's privacy. The affected feature is the application's support request form, which lets a user submit a ticket to the support team, for example to reset a password or ask about login problems.
The core idea behind business logic bugs, as the author puts it, is that you abuse the way an application handles requests and responses rather than a memory-safety or injection flaw. Here the abuse led to user impersonation in support requests.

The screenshot is captioned User impersonation and sits at the start of the write-up, framing the whole finding.
Setup
The researcher tested the support page in two states: logged out and logged in. Two observations came out of that:
- The support page requires an email address if you are logged in.
- The support page does not ask for the email address if you are not logged in.
For the exploitation phase the author created two accounts, each with a unique user id, and used Burp to intercept and modify the support request. The logged-in request shown below carries a Firefox 44 user agent on Windows, so the testing was done in a normal browser session with an intercepting proxy.
Finding it
The next step was to compare the request sent inside a session with the one sent without a session.
Request without session
POST /custom_api/send_support_request HTTP/1.1
Host: vulntome.com
{"SuppliedEmail":"","SuppliedName":"","SuppliedPhone":"","Description":"\"Hello","Subject":"Technical Support > Login/Password > Resetting my password","AuxiliaryData":{"email":[redacted],"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}}
Request within session
POST /custom_api/send_support_request HTTP/1.1
Host: vulntome.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-CSRFToken: [redacted]
X-AJAXToken: [redacted]
X-PAGEUrl: https://vulntome.com/public/#/contact-support
X-Requested-With: XMLHttpRequest
Referer: https://vulntome.com/public/
Content-Length: 338
Cookie: [redacted]
Connection: keep-alive
{"SuppliedEmail":"","SuppliedName":"","SuppliedPhone":"","Description":"\"Hello","Subject":"Technical Support > Login/Password > Resetting my password","AuxiliaryData":{"userid":431212,"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}}
Comparing the two bodies, the difference is a single field inside AuxiliaryData: the logged-in request carries "userid":431212, while the anonymous request has no userid at all and instead carries an email value. The author's reasoning is that when a user is not logged in or has no account, the support request can be sent for any email address, and that is by design. But when a user is logged in and the userid can be changed to that of another user, there is a potential chance to request support on behalf of that other user.
Exploitation
Step 1: Create two accounts
The author created two accounts, both with unique user ids, so that one could be used as the attacker and the other as the victim.
Step 2: Open the support page and request a password reset
While logged in, the researcher went to the support page and submitted a support request for a password reset. This is the request that carries the userid field shown above.
Step 3: Intercept and change the userid
The request was intercepted with Burp and the userid value was changed to the id of the second account. The field to modify sits in the JSON body:
"AuxiliaryData":{"userid":431212,"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}
Step 4: The request is accepted on behalf of the second account
With the modified id, the support request could be made on behalf of the second account.
Root cause
The support endpoint trusts a client-supplied userid inside AuxiliaryData to decide whose account the ticket belongs to. The request carries a cookie and CSRF/AJAX tokens, but the userid in the body could still be changed to another user's id. The CSRF token and the AJAX token protect against cross-site request forgery, not against a logged-in user editing their own request body, so they do not stop this. The anonymous path is legitimate by design: without a session there is no user to attribute the ticket to, so an email address is accepted instead.
Impact
The author lists the following scenarios:
- The attacker requests internal information from support to another communication channel.
- The attacker requests a password change from the support page by manipulating the id.
- The attacker could potentially perform any malicious task on behalf of the other user.
The author lists scenarios such as requesting internal information or a password change on behalf of the other user. The author reported the flaw to the program, which acknowledged it, fixed it quickly and rewarded $4250.

The second screenshot is captioned Bounty and shows the reward for the report.
The author closes by noting that this bounty is equivalent to what an RCE earns in some conditions, which he uses to argue that business logic flaws, with the right reporting skill and methodology, can also win big.
Fix
The report does not describe the fix that was applied, only that the program fixed it quickly.
Variants to test
- Look for identity fields in request bodies (
userid,userId,account_id,customer_id) on endpoints that create tickets, orders or notifications, and swap them between two accounts you control. A positive result is the resulting object being attributed to the second account. - Compare the same endpoint with and without a session. Fields that only appear when logged in are the ones the server may be trusting from the client.
- Test support or contact forms that accept an email address when anonymous and a numeric id when authenticated; try supplying the victim's id while authenticated as yourself.
- Check whether CSRF and AJAX tokens are the only protection on the endpoint. If they are present but the body is still trusted, the identity check is likely missing.
What happened, in plain words
A security researcher found a way to send support tickets to a company's help desk while pretending to be a different customer. The company ran a bug bounty program on HackerOne, a platform where organisations invite researchers to test their systems and pay for the problems they find. The program was private, so the researcher hides its real name and calls the website vulntome.com throughout. The finding was made earlier in 2017 and paid $4250.
The feature involved is the support request form: the page where a logged-in customer types a message to the support team, for example to say "I forgot my password" or "I cannot log in". Normally the website knows who you are because you are logged in, and it attaches your account to the ticket. The researcher discovered that by editing the account number sent with the ticket, he could file it as somebody else. By editing that number in the request before it left the browser, he could file a ticket as somebody else. That is called user impersonation: acting as another user without their password.
The class of bug is called IDOR, short for Insecure Direct Object Reference. The idea is simple: a website hands you a reference to something (here, a user id, a number that identifies an account) and trusts you to send back the same one. If it never checks that the reference belongs to you, you can swap in somebody else's. A everyday comparison: a cloakroom gives you ticket number 42 for your coat. If the attendant hands out any coat whose ticket you name, and never checks that ticket 42 is really yours, you can ask for coat 17 and walk away with a stranger's coat. The number is the reference; the missing check is the flaw.
The author also calls this a business logic vulnerability. That means the bug is not in the code crashing or in a technical injection; it is in the rules of how the application is supposed to behave. The application follows the instructions in the request too literally, without asking whether the person sending them is allowed to give those instructions.

The screenshot is captioned User impersonation and appears at the start of the write-up, framing the whole finding.
The setup: two states of the same page
Before touching anything, the researcher looked at the support page in two situations: while logged out (no account, or not signed in) and while logged in. He noticed two things:
- The support page requires an email address if you are logged in.
- The support page does not ask for the email address if you are not logged in.
That difference is the clue. If the page behaves differently depending on whether you are signed in, the requests it sends to the server probably differ too, and the difference is where the interesting data lives. So the next step was to capture the request the browser sends in each case and compare them.
To capture and edit requests, the researcher used Burp, short for Burp Suite, a tool that sits between your browser and the website like a recording postbox. Your browser posts a letter (the request), Burp opens it, lets you read and rewrite it, then forwards it to the server. The server's reply comes back through Burp too. This is how you see what a web page really sends, which the browser normally hides from you.
For the exploitation phase he created two accounts, each with its own unique user id, so that one could play the attacker and the other the victim. The logged-in request shown below carries a Firefox 44 user agent on Windows, which tells us the testing was done in an ordinary browser session with Burp in the middle.
Finding it: comparing the two requests
A request is the message your browser sends to a server. It has a first line saying what it wants (here, POST, meaning "here is some data for you"), a path saying where (/custom_api/send_support_request), and then a set of headers, which are labelled lines of extra information, followed by a body, the actual data. An API is simply a set of addresses on a server that programs (including web pages) talk to, rather than pages meant for humans to read. /custom_api/... is one of those addresses.
Request without session
POST /custom_api/send_support_request HTTP/1.1
Host: vulntome.com
{"SuppliedEmail":"","SuppliedName":"","SuppliedPhone":"","Description":"\"Hello","Subject":"Technical Support > Login/Password > Resetting my password","AuxiliaryData":{"email":[redacted],"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}}
Line by line:
POST /custom_api/send_support_request HTTP/1.1says: send data to this address, using version 1.1 of the HTTP protocol (the language browsers and servers speak).Host: vulntome.comsays which website the request is for. One server can host many sites, so it needs to know which one.- The blank line separates the headers from the body.
- The body is JSON, a text format for structured data: curly braces hold named fields, each written as
"name":value. It is the format most web apps use to exchange data. SuppliedEmail,SuppliedName,SuppliedPhoneare empty here: the form fields the visitor would fill in.Descriptionholds the message text, here justHello.Subjectsays what the ticket is about: resetting a password.AuxiliaryDatais a nested group of extra fields. Inside it,emailis the address the ticket is about,attachmentsis an empty list,uniqueIdis a random-looking identifier for this submission,consoleRolesaysPrimary Admin, andrequestedContactMethodsays the reply should come by email.
Notice what is missing: there is no userid. When nobody is logged in, the server has no account to attach the ticket to, so the email address in the body is what identifies the customer. That is by design: anyone can write to support on behalf of any email address, just as anyone can send an email to a company.
Request within session
POST /custom_api/send_support_request HTTP/1.1
Host: vulntome.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-CSRFToken: [redacted]
X-AJAXToken: [redacted]
X-PAGEUrl: https://vulntome.com/public/#/contact-support
X-Requested-With: XMLHttpRequest
Referer: https://vulntome.com/public/
Content-Length: 338
Cookie: [redacted]
Connection: keep-alive
{"SuppliedEmail":"","SuppliedName":"","SuppliedPhone":"","Description":"\"Hello","Subject":"Technical Support > Login/Password > Resetting my password","AuxiliaryData":{"userid":431212,"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}}
Line by line:
- The first line and
Hostare the same as before: same address, same site. User-Agenttells the server which browser and operating system sent the request. Here it is Firefox 44 on 64-bit Windows.Accept,Accept-Language,Accept-Encodingsay what kinds of replies the browser can handle and in which language, and that it can accept compressed responses.Content-Typesays the body is form-encoded data. (The body shown is JSON, but this is what the header says.)X-CSRFTokenandX-AJAXTokenare two security tokens. A token is a long random string the site gives your browser and expects back on each request, so that a different website cannot forge requests in your name. CSRF stands for Cross-Site Request Forgery: tricking your browser into sending a request you did not intend. The values are redacted here because they are secret to that session.X-PAGEUrlsays which page of the site the request came from.X-Requested-With: XMLHttpRequestmarks the request as one made by the page's own JavaScript rather than by typing a URL in the address bar.Referersays which page linked to this request.Content-Length: 338is the size of the body in bytes.Cookiecarries the session cookie, the small piece of data your browser stores after you log in so the server can recognise you on the next request. It is redacted because it is the equivalent of your logged-in badge.Connection: keep-aliveasks the server to keep the network connection open for further requests.- The body is the same JSON as before, with one difference: inside
AuxiliaryDatathere is now"userid":431212and noemailfield.
So the difference between the two bodies is a single field inside AuxiliaryData: the logged-in request carries "userid":431212, while the anonymous request has no userid at all and instead carries an email value. The author's reasoning is that when a user is not logged in or has no account, the support request can be sent for any email address, and that is by design. But when a user is logged in and the userid can be changed to that of another user, there is a potential chance to request support on behalf of that other user.
Exploitation: four steps
Step 1: Create two accounts
The author created two accounts, both with unique user ids, so that one could be used as the attacker and the other as the victim. You need two because you cannot prove you can act as somebody else unless you have somebody else to act as, and you need to know both ids to swap them.
Step 2: Open the support page and request a password reset
While logged in, the researcher went to the support page and submitted a support request for a password reset. This is the request that carries the userid field shown above. The reason for choosing a password reset is that it is a realistic, harmless-looking action: support staff are used to handling it, and if the ticket is attributed to the wrong account, the consequences are serious.
Step 3: Intercept and change the userid
The request was intercepted with Burp and the userid value was changed to the id of the second account. The field to modify sits in the JSON body:
"AuxiliaryData":{"userid":431212,"attachments":[],"uniqueId":"a389da21-683b-498e-853f-b571d69c2741","consoleRole":"Primary Admin","requestedContactMethod":"email"}
This is the same fragment of the body as before, with userid set to 431212. In Burp you would select that number in the intercepted request and type the victim's id in its place, then forward the request. The rest of the body, including the uniqueId and the tokens in the headers, stays as the browser sent it.
Step 4: The request is accepted on behalf of the second account
With the modified id, the support request could be made on behalf of the second account.
Why it worked
The support endpoint trusts a client-supplied userid inside AuxiliaryData to decide whose account the ticket belongs to. "Client-supplied" means the value comes from the browser, and the browser is under the user's control: anything it sends can be edited. The request carries a cookie and CSRF/AJAX tokens, but the userid in the body could still be changed to another user's id. The CSRF token and the AJAX token protect against cross-site request forgery, not against a logged-in user editing their own request body, so they do not stop this. The anonymous path is legitimate by design: without a session there is no user to attribute the ticket to, so an email address is accepted instead.
What an attacker could do with it
The author lists the following scenarios:
- The attacker requests internal information from support to another communication channel.
- The attacker requests a password change from the support page by manipulating the id.
- The attacker could potentially perform any malicious task on behalf of the other user.
The author lists scenarios such as requesting internal information or a password change on behalf of the other user. Support staff are the weak point here: they see a ticket that appears to come from a real customer and act on it in good faith. The author reported the flaw to the program, which acknowledged it, fixed it quickly and rewarded $4250.

The second screenshot is captioned Bounty and shows the reward for the report.
The author closes by noting that this bounty is equivalent to what an RCE earns in some conditions. RCE stands for Remote Code Execution, the ability to run your own commands on somebody else's server, usually considered the most severe kind of bug. His point is that business logic flaws, with the right reporting skill and methodology, can also win big.
How it should be fixed
The report does not describe the fix that was applied, only that the program fixed it quickly. In everyday terms: the cloakroom should look at your ticket and your face, not just at the number you say.
Other places to look for the same mistake
- Look for identity fields in request bodies (
userid,userId,account_id,customer_id) on endpoints that create tickets, orders or notifications, and swap them between two accounts you control. A positive result is the resulting object being attributed to the second account. - Compare the same endpoint with and without a session. Fields that only appear when logged in are the ones the server may be trusting from the client.
- Test support or contact forms that accept an email address when anonymous and a numeric id when authenticated; try supplying the victim's id while authenticated as yourself.
- Check whether CSRF and AJAX tokens are the only protection on the endpoint. If they are present but the body is still trusted, the identity check is likely missing.
Glossary
- API: a set of addresses on a server that programs talk to, rather than pages meant for people to read.
- Body: the part of a request that carries the actual data, after the headers.
- Bug bounty program: an arrangement where an organisation invites researchers to test its systems and pays for valid problems found.
- Burp (Burp Suite): a tool that sits between your browser and a website, letting you read and edit requests before they are sent.
- Business logic vulnerability: a flaw in the rules of how an application behaves, rather than in its code crashing or being injected into.
- Cookie: a small piece of data your browser stores and sends back on each request, used here to recognise your logged-in session.
- CSRF (Cross-Site Request Forgery): tricking a logged-in user's browser into sending a request the user did not intend; CSRF tokens are the defence.
- CSRF token: a random value the site gives your browser and expects back, so another site cannot forge requests in your name.
- Endpoint: a specific address on a server that accepts requests, such as
/custom_api/send_support_request. - Headers: labelled lines of extra information sent with a request, such as the browser type or the cookie.
- HackerOne: a platform where organisations run bug bounty programs and researchers submit reports.
- HTTP: the language browsers and servers use to exchange requests and responses.
- IDOR (Insecure Direct Object Reference): a flaw where a site accepts a reference to an object (such as a user id) from the user without checking that the object belongs to them.
- Impersonation: acting as another user without their credentials.
- JSON: a text format for structured data, using curly braces and
"name":valuepairs. - RCE (Remote Code Execution): the ability to run your own commands on somebody else's server, usually the most severe kind of bug.
- Request: the message a browser sends to a server asking for something or submitting data.
- Session: the server's record of who is logged in, kept alive by a cookie sent with each request.
- Token: a long random string used to prove something, such as that a request came from the site's own page.
- User id: a number that identifies an account on the site.
- User-Agent: a header saying which browser and operating system sent the request.
- Vulnerability: a weakness in a system that can be abused to do something the owner did not intend.