Unconstrained additional properties

owasp-constrained-additionalProperties

Type:

Finding

Rule Severity:

Medium

An endpoint allows unconstrained additional properties in the request body.

This means that the JSON Schema does not limit the properties that can be passed to the API. By default, the JSON Schema specification allows additional properties, which can lead to security vulnerabilities like mass assignment issues, where unspecified or unauthorized fields are passed to the API. This situation can allow attackers to send unexpected data, potentially altering application behavior or providing access to unauthorized operations, as these additional properties may be processed without validation.

Remediation

Set additionalProperties to false in the definition of the endpoint or add maxProperties.

Example Attack Scenario

An API endpoint for updating user profiles allows additional properties due to the lack of constraints. An attacker sends a request body with unauthorized fields, such as an isAdmin flag or another user’s userId, exploiting the API’s mass assignment vulnerability. If these additional properties are processed and written to the database, the attacker could escalate privileges or manipulate other user data.

How to Identify with Example Scenario

How to Resolve with Example Scenario

How to Identify with Example Scenario

Find the text in bold to identify issues such as these in API specifications

How to Resolve with Example Scenario

Modify the text in bold to resolve issues such as these in API specifications
References:

More findings

All Findings