A real world bug bounty case study with identifying details anony
A registration-completion endpoint accepted an authenticated session for one account while using an email address in the request body to select a different, incomplete account, allowing the caller to set that account's password and receive a session for it. The attacker could then log in as the target account with the chosen password.
Published on medium.com
Cybersecurity
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
The target was an application with an email-first account flow. A visitor enters an email address, and the client checks whether a profile already exists and whether registration is complete. The observed branches were:
| Account condition | Intended client behaviour | Security significance |
|---|---|---|
| Existing account with completed registration | Show password sign-in | The account already had an established credential. |
| Existing account with incomplete registration | Verify a one-time code, then finish signup | An existing identity still needed credential establishment. |
| No existing profile | Create a new account | There was no existing account to complete. |
The client used POST to create a new profile and PUT to complete an existing one. That method distinction marked the completion call as an operation that modified account state rather than merely creating a record.
The feature under review was therefore the registration-completion request. It required authentication, but selected the account to update from an email address in the request body. The authenticated caller and the selected account could be different identities.
The report assessed the finding as High, with a reported CVSS of 8.1 under CVSS 3.1. The demonstrated impact was setting another account's password, receiving its session, and authenticating as that account. All testing used researcher-owned production accounts.
Setup
The test used two distinct identities:
| Label | Meaning |
|---|---|
| B | The caller acting as the attacker, using a free account with completed registration. |
| V | A separate existing account in the tested incomplete or passwordless state. |
B_ID |
The caller's stable account identifier. |
V_ID |
The target's existing identifier, recorded before the cross-account request. |
B_PASSWORD |
The caller's original working password. |
CHOSEN_PASSWORD |
A different password submitted for the target. |
For the natural passwordless setup, the researcher used an owned mailbox, started the ordinary email-first flow, completed the one-time-code verification, and stopped before choosing a password. The application had created an identity, but registration remained incomplete. That legitimate setup step is separate from the takeover request: the attack phase used B's session and V's email, and did not require V's password, session, or one-time code.
Session isolation was essential to interpreting the result. If V's cookie had accidentally accompanied the request, a successful password change could have been a legitimate self-update. For a cross-account test, the subject of the credential actually sent must be recorded and kept separate from the target account's credentials.
The intended authorization relationship was simple: the verified completion context and the account receiving the password should identify the same account. The test supplied B as the authenticated caller and V as the selected target.
Finding it
The investigation started from client-side source analysis, which connected the earlier email input, the profile lookup result, and the request used to submit the signup form. The following pseudocode illustrates the relevant relationships with anonymized names:
method = profileExists ? "PUT" : "POST"showCompletionForm = registrationComplete === false
submitRegistration(method, { ...form, email: emailFromEarlierStep})
The client selected a method based on whether the profile already existed. A separate branch determined whether the incomplete-registration interface was shown. The email submitted to the backend came from the earlier email-first context.
That produced a focused hypothesis: the server might require a valid session while allowing the request body to choose a different account for the password change. This was a hypothesis about authorization, not a conclusion drawn from JavaScript alone. Browser-delivered code revealed the intended workflow; the subsequent requests and responses established how the server behaved when the identities were separated.
The guiding question was: what server-verified evidence authorizes this caller to finish this particular account? The normal interface placed an email-verification step before completion. That sequence was useful context, but it did not establish that the backend enforced the same prerequisite.
When reviewing similar flows, follow both the credential and the object selector. The credential tells the server who is calling. A body field, URL component, or query parameter may independently tell it which record to modify. The security check must connect those two pieces of information for the requested operation.
Exploitation
Step 1: Observe the target state
The application exposed an unauthenticated lookup that distinguished incomplete profiles from completed profiles and nonexistent accounts. In the normalised examples, that lookup is represented as:
POST /example/registration-status HTTP/1.1Host: identity.exampleContent-Type: application/jsonOrigin: https://app.example
{"email":"<V_EMAIL>"}
The actual requests also contained ordinary application metadata. Identifying headers and values are omitted because they did not establish ownership of the selected account.
For the incomplete test account, the response was HTTP 200. Its relevant meaning is represented by:
{ "data": { "registrationComplete": false }}
The observed outcomes were:
| Account condition | Recorded outcome |
|---|---|
| Incomplete profile | HTTP 200; the response indicated registration was incomplete. |
| Completed profile | HTTP 200; the response indicated registration was complete. |
| No profile | HTTP 400; the response indicated that the profile did not exist. |
This was a disclosure of account state. It made the relevant state distinguishable, but did not itself change a password or establish account takeover. An incomplete-state response should also not be treated as proof that every account with that response is exploitable under every configuration. The finding depended on the mutation and authentication results for the accounts actually tested. Neither the total affected population nor large-scale enumeration feasibility was measured.
Step 2: Identify the session used by the caller
B authenticated through the application's ordinary password-login flow. The normalised request was:
POST /example/login HTTP/1.1Host: identity.exampleContent-Type: application/json
{ "email": "<B_EMAIL>", "password": "<B_PASSWORD>"}
The response returned HTTP 200 and a session cookie carrying a JWT. Inspecting the response headers mattered because the credential was commonly returned through Set-Cookie, rather than the JSON response body.
The identity-relevant claims are represented as:
sub = B_IDiss = https://identity.example
Additional implementation-specific claims are omitted. No email claim was observed in the recorded password session.
The absence of an email claim was not inherently a weakness. A stable subject can be sufficient for the backend to resolve the caller and enforce ownership. Adding an email claim would not repair a failure to authorize the operation on the selected account.
The credential was a genuine session obtained by logging in as B. There was no need to edit the token, change its subject, forge a signature, or compromise a signing key. Decoding the token established which identity the credential represented; the next step tested whether the server kept that identity bound to the account being modified.
Step 3: Submit one identity as the caller and another as the target
The decisive request used B's session while selecting V through the body email field:
PUT /example/registration HTTP/1.1Host: identity.exampleContent-Type: application/jsonAuthorization: Bearer <B_SESSION_TOKEN>
{ "email": "<V_EMAIL>", "password": "<CHOSEN_PASSWORD>"}
Other ordinary signup form fields were present in the original request and are omitted from this teaching excerpt. The security-relevant relationship was the mismatch between the session subject and the account selected for the password-setting operation.
The expected outcome was rejection because B had not established authority to complete V's account. Instead, the server returned HTTP 200, identified V's existing account, and marked its registration complete. The normalised result shows the relevant meaning of the response fields:
{ "data": { "accountId": "<V_ID>", "email": "<V_EMAIL>", "registrationState": "complete" }}
The response also issued a new session cookie. Its JWT subject identified V.
| Point in the exchange | Identity established by the evidence |
|---|---|
Session supplied with PUT |
B |
| Email selected in the request body | V |
| Existing account identifier returned | V |
| Subject of the newly issued session | V |
This was stronger evidence than an email address reflected in a response. The returned account identifier matched the target's existing identity, and the new credential represented that identity. The service had accepted authentication for one account and used it to perform a credential-setting operation on another.
Step 4: Confirm the credential change independently
A separate login request tested whether the chosen password actually authenticated V:
POST /example/login HTTP/1.1Host: identity.exampleContent-Type: application/json
{ "email": "<V_EMAIL>", "password": "<CHOSEN_PASSWORD>"}
The result was HTTP 200 and authenticated account information for V. This established password-based access beyond the session returned by the completion request.
B's credentials were then checked to determine which account had changed:
| Login attempt | Recorded result |
|---|---|
V with CHOSEN_PASSWORD |
HTTP 200; authentication succeeded. |
B with B_PASSWORD |
HTTP 200; authentication succeeded. |
B with CHOSEN_PASSWORD |
HTTP 401; credentials were rejected. |
These controls showed that the new password had not merely been applied to B. V's returned identifier also matched the identifier recorded before the test, supporting that an existing target account had been modified.
The complete proof combined four observations:
- The caller's credential identified B.
- The update response and new session identified V.
- A separate password login authenticated V.
- B's original credentials remained valid.
The successful login demonstrated an established password-based access path. It did not establish indefinite persistence after account recovery, password rotation, or session revocation.
Step 5: Use negative controls to define the scope
The endpoint did reject several requests. Those controls explained which checks existed and where authorization remained insufficient.
| Control | Recorded result |
|---|---|
| Registration update without a session | HTTP 400; rejected for missing authentication. |
| Completed account with its own session and email | HTTP 400; registration could not be updated through this operation, and the password remained unchanged. |
| Completed target account with a foreign session | HTTP 400; the original target password still worked. |
| Attempt to change another account's registration state through profile editing | The profile operation remained bound to the authenticated account. |
| Own existing password session after an account entered the incomplete state | Registration completion succeeded without a new one-time-code step. |
| Status lookup for an email with no profile | HTTP 400; profile absence was distinguishable. |
The unauthenticated rejection established a session requirement. It did not establish that every accepted session was authorized for the target record. The completed-account controls limited the demonstrated primary impact: the tests did not show direct password replacement on arbitrary completed accounts.
The existing-session control exposed a related workflow problem: even a session belonging to the correct account could substitute for the intended completion proof. Enforcing subject matching alone would therefore not fully implement a requirement for a dedicated verification step before completing registration.
This distinction is useful when testing APIs: required-field validation, authentication, account eligibility, and authorization for a particular operation are separate checks.
Step 6: Separate natural account states from laboratory preparation
The report included an independent reproduction using a fresh incomplete profile and another using an account left passwordless through the ordinary signup flow. Both demonstrated registration completion for the selected target and successful login with the chosen password, while the caller's password controls held. The naturally created account remained incomplete for several hours before the test.
That timing showed that the affected state could persist beyond a momentary interface transition. It did not establish a universal retention period, an unlimited attack window, or the number of incomplete accounts in production.
A separate laboratory setup used an owned account's own session to move that account back into the incomplete state. That was useful for constructing a test condition, but the natural signup example established that the primary vulnerable state was reachable through the product's ordinary workflow.
Step 7: The scenario requiring an existing target session
The report also tested a sequence in which V's own session first reopened V's registration state through profile editing. B's session then completed V's registration with a new password. The replacement password worked, the previous password failed, and the owned test account was restored afterward.
This sequence required prior access to V's session. The profile endpoint did not allow B to downgrade an unrelated completed account simply by supplying a different email. The result therefore showed a possible route from existing session access to password-based access after reopening registration. It did not prove an initial takeover of arbitrary completed accounts.
The two threat models must remain separate:
- Natural incomplete-account takeover: B's session and V's email were sufficient in the demonstrated tests.
- State-reopening sequence: V's session was additionally required to reopen registration first.
Root cause
The service authenticated a caller but allowed an independently supplied email address to determine which account received a new password. This is a broken object level authorization pattern. The object was the account profile, the selector was an email address, and the protected operation was credential establishment. OWASP describes this category as a failure to authorize the requested action on the particular object selected by a caller-controlled identifier.
The observed behaviour exposed two missing bindings:
- Subject binding: The authenticated or verified completion subject was not bound to the account being completed.
- Purpose binding: The accepted credential was not restricted to the intended registration-completion purpose.
Neither conclusion requires a cryptographic weakness in the JWT. Authentication could correctly identify B while the application still authorized a change to V incorrectly. It was also unnecessary to guess a private account identifier: the service resolved the supplied email address to the existing target profile. Object authorization failures can involve familiar strings, not only numeric identifiers in URLs.
The required invariant is: the account receiving a credential must be the account authorized by the verified completion context.
The session requirement only proved that some authenticated caller was present, and the completed-account rejection showed an eligibility check existed without binding the caller's subject to the selected record.
Impact
For the tested incomplete accounts, a basic authenticated user could establish another account's password, receive a session for that identity, and subsequently authenticate as it. The takeover request required neither the target's one-time code nor interaction from its owner.
The password change and separate successful login demonstrated account control. The returned account response demonstrated access to the fields visible in that response. The testing did not characterize every authenticated API or all personal information potentially reachable afterward.
The completed state would send the owner toward password sign-in even though the attacker had selected that password. Permanent lockout, defeat of account recovery, and bypass of every possible multifactor configuration were not established. Additional paid features or business privileges could increase the consequences of account control, but access to such features and billing actions was not demonstrated.
The report used this severity assessment:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
This vector calculates to 8.1, High under CVSS 3.1. It treats the prerequisite ordinary account as low privileges and requires no victim interaction during exploitation. The assessment assigns high confidentiality and integrity impact without a separate service-availability claim. Crossing between user accounts does not automatically imply a CVSS Scope change; that metric concerns security authorities.
The account-state restriction remains part of the impact statement. It should not be replaced by a claim that every account on the service was vulnerable. The severity assessment also does not establish a triage outcome, remediation status, or disclosure approval.
Fix
The report sets out remediation recommendations rather than describing changes that were made.
Resolve the target from trusted context
The backend should obtain the account identifier from a verified, authorized completion context. A body email must not independently select another record for a password change. If an email remains in the request, resolve it using the application's canonical identity rules and verify that it refers to the account authorized for completion. A stable server-side identifier is preferable to treating an unchecked email string as authority. An email claim does not have to be added to every session token to enforce this relationship; the verified subject can be resolved to the correct account on the server.
Accept proof for the specific operation
After the required ownership-verification step, issue a short-lived, single-use authorization bound to the account and the registration transaction. An ordinary password session should not substitute for that completion proof. For JWT-based designs, validate the expected issuer, audience, subject, validity window, and purpose through the supported verification mechanism. RFC 8725 recommends distinct validation rules when an issuer produces tokens for different contexts, preventing a token valid for one purpose from being accepted for another.
Subject binding and purpose binding address different failures. A completion token for B must not complete V. A generic session for V must not automatically satisfy a requirement for fresh completion authorization.
Guard the state change as one operation
Verify that the account is eligible, consume the completion proof, and establish the password and completed state as one guarded transition. Issue the resulting session only after that authorized transition succeeds. This is a remediation recommendation, not a claim that a concurrency vulnerability was demonstrated; it keeps the authorization decision connected to the mutation it protects. OWASP's password-recovery guidance similarly recommends valid proof that expires and can be used only once. The workflow here was registration completion, but both operations establish a credential for an existing identity.
Restrict who can reopen registration
General profile editing should not allow ordinary clients to move completed accounts back into an incomplete registration state. If a legitimate migration requires that change, protect it with a dedicated policy and appropriate verification. This addresses the separate scenario requiring a target session; it does not replace the subject and purpose checks needed at the completion endpoint.
Limit account state disclosure
Avoid revealing whether an arbitrary email belongs to an incomplete account before verifying ownership. An email-first interface can begin with a generic response and reveal sensitive account-state details after the user proves control of the mailbox. Rate limits and monitoring can reduce abuse, but concealing the status result alone would not repair the cross-account password update when the target email is known. OWASP recommends consistent responses and timing to reduce enumeration in recovery workflows.
Test the repaired security relationships
A focused regression review should accept valid completion proof only for its intended account, transaction, and operation. It should reject foreign subjects, ordinary sessions used as completion proof, missing or invalid proof, expired or reused proof, and ineligible account states. The review should also verify that ordinary profile edits cannot reopen registration, that session issuance reflects the authorized account, and that legitimate signup continues to work. These checks address the invariant exposed by the report rather than only one request body.
Variants to test
The transferable method is to treat account transitions as security-sensitive operations:
- Map the lifecycle. Identify account creation, incomplete registration, verification, completion, and recovery states. A positive result is a state that exists server-side but is not covered by the same authorization checks as the others.
- Find credential-setting requests. A signup endpoint may exercise the same authority as a password-reset endpoint. A positive result is a signup or completion call that accepts a password for an existing identity.
- Record caller and target separately. Compare the credential's subject with the account selected by the request. A positive result is a request where the two differ and the server still acts on the selected account.
- Use distinct owned accounts. Separate their credentials, identifiers, and test roles. A positive result is a response that returns the target's identifier or issues a session whose subject is the target.
- Vary the relevant account state. A rejection for completed accounts does not characterize behaviour for incomplete accounts. A positive result is a state-dependent difference in authorization.
- Follow the result into authentication. Check the existing account identifier, returned session subject, and separate password-login result. A positive result is a successful login as the target with the chosen password.
- Verify what happened to the caller. Confirm whether the original account's credentials remained unchanged. A positive result is the caller still authenticating with its original password and failing with the new one.
- Separate initial access from persistence. A scenario requiring a target session has different prerequisites from one using only the caller's session. A positive result is a documented prerequisite chain, not an assumed one.
- State the final proven consequence. Account control, specific data access, business privileges, and recovery resistance require separate evidence.
A valid session identifies a caller; the server must separately authorize that caller for the requested account and operation. Preserving that relationship is essential whenever an API establishes a password or issues a session. In this case, following the identities through the request, response, and later login turned an apparent registration oddity into a demonstrated cross-account takeover.
What happened, in plain words
A website let people sign up using their email address first. You typed your email, the site checked whether it already knew you, and then it either asked you to sign in, asked you to finish signing up, or offered to create a new account.
The researcher found that the step where you finish signing up had a serious flaw. If you were already logged in to your own account, you could send that finishing step a different person's email address and a password of your choosing. The server would then set that password on the other person's account, hand back a login session for that other account, and let you sign in as them.
In other words, being logged in as yourself was enough to take over a different account that had started signing up but had not yet chosen a password. The researcher rated this High, with a reported CVSS of 8.1 under CVSS 3.1. All testing used accounts the researcher owned.
Before going further, a few words that come up constantly below.
- An API (application programming interface) is the set of addresses and rules a website's own pages use to talk to its server. Think of it as the service counter behind the shop window: the page you see is the window, and the API is where the actual requests are handed over and processed.
- A request is one message your browser sends to the server, for example "log me in" or "save this form". A response is the server's reply.
- A cookie is a small piece of data the server asks your browser to store and send back with later requests, so the server can recognise you between page loads. A session cookie is the cookie that proves you are logged in.
- A token is a compact string that carries information and is often used as proof of identity. A JWT (JSON Web Token) is a particular token format made of three parts separated by dots; one part lists claims such as who the token is about. The
subclaim is the subject, meaning the identity the token represents. - Authentication means proving who you are. Authorization means deciding what you are allowed to do. They are different questions, and this whole story turns on the gap between them.
- HTTP methods are verbs at the start of a request.
GETasks for something,POSTusually creates something,PUTusually replaces or updates something, andDELETEremoves something. - HTTP status codes are three-digit numbers in the response.
200means success,400means the request was malformed or unacceptable, and401means you are not authenticated.
The setup: two accounts, two roles
The test used two separate accounts, both owned by the researcher:
| Label | Meaning |
|---|---|
| B | The caller acting as the attacker, using a free account with completed registration. |
| V | A separate existing account in the tested incomplete or passwordless state. |
B_ID |
The caller's stable account identifier. |
V_ID |
The target's existing identifier, recorded before the cross-account request. |
B_PASSWORD |
The caller's original working password. |
CHOSEN_PASSWORD |
A different password submitted for the target. |
To create the natural passwordless account, the researcher used a mailbox they controlled, started the ordinary email-first signup, completed the one-time-code verification, and then stopped before choosing a password. The site had created an identity, but registration was still incomplete. That is a normal thing a real user might do: start signing up, verify the email, then stop before choosing a password.
That legitimate setup step is separate from the attack. The attack phase used B's session and V's email. It did not need V's password, V's session, or V's one-time code.
Keeping the two accounts' sessions apart was essential. If V's cookie had accidentally been sent along with the request, a successful password change could simply have been V updating themselves. For a cross-account test, you must record whose credential was actually sent and keep it separate from the target's credentials.
The intended rule was simple: the verified signup context and the account receiving the password should be the same account. The test deliberately supplied B as the logged-in caller and V as the selected target.
Finding it: reading the page's own code
The investigation started by reading the JavaScript the browser downloads. JavaScript is the code that runs in your browser and makes pages interactive. It is not secret: anyone can open the browser's developer tools and read it.
The researcher connected three things: the earlier email input, the result of the profile lookup, and the request used to submit the signup form. The following pseudocode illustrates the relationships with anonymised names:
method = profileExists ? "PUT" : "POST"showCompletionForm = registrationComplete === false
Line by line:
method = profileExists ? "PUT" : "POST"means: if a profile already exists, use thePUTmethod; otherwise usePOST. The? :form is a compact if/else. So creating a brand new account usesPOST, and finishing an existing one usesPUT.showCompletionForm = registrationComplete === falsemeans: show the finish-signup form only when the registration is not complete. The===is a strict equality check.
submitRegistration(method, { ...form, email: emailFromEarlierStep})
Line by line:
submitRegistration(method, { ... })calls a function that sends the signup form to the server, using the method chosen above....formcopies all the ordinary form fields into the request body. The...is a spread operator, a shorthand for "put everything from this object here".email: emailFromEarlierStepsets the email field to the address captured at the very first step of the flow.
The client picked the method based on whether the profile existed. A separate branch decided whether the incomplete-registration screen was shown. The email sent to the server came from the earlier email-first step.
That produced a focused hypothesis: the server might require a valid session, but still let the request body choose a different account for the password change. This was a hypothesis about authorization, not a conclusion drawn from JavaScript alone. Browser code shows the intended workflow; only real requests and responses show how the server actually behaves when the identities are separated.
The guiding question was: what server-verified evidence authorizes this caller to finish this particular account? The normal interface put an email-verification step before completion. That sequence was useful context, but it did not prove the backend enforced the same prerequisite.
When reviewing similar flows, follow both the credential and the object selector. The credential tells the server who is calling. A body field, URL component, or query parameter may independently tell it which record to modify. The security check must connect those two pieces of information for the requested operation.
Exploitation
Step 1: Observe the target state
The application exposed an unauthenticated lookup that distinguished incomplete profiles from completed profiles and nonexistent accounts. "Unauthenticated" means no login was needed. In the normalised examples, that lookup is represented as:
POST /example/registration-status HTTP/1.1Host: identity.exampleContent-Type: application/jsonOrigin: https://app.example
Line by line:
POST /example/registration-status HTTP/1.1is the request line: the methodPOST, the path being called, and the HTTP version. The path is a stand-in for the real one.Host: identity.examplesays which server the request is for. The hostname is a placeholder.Content-Type: application/jsontells the server the body is JSON, a common text format for structured data.Origin: https://app.exampletells the server which site the request came from. Browsers add this automatically.
{"email":"<V_EMAIL>"}
This body simply asks the server about one email address, the target's. The angle brackets mark a value that has been replaced to hide the real one.
The actual requests also contained ordinary application metadata. Identifying headers and values are omitted because they did not establish ownership of the selected account.
For the incomplete test account, the response was HTTP 200. Its relevant meaning is represented by:
{ "data": { "registrationComplete": false }}
Line by line:
- The outer braces hold a JSON object.
"data"is a field whose value is another object, nested inside."registrationComplete": falsesays the registration is not finished.falseis a boolean, a true/false value.
The observed outcomes were:
| Account condition | Recorded outcome |
|---|---|
| Incomplete profile | HTTP 200; the response indicated registration was incomplete. |
| Completed profile | HTTP 200; the response indicated registration was complete. |
| No profile | HTTP 400; the response indicated that the profile did not exist. |
This was a disclosure of account state. It let the researcher tell the relevant states apart, but it did not itself change a password or take over an account. An incomplete-state response should also not be treated as proof that every account with that response is exploitable under every configuration. The finding depended on the actual change and login results for the accounts tested. Neither the total affected population nor the feasibility of checking many accounts at scale was measured.
Step 2: Identify the session used by the caller
B signed in through the ordinary password login. The normalised request was:
POST /example/login HTTP/1.1Host: identity.exampleContent-Type: application/json
Line by line:
POST /example/loginsends the login request to the login path.HostandContent-Typedo the same jobs as before.
{ "email": "<B_EMAIL>", "password": "<B_PASSWORD>"}
Line by line:
"email"is the caller's address."password"is the caller's real password.
The response returned HTTP 200 and a session cookie carrying a JWT. Looking at the response headers mattered because the credential was usually returned through Set-Cookie, not in the JSON body. Headers are the labelled lines above the body of a response; Set-Cookie is the header a server uses to hand your browser a cookie.
The identity-relevant claims are represented as:
sub = B_IDiss = https://identity.example
Line by line:
sub = B_IDis the subject claim: the token is about B's account identifier.iss = https://identity.exampleis the issuer claim: which service created the token.
Other implementation-specific claims are omitted. No email claim was seen in the recorded password session.
The absence of an email claim was not a weakness in itself. A stable subject is enough for the backend to look up the caller and enforce ownership. Adding an email claim would not fix a failure to check authorization on the selected account.
The credential was a genuine session obtained by logging in as B. There was no need to edit the token, change its subject, forge a signature, or steal a signing key. Decoding the token established which identity the credential represented. The next step tested whether the server kept that identity tied to the account being changed.
Step 3: Submit one identity as the caller and another as the target
The decisive request used B's session while selecting V through the body email field:
PUT /example/registration HTTP/1.1Host: identity.exampleContent-Type: application/jsonAuthorization: Bearer <B_SESSION_TOKEN>
Line by line:
PUT /example/registrationusesPUT, the update method, on the registration path. This is the finish-signup call.HostandContent-Typeare as before.Authorization: Bearer <B_SESSION_TOKEN>is the credential.Bearermeans "the holder of this token is the caller". The token is B's real session token, replaced here with a placeholder.
{ "email": "<V_EMAIL>", "password": "<CHOSEN_PASSWORD>"}
Line by line:
"email"is V's address, not B's."password"is the new password the researcher wants to set on V.
Other ordinary signup form fields were present in the original request and are omitted from this teaching excerpt. The security-relevant relationship was the mismatch between the session subject and the account selected for the password-setting operation.
The expected outcome was rejection, because B had not established authority to finish V's account. Instead, the server returned HTTP 200, identified V's existing account, and marked its registration complete. The normalised result shows the relevant meaning of the response fields:
{ "data": { "accountId": "<V_ID>", "email": "<V_EMAIL>", "registrationState": "complete" }}
Line by line:
"accountId": "<V_ID>"is V's existing account identifier, the same one recorded before the test."email": "<V_EMAIL>"is V's address."registrationState": "complete"says the registration is now finished.
The response also issued a new session cookie. Its JWT subject identified V.
| Point in the exchange | Identity established by the evidence |
|---|---|
Session supplied with PUT |
B |
| Email selected in the request body | V |
| Existing account identifier returned | V |
| Subject of the newly issued session | V |
This was stronger evidence than an email address reflected in a response. The returned account identifier matched the target's existing identity, and the new credential represented that identity. The service had accepted authentication for one account and used it to perform a credential-setting operation on another.
Step 4: Confirm the credential change independently
A separate login request tested whether the chosen password actually authenticated V:
POST /example/login HTTP/1.1Host: identity.exampleContent-Type: application/json
Line by line:
- This is the same login request as before, sent fresh.
{ "email": "<V_EMAIL>", "password": "<CHOSEN_PASSWORD>"}
Line by line:
"email"is V's address."password"is the password the researcher chose in the previous step.
The result was HTTP 200 and authenticated account information for V. This established password-based access beyond the session returned by the completion request.
B's credentials were then checked to determine which account had changed:
| Login attempt | Recorded result |
|---|---|
V with CHOSEN_PASSWORD |
HTTP 200; authentication succeeded. |
B with B_PASSWORD |
HTTP 200; authentication succeeded. |
B with CHOSEN_PASSWORD |
HTTP 401; credentials were rejected. |
These controls showed that the new password had not merely been applied to B. V's returned identifier also matched the identifier recorded before the test, supporting that an existing target account had been modified.
The complete proof combined four observations:
- The caller's credential identified B.
- The update response and new session identified V.
- A separate password login authenticated V.
- B's original credentials remained valid.
The successful login demonstrated an established password-based access path. It did not establish indefinite persistence after account recovery, password rotation, or session revocation.
Step 5: Use negative controls to define the scope
A negative control is a test you expect to fail, used to show which protections do exist. The endpoint did reject several requests. Those controls explained which checks existed and where authorization remained insufficient.
| Control | Recorded result |
|---|---|
| Registration update without a session | HTTP 400; rejected for missing authentication. |
| Completed account with its own session and email | HTTP 400; registration could not be updated through this operation, and the password remained unchanged. |
| Completed target account with a foreign session | HTTP 400; the original target password still worked. |
| Attempt to change another account's registration state through profile editing | The profile operation remained bound to the authenticated account. |
| Own existing password session after an account entered the incomplete state | Registration completion succeeded without a new one-time-code step. |
| Status lookup for an email with no profile | HTTP 400; profile absence was distinguishable. |
The unauthenticated rejection established a session requirement. It did not establish that every accepted session was authorised for the target record. The completed-account controls limited the demonstrated primary impact: the tests did not show direct password replacement on arbitrary completed accounts.
The existing-session control exposed a related workflow problem: even a session belonging to the correct account could substitute for the intended completion proof. Enforcing subject matching alone would therefore not fully implement a requirement for a dedicated verification step before completing registration.
This distinction is useful when testing APIs: required-field validation, authentication, account eligibility, and authorization for a particular operation are separate checks.
Step 6: Separate natural account states from laboratory preparation
The report included an independent reproduction using a fresh incomplete profile and another using an account left passwordless through the ordinary signup flow. Both demonstrated registration completion for the selected target and successful login with the chosen password, while the caller's password controls held. The naturally created account remained incomplete for several hours before the test.
That timing showed that the affected state could persist beyond a momentary interface transition. It did not establish a universal retention period, an unlimited attack window, or the number of incomplete accounts in production.
A separate laboratory setup used an owned account's own session to move that account back into the incomplete state. That was useful for constructing a test condition, but the natural signup example established that the primary vulnerable state was reachable through the product's ordinary workflow.
Step 7: The scenario requiring an existing target session
The report also tested a sequence in which V's own session first reopened V's registration state through profile editing. B's session then completed V's registration with a new password. The replacement password worked, the previous password failed, and the owned test account was restored afterward.
This sequence required prior access to V's session. The profile endpoint did not allow B to downgrade an unrelated completed account simply by supplying a different email. The result therefore showed a possible route from existing session access to password-based access after reopening registration. It did not prove an initial takeover of arbitrary completed accounts.
The two threat models must remain separate:
- Natural incomplete-account takeover: B's session and V's email were sufficient in the demonstrated tests.
- State-reopening sequence: V's session was additionally required to reopen registration first.
Root cause
The service authenticated a caller but allowed an independently supplied email address to determine which account received a new password. This is a broken object level authorization pattern. The object was the account profile, the selector was an email address, and the protected operation was credential establishment. OWASP, a well-known security standards body, describes this category as a failure to authorize the requested action on the particular object selected by a caller-controlled identifier.
A simple comparison: a hotel receptionist checks your ID at the desk (authentication), then hands you a key to whichever room number you say out loud (missing authorization). The ID check was real; the room check was missing.
The observed behaviour exposed two missing bindings:
- Subject binding: The authenticated or verified completion subject was not bound to the account being completed.
- Purpose binding: The accepted credential was not restricted to the intended registration-completion purpose.
Neither conclusion requires a cryptographic weakness in the JWT. Authentication could correctly identify B while the application still authorized a change to V incorrectly. It was also unnecessary to guess a private account identifier: the service resolved the supplied email address to the existing target profile. Object authorization failures can involve familiar strings, not only numeric identifiers in URLs.
The required invariant is: the account receiving a credential must be the account authorized by the verified completion context.
The session requirement only proved that some authenticated caller was present, and the completed-account rejection showed an eligibility check existed without binding the caller's subject to the selected record.
Impact
For the tested incomplete accounts, a basic authenticated user could establish another account's password, receive a session for that identity, and subsequently authenticate as it. The takeover request required neither the target's one-time code nor interaction from its owner.
The password change and separate successful login demonstrated account control. The returned account response demonstrated access to the fields visible in that response. The testing did not characterise every authenticated API or all personal information potentially reachable afterward.
The completed state would send the owner toward password sign-in even though the attacker had selected that password. Permanent lockout, defeat of account recovery, and bypass of every possible multifactor configuration were not established. Additional paid features or business privileges could increase the consequences of account control, but access to such features and billing actions was not demonstrated.
The report used this severity assessment:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Line by line, each part is a metric and its value:
CVSS:3.1is the scoring system and version. CVSS is a standard way to score how serious a vulnerability is.AV:Nmeans attack vector is network: it can be done remotely over the internet.AC:Lmeans attack complexity is low: no special conditions are needed.PR:Lmeans privileges required are low: the attacker needs an ordinary account.UI:Nmeans user interaction is none: the victim does not have to click or do anything.S:Umeans scope is unchanged: the impact stays within the same security authority.C:Hmeans confidentiality impact is high: data can be read.I:Hmeans integrity impact is high: data can be changed.A:Nmeans availability impact is none: the service is not taken down.
This vector calculates to 8.1, High under CVSS 3.1. It treats the prerequisite ordinary account as low privileges and requires no victim interaction during exploitation. The assessment assigns high confidentiality and integrity impact without a separate service-availability claim. Crossing between user accounts does not automatically imply a CVSS Scope change; that metric concerns security authorities.
The account-state restriction remains part of the impact statement. It should not be replaced by a claim that every account on the service was vulnerable. The severity assessment also does not establish a triage outcome, remediation status, or disclosure approval.
Fix
The report sets out remediation recommendations rather than describing changes that were made.
Resolve the target from trusted context
The backend should obtain the account identifier from a verified, authorized completion context. A body email must not independently select another record for a password change. If an email remains in the request, resolve it using the application's canonical identity rules and verify that it refers to the account authorized for completion. A stable server-side identifier is preferable to treating an unchecked email string as authority. An email claim does not have to be added to every session token to enforce this relationship; the verified subject can be resolved to the correct account on the server.
Accept proof for the specific operation
After the required ownership-verification step, issue a short-lived, single-use authorization bound to the account and the registration transaction. An ordinary password session should not substitute for that completion proof. For JWT-based designs, validate the expected issuer, audience, subject, validity window, and purpose through the supported verification mechanism. RFC 8725 is a standard document with recommendations for JWT security; it recommends distinct validation rules when an issuer produces tokens for different contexts, preventing a token valid for one purpose from being accepted for another.
Subject binding and purpose binding address different failures. A completion token for B must not complete V. A generic session for V must not automatically satisfy a requirement for fresh completion authorization.
Guard the state change as one operation
Verify that the account is eligible, consume the completion proof, and establish the password and completed state as one guarded transition. Issue the resulting session only after that authorized transition succeeds. This is a remediation recommendation, not a claim that a concurrency vulnerability was demonstrated; it keeps the authorization decision connected to the mutation it protects. OWASP's password-recovery guidance similarly recommends valid proof that expires and can be used only once. The workflow here was registration completion, but both operations establish a credential for an existing identity.
Restrict who can reopen registration
General profile editing should not allow ordinary clients to move completed accounts back into an incomplete registration state. If a legitimate migration requires that change, protect it with a dedicated policy and appropriate verification. This addresses the separate scenario requiring a target session; it does not replace the subject and purpose checks needed at the completion endpoint.
Limit account state disclosure
Avoid revealing whether an arbitrary email belongs to an incomplete account before verifying ownership. An email-first interface can begin with a generic response and reveal sensitive account-state details after the user proves control of the mailbox. Rate limits and monitoring can reduce abuse, but concealing the status result alone would not repair the cross-account password update when the target email is known. OWASP recommends consistent responses and timing to reduce enumeration in recovery workflows. Enumeration means systematically checking many addresses to learn which ones exist.
Test the repaired security relationships
A focused regression review should accept valid completion proof only for its intended account, transaction, and operation. A regression review means re-testing after a fix to make sure the problem is gone and nothing else broke. It should reject foreign subjects, ordinary sessions used as completion proof, missing or invalid proof, expired or reused proof, and ineligible account states. The review should also verify that ordinary profile edits cannot reopen registration, that session issuance reflects the authorized account, and that legitimate signup continues to work. These checks address the invariant exposed by the report rather than only one request body.
Variants to test
The transferable method is to treat account transitions as security-sensitive operations:
- Map the lifecycle. Identify account creation, incomplete registration, verification, completion, and recovery states. A positive result is a state that exists server-side but is not covered by the same authorization checks as the others.
- Find credential-setting requests. A signup endpoint may exercise the same authority as a password-reset endpoint. A positive result is a signup or completion call that accepts a password for an existing identity.
- Record caller and target separately. Compare the credential's subject with the account selected by the request. A positive result is a request where the two differ and the server still acts on the selected account.
- Use distinct owned accounts. Separate their credentials, identifiers, and test roles. A positive result is a response that returns the target's identifier or issues a session whose subject is the target.
- Vary the relevant account state. A rejection for completed accounts does not characterise behaviour for incomplete accounts. A positive result is a state-dependent difference in authorization.
- Follow the result into authentication. Check the existing account identifier, returned session subject, and separate password-login result. A positive result is a successful login as the target with the chosen password.
- Verify what happened to the caller. Confirm whether the original account's credentials remained unchanged. A positive result is the caller still authenticating with its original password and failing with the new one.
- Separate initial access from persistence. A scenario requiring a target session has different prerequisites from one using only the caller's session. A positive result is a documented prerequisite chain, not an assumed one.
- State the final proven consequence. Account control, specific data access, business privileges, and recovery resistance require separate evidence.
A valid session identifies a caller; the server must separately authorize that caller for the requested account and operation. Preserving that relationship is essential whenever an API establishes a password or issues a session. In this case, following the identities through the request, response, and later login turned an apparent registration oddity into a demonstrated cross-account takeover.
Glossary
- API: the set of addresses and rules a website's own pages use to talk to its server.
- Authentication: proving who you are, for example by logging in.
- Authorization: deciding what an authenticated user is allowed to do.
- Bearer token: a credential where possession alone is treated as proof of identity.
- Broken object level authorization: a flaw where a server checks that you are logged in but not that you are allowed to act on the specific record you selected.
- Claim: a piece of information inside a token, such as who it is about.
- Cookie: a small piece of data a server asks your browser to store and send back later.
- Credential: anything used to prove identity, such as a password or session token.
- CVSS: a standard scoring system for rating the severity of a vulnerability.
- Enumeration: systematically checking many values, such as email addresses, to learn which ones exist.
- Header: a labelled line in an HTTP request or response carrying metadata.
- HTTP method: the verb at the start of a request, such as
GET,POST,PUTorDELETE. - HTTP status code: a three-digit number in a response, such as
200,400or401. - Invariant: a rule that must always hold true.
- Issuer (
iss): the claim naming which service created a token. - JSON: a common text format for structured data, using braces and key/value pairs.
- JWT (JSON Web Token): a token format made of three dot-separated parts, one of which lists claims.
- Negative control: a test you expect to fail, used to show which protections exist.
- One-time code: a short code sent to an email address or phone to prove you control it, usable once.
- OWASP: a well-known non-profit that publishes security guidance and standards.
- Pseudocode: simplified code written to show logic rather than to run.
- Regression review: re-testing after a fix to confirm the problem is gone and nothing else broke.
- Request: one message a browser sends to a server.
- Response: the server's reply to a request.
- RFC 8725: a standard document with security recommendations for JWTs.
- Session: the state of being logged in, usually represented by a session cookie or token.
- Session cookie: the cookie that proves you are logged in.
- Subject (
sub): the claim naming the identity a token represents. - Threat model: a description of who might attack, what they have access to, and what they could achieve.
- Token: a compact string carrying information, often used as proof of identity.
- Unauthenticated: done without logging in.