Skip to content
Access control Write-up Beginner

P2 Broken Access Control Allowing Unauthorized Account Email Modification and Account Takeover

The application's account update endpoint accepts a user-supplied account identifier and does not verify that the authenticated user owns the targeted account. An attacker with a low-privileged account could change another user's registered email address, potentially leading to account takeover via password reset.

akashmotkar001 Follow

Published on medium.com

Bug Bounty

Akash motkar, on medium.com

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is an application's account management functionality, specifically the part that lets an authenticated user change the email address registered to their account. The write-up describes this as a "User Account Management API" and notes that the HTTP method used for the update is POST, PUT or PATCH depending on the implementation. The affected functionality is account email modification. Authentication is required (a valid attacker account), and authorisation should require ownership of the targeted account.

The researcher classifies the issue as broken access control leading to unauthorised account email modification and potential account takeover. The report lists it as P2 (High), maps it to Bugcrowd VRT "Broken Access Control → Privilege Escalation / Account Takeover", to CWE-639 (Authorization Bypass Through User-Controlled Key), CWE-862 (Missing Authorization) and CWE-284 (Improper Access Control), and to OWASP A01:2025 Broken Access Control. A suggested CVSS v3.1 score of 8.1 (High) is given, explicitly subject to the actual attack prerequisites and impact. The report's own status field marks it as illustrative and requiring validation.

Setup

The prerequisites listed are:

  1. Two authorised test accounts.
  2. Burp Suite Professional or Community.
  3. A browser with an authenticated application session.

The report instructs that testing be done between two accounts the tester controls. The report is explicit that no attempt should be made to access another person's account and that only controlled test accounts should be used to validate the potential takeover impact.

Finding it

While testing the account management functionality, the researcher observed that the application lets authenticated users update account information, including the registered email address. The backend, however, does not properly validate whether the authenticated user is authorised to modify the targeted account.

The concern is that an attacker holding a valid low-privileged account may be able to manipulate the user-identification parameters in the account update request and change the email address associated with another user's account. If the application accepts that modification without requiring ownership verification or re-authentication, the victim's registered email address could be replaced with an attacker-controlled one. That would compromise the integrity of the victim's account and could enable account takeover through subsequent password-reset or email-verification workflows.

The report frames this as a significant authorisation failure: sensitive account-management operations are not adequately restricted to the legitimate account owner.

Exploitation

Step 1: Authenticate using Account A

Log in to the application with a valid test account controlled by the tester, then navigate to the account settings or profile management section.

Step 2: Intercept the email modification request

Change the registered email address of Account A and intercept the corresponding HTTP request in Burp Suite. The example request is:

HTTP
POST /api/v1/account/update HTTP/1.1Host: <application-host>Authorization: Bearer <ACCOUNT_A_TOKEN>Content-Type: application/json

The request targets /api/v1/account/update on the application host and carries Account A's bearer token in the Authorization header, so the server knows which session is making the call. The body is JSON:

JSON
{  "user_id": "1001",  "email": "[redacted]"}

Two fields matter here: user_id, which selects the account being modified, and email, the new address being written to it.

Step 3: Identify user-controlled account parameters

Inspect the intercepted request and identify the parameters responsible for selecting the account being modified. In this example the application uses the user_id parameter to identify the target account.

Step 4: Modify the target account identifier

Replace Account A's identifier with the identifier of the other authorised test account, Account B, while keeping the authenticated session associated with Account A:

JSON
{  "user_id": "1002",  "email": "[redacted]"}

The session token still belongs to Account A, but the body now names Account B as the object to update.

Step 5: Submit the modified request

Forward the modified request to the application server and observe whether the server accepts the modification and returns a successful response.

Step 6: Verify unauthorised account modification

Using the separately controlled Account B, check whether its registered email address has been modified. If the application accepts the change without verifying account ownership, the broken access control vulnerability is confirmed.

Step 7: Evaluate account takeover impact safely

In an authorised test environment, determine whether changing the registered email address affects account recovery or authentication workflows. The report repeats the constraint here: do not attempt to access another person's account, and use only controlled test accounts to validate the potential takeover impact.

Root cause

The root cause is insufficient server-side authorisation validation during sensitive account-management operations. The backend appears to rely on a user-controlled account identifier without adequately verifying that the authenticated user owns the targeted account. Sensitive operations such as email modification must be authorised using the authenticated server-side identity rather than trusting identifiers supplied by the client.

The report does not describe the server-side code or the specific checks that were absent, so the exact implementation gap is not shown.

Impact

The report sets out five consequences:

  1. Unauthorised account modification. An attacker may modify sensitive account information belonging to another user without appropriate authorisation.
  2. Account takeover risk. If the email change redirects the account's recovery destination without independent verification, an attacker may potentially gain control over subsequent password-reset workflows.
  3. Loss of account integrity. Legitimate users may lose control over their registered account information and recovery settings.
  4. Unauthorised access to account resources. A successful takeover could expose information and functionality available to the compromised account.
  5. Business and reputational impact. Unauthorised modifications and potential compromise could undermine user trust and create incident-response and recovery costs.

The report's classification table records attack vector Network, privileges required Low, user interaction None, and status "Illustrative, Requires Validation".

Fix

The report recommends the following remediation measures:

  1. Derive the account identity from the authenticated server-side session rather than trusting user-controlled identifiers.
  2. Enforce object-level authorisation checks on every account-management request.
  3. Require ownership verification before changing registered email addresses.
  4. Send a verification link to the new email address before applying the change.
  5. Require re-authentication for sensitive account-management operations.
  6. Notify the existing registered email address when account recovery information changes.
  7. Invalidate relevant sessions or recovery tokens when appropriate.
  8. Implement automated authorisation tests to prevent cross-account modification vulnerabilities.

Variants to test

  • Other user-controlled identifiers in the same request. Try swapping any field that names an object (for example an account number or username) while keeping your own session. A positive result is a successful response and a visible change on the other test account.
  • Identifier in a different location. Move the target identifier from the JSON body into a query string or path segment, or add a second identifier alongside the legitimate one. A positive result is the server honouring the injected value over the session identity.
  • Other sensitive fields on the same endpoint. Attempt the same cross-account swap with fields other than email, such as recovery settings. A positive result is any field of the other account changing without ownership verification.
  • Email change without verification. After a successful cross-account change, check whether the new address receives a verification step before the change takes effect. A positive result is the change applying immediately, which is the precondition for the password-reset takeover path.
  • Recovery workflow after the change. On your own two accounts, trigger a password reset for the modified account and see where the reset goes. A positive result is the reset reaching the attacker-controlled address.
  • Re-authentication bypass. Repeat the swap after logging in fresh and without re-entering credentials at the point of change. A positive result is the change succeeding with no re-authentication prompt.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

A security researcher was testing a website's account settings page. On almost every website, you can log in and change your own details, such as your email address. The website is supposed to check that you are only changing your own account. In this case, the researcher found that the website did not check properly. When you change your email address, your browser sends a small message to the website's server. That message contains a number that says which account to change. The researcher changed that number to point at a second test account to see whether the server would accept the change. In other words, one logged-in user could change the email address of a different user.

That matters because email addresses are often used to recover a forgotten password. If an attacker can put their own email address on a victim's account, they may be able to ask the site to reset the password and receive the reset link themselves. That is called account takeover. The researcher did not attack a real person: the whole test was done between two accounts the researcher controlled.

The report labels the issue P2 (High), which is a severity level used by bug bounty platforms. It also maps the issue to a few standard catalogues of security weaknesses, which are explained below. The report describes the finding as illustrative and requiring validation.

The pieces involved

Before walking through the steps, here are the parts of the system the report talks about.

  • The product and feature. The target is an application's account management functionality. In everyday terms, this is the settings or profile page where you change your name, password or email address. The specific feature under test is the one that lets a logged-in user change the email address registered to their account.
  • The API. An API (Application Programming Interface) is the set of addresses a website's own pages talk to behind the scenes. When you click Save on a settings page, your browser does not usually reload the whole page; it sends a small request to an API address, and the API does the work. The report calls the affected component the "User Account Management API".
  • The HTTP method. Every request to a web server has a method, which is a verb describing what you want to do. GET means read something, POST means send new data, PUT and PATCH mean update existing data. The report notes that the update could use POST, PUT or PATCH depending on how the application is built.
  • Authentication and authorisation. These two words sound alike but mean different things. Authentication is proving who you are, like showing your passport at a hotel. Authorisation is what you are allowed to do once you are inside, like your room key only opening your own room. The report says authentication is required (you need a valid account) and authorisation should require ownership of the targeted account (you should only be able to change your own).
  • The vulnerability class. Broken access control means the website fails to enforce who is allowed to do what. The report also calls it an authorisation bypass through a user-controlled key: the request contains a value chosen by the user (the account number), and the server trusts it instead of checking it against the logged-in session.

The classification

The report gives the finding several labels. These are standard ways of describing a security issue so that different teams can compare them.

Attribute Classification
Vulnerability Unauthorised Account Email Modification
Severity P2, High
Bugcrowd Priority P2
CWE CWE-639, CWE-862, CWE-284
OWASP A01:2025, Broken Access Control
Category Account Takeover / Broken Access Control
Attack Vector Network
Privileges Required Low
User Interaction None
Status Illustrative, requires validation

A few of these need explaining.

  • Bugcrowd VRT. Bugcrowd is a bug bounty platform, and its Vulnerability Rating Taxonomy is a shared list of vulnerability types. The report maps the issue to "Broken Access Control, Privilege Escalation / Account Takeover".
  • CWE. The Common Weakness Enumeration is a public catalogue of software weakness patterns. CWE-639 is authorisation bypass through a user-controlled key, which is exactly the pattern here: the server trusts an identifier supplied by the client. CWE-862 is missing authorisation, meaning a check that should exist does not. CWE-284 is improper access control, the broader category.
  • OWASP. OWASP is a non-profit that publishes guidance on web security. Its Top 10 list ranks the most common categories of web risk. A01:2025 is Broken Access Control, the first entry in that list.
  • CVSS. The Common Vulnerability Scoring System is a 0 to 10 scale for how serious a vulnerability is. The report suggests 8.1 (High), but explicitly says this depends on the actual attack prerequisites and impact.
  • Attack vector Network, privileges Low, user interaction None. These are CVSS-style descriptors. Network means the attack is carried out over the internet rather than by sitting at the machine. Low privileges means the attacker needs only an ordinary account. No user interaction means the victim does not have to click anything for the attack to work.

Setting up the test

The report lists three prerequisites:

  1. Two authorised test accounts.
  2. Burp Suite Professional or Community.
  3. A browser with an authenticated application session.

Burp Suite is a tool that sits between your browser and the website and lets you pause, read and edit the requests your browser sends. Think of it as a transparent envelope you can open before the letter reaches its destination. The report is explicit that testing should be done between two accounts the tester controls, and that no attempt should be made to access another person's account. Only controlled test accounts should be used to validate the potential takeover impact.

Finding it

While testing the account management functionality, the researcher observed that the application lets logged-in users update account information, including the registered email address. The backend, however, does not properly validate whether the logged-in user is authorised to modify the targeted account.

The concern is that an attacker with a valid low-privileged account could manipulate the user-identification parameters in the account update request and change the email address associated with another user's account. If the application accepts that modification without requiring ownership verification or re-authentication, the victim's registered email address could be replaced with one the attacker controls. That would compromise the integrity of the victim's account and could enable account takeover through subsequent password-reset or email-verification workflows.

The report frames this as a significant authorisation failure: sensitive account-management operations are not adequately restricted to the legitimate account owner.

Exploitation, step by step

Step 1: Log in as Account A

Log in to the application with a valid test account controlled by the tester, then navigate to the account settings or profile management section. This step establishes a normal, legitimate session. The point is to start from a position where the website knows exactly who you are, so that any later misbehaviour is clearly the website's fault and not a login problem.

Step 2: Intercept the email change request

Change the registered email address of Account A and intercept the corresponding HTTP request in Burp Suite. Intercepting means telling Burp to hold the request before it reaches the server, so you can read and edit it. The example request is:

HTTP
POST /api/v1/account/update HTTP/1.1Host: <application-host>Authorization: Bearer <ACCOUNT_A_TOKEN>Content-Type: application/json

Line by line:

  • POST /api/v1/account/update HTTP/1.1 is the request line. POST is the method, meaning data is being sent. /api/v1/account/update is the address on the server that handles account updates. HTTP/1.1 is the version of the protocol being spoken.
  • Host: <application-host> tells the server which website the request is for. One server can host many sites, so this header picks the right one. The angle brackets are a placeholder for the real host name.
  • Authorization: Bearer <ACCOUNT_A_TOKEN> is the header that carries the login credential. A bearer token is a long string that the server issued when Account A logged in. "Bearer" means whoever holds the token is treated as that user, like a wristband at an event. The placeholder stands for Account A's token.
  • Content-Type: application/json tells the server that the body of the request is formatted as JSON, a common text format for structured data.

The body of the request is JSON:

JSON
{  "user_id": "1001",  "email": "[redacted]"}

Line by line:

  • The outer braces { and } mark the start and end of a JSON object, which is a set of named values.
  • "user_id": "1001" is the field that says which account to modify. 1001 is Account A's identifier in this example.
  • "email": "[redacted]" is the new email address being written to that account. The report uses this placeholder address to stand for an address the attacker controls.

Two fields matter here: user_id, which selects the account being modified, and email, the new address being written to it.

Step 3: Identify the user-controlled account parameter

Inspect the intercepted request and identify the parameters responsible for selecting the account being modified. In this example the application uses the user_id parameter to identify the target account. The reason this step matters is that the whole vulnerability depends on the server trusting a value the client can change. If the account were chosen purely from the token, there would be nothing to tamper with.

Step 4: Change the target account identifier

Replace Account A's identifier with the identifier of the other authorised test account, Account B, while keeping the authenticated session associated with Account A:

JSON
{  "user_id": "1002",  "email": "[redacted]"}

Line by line:

  • The structure is identical to the previous body, so the server sees a normal-looking request.
  • "user_id": "1002" now names Account B, the other test account, as the object to update.
  • "email": "[redacted]" is unchanged: it is still the address the attacker wants to write.

The session token still belongs to Account A, but the body now names Account B as the object to update. This is the heart of the test: the credential says one thing and the body says another. A correct server should notice the mismatch and refuse.

Step 5: Submit the modified request

Forward the modified request to the application server and observe whether the server accepts the modification and returns a successful response. Forwarding means releasing the request from Burp so it continues to the server. A successful response is the first sign that the server did not check ownership.

Step 6: Verify the unauthorised change

Using the separately controlled Account B, check whether its registered email address has been modified. If the application accepts the change without verifying account ownership, the broken access control vulnerability is confirmed.

Step 7: Evaluate the takeover impact safely

In an authorised test environment, determine whether changing the registered email address affects account recovery or authentication workflows. The report repeats the constraint here: do not attempt to access another person's account, and use only controlled test accounts to validate the potential takeover impact. The reason for the caution is that the next logical step, using the changed email to reset the password, would be a real takeover if done against a real user.

Why it works: the root cause

The root cause is insufficient server-side authorisation validation during sensitive account-management operations. The backend appears to rely on a user-controlled account identifier without adequately verifying that the logged-in user owns the targeted account. Sensitive operations such as email modification must be authorised using the authenticated server-side identity rather than trusting identifiers supplied by the client.

A useful comparison is a hotel receptionist who accepts whatever room number a guest writes on a form, instead of checking the guest's key card. The form is the request body, the room number is user_id, and the key card is the session token. The report does not describe the server-side code or the specific checks that were absent, so the exact implementation gap is not shown.

What an attacker could do with it

The report sets out five consequences:

  1. Unauthorised account modification. An attacker may modify sensitive account information belonging to another user without appropriate authorisation.
  2. Account takeover risk. If the email change redirects the account's recovery destination without independent verification, an attacker may potentially gain control over subsequent password-reset workflows.
  3. Loss of account integrity. Legitimate users may lose control over their registered account information and recovery settings.
  4. Unauthorised access to account resources. A successful takeover could expose information and functionality available to the compromised account.
  5. Business and reputational impact. Unauthorised modifications and potential compromise could undermine user trust and create incident-response and recovery costs.

How to fix it

The report recommends the following remediation measures:

  1. Derive the account identity from the authenticated server-side session rather than trusting user-controlled identifiers.
  2. Enforce object-level authorisation checks on every account-management request.
  3. Require ownership verification before changing registered email addresses.
  4. Send a verification link to the new email address before applying the change.
  5. Require re-authentication for sensitive account-management operations.
  6. Notify the existing registered email address when account recovery information changes.
  7. Invalidate relevant sessions or recovery tokens when appropriate.
  8. Implement automated authorisation tests to prevent cross-account modification vulnerabilities.

In plain terms, the first item means the server should look up who you are from your session and ignore any account number in the request body. The second means every request that touches an object should check that the logged-in user owns that object. The third and fourth add a confirmation step so that a change only takes effect once the new address proves it can receive mail. The fifth asks for the password again before sensitive changes. The sixth gives the real owner a warning. The seventh cuts off old sessions after a change. The eighth builds automated tests so the same mistake is caught in future.

Other variations worth testing

  • Other user-controlled identifiers in the same request. Try swapping any field that names an object, for example an account number or username, while keeping your own session. A positive result is a successful response and a visible change on the other test account.
  • Identifier in a different location. Move the target identifier from the JSON body into a query string or path segment, or add a second identifier alongside the legitimate one. A positive result is the server honouring the injected value over the session identity.
  • Other sensitive fields on the same endpoint. Attempt the same cross-account swap with fields other than email, such as recovery settings. A positive result is any field of the other account changing without ownership verification.
  • Email change without verification. After a successful cross-account change, check whether the new address receives a verification step before the change takes effect. A positive result is the change applying immediately, which is the precondition for the password-reset takeover path.
  • Recovery workflow after the change. On your own two accounts, trigger a password reset for the modified account and see where the reset goes. A positive result is the reset reaching the attacker-controlled address.
  • Re-authentication bypass. Repeat the swap after logging in fresh and without re-entering credentials at the point of change. A positive result is the change succeeding with no re-authentication prompt.

Glossary

  • API: the set of addresses a website's own pages use to read and change data behind the scenes.
  • Account takeover: gaining control of someone else's account, often by redirecting password recovery.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: what a logged-in user is allowed to do.
  • Bearer token: a credential string that grants access to whoever holds it, like a wristband at an event.
  • Broken access control: a failure to enforce who may do what, so users can act outside their permissions.
  • Bug bounty platform: a service where organisations publish testing programmes and researchers report issues.
  • Bugcrowd VRT: Bugcrowd's Vulnerability Rating Taxonomy, a shared list of vulnerability types.
  • Burp Suite: a tool that sits between browser and server so requests can be paused, read and edited.
  • Content-Type: a header saying what format the request body is in, such as JSON.
  • CVSS: a 0 to 10 scale for rating the severity of a vulnerability.
  • CWE: the Common Weakness Enumeration, a public catalogue of software weakness patterns.
  • Header: an extra line of information attached to a request, such as the host or the credential.
  • HTTP method: the verb of a request, such as GET, POST, PUT or PATCH.
  • Intercept: to hold a request before it reaches the server so it can be inspected or changed.
  • JSON: a text format for structured data, made of named values in braces.
  • Object-level authorisation: checking that the logged-in user owns the specific record being touched.
  • OWASP: a non-profit that publishes web security guidance, including the Top 10 list.
  • P2: a priority or severity level meaning high, below only the most critical.
  • Password reset workflow: the process a site uses to let a user recover access, usually by email.
  • Privileges: the level of access an account has; low privileges means an ordinary user.
  • Re-authentication: asking for the password again before a sensitive action.
  • Request body: the part of a request that carries data, such as the JSON with user_id and email.
  • Session: the state of being logged in, represented by a token or cookie.
  • User-controlled key: an identifier in a request that the user can choose, such as user_id.
  • Verification link: an email link that proves the new address can receive mail before a change applies.

More by akashmotkar001

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.