CWE-915Identity & accessSeverity · High

Promoting yourself through a profile update

A profile update endpoint saves hidden fields like role or plan if the caller sends them. A user can then grant themselves admin rights or a paid plan.

At a glance

Controls
CWE-915 · A08:2021 Software and Data Integrity Failures
Typical severityHigh
ReferenceCWE-915
OWASP Top 10A08:2021 Software and Data Integrity Failures

What it is

The update endpoint takes the request body and writes every field it finds to the user record. The form only shows name and email. The record also holds role, plan, organisation or owner fields, and the server saves those too.

An attacker reads a normal response to learn the field names on their own record. They send the same update with role set to admin or plan set to the top tier. AI-assisted attackers guess likely field names from response shapes and common frameworks, so this takes minutes.

Where it hides

What a reviewer can look for in the code and in the behaviour, before anyone proves it.

  • Profile and account settings endpoints
  • Organisation or team member update routes
  • Sign-up endpoints that accept a role or organisation ID
  • Generic PATCH routes that bind the request body straight to a database model

How MATT tests it

The proof runs against the deployed product, on every release, whoever wrote the code.

  1. 01Read the code for update handlers that bind the whole request body to a model.
  2. 02Sign in as a test user and send a profile update that adds a role or plan field to that test user's own record.
  3. 03Read the test user's record back and confirm whether the extra field was saved, then restore it.
The rule, in plain English

A user must never be able to change their own role, plan or ownership fields.

Executable check

as user A: PATCH /v1/me with {"name": "A", "role": "admin"} expect: 400, or 200 with the field ignored as user A: GET /v1/me expect: role unchanged

Every rule MATT holds →

What the fix looks like

  1. 01

    List the fields each endpoint may change, and ignore or reject everything else.

  2. 02

    Use separate input types for user updates, with no role, plan or owner fields in them.

  3. 03

    Change roles, plans and ownership only through dedicated admin or billing flows with their own checks.

  4. 04

    Log and alert on any request that tries to set a protected field.

A check that was never written is found by proving the deployed behaviour, fixed with the engineer who shipped it, and kept fixed by running the control on every change. What is ExploitOps? →

ExploitOps discovery call

Understand where your security loop breaks.

A call with a MATT co-founder to understand your product and whether an ExploitOps Review is worth doing. If there is a real need, we scope one with the research team.

Let’s understand your priority

What brings you to MATT?

What would you like help with?
01 / 02