Missing additional properties

owasp:api6:2019-no-additionalProperties

Rule Severity:

Low

Ensure request bodies sent to endpoints do not allow objects containing unexpected additional properties. This will ensure no read-only object property can be altered by non-privileged users.
This rule applies at the API Specification level (OAS/Swagger).
The additionalProperties option should be used in the OpenAPI spec. This option prevents Broken Object Property Level Authorization exploits. Endpoints receiving objects with the additionalProperties option set to true can receive unexpected parameters. This can allow for unintended application behavior or privilege escalation.

1. How to Identify with Example Scenario

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

schemas:
  Object:         # arbitrary name for the object
    type: object
    title: Object         # arbitrary name for the object
     additionalProperties: true

2. How to Identify with Example Scenario

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

1. How to Resolve with Example Scenario

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

schemas:
  Object:         # arbitrary name for the object
    type: object
    title: Object         # arbitrary name for the object
     additionalProperties: false

2. How to Resolve with Example Scenario

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