+V15.3 Defensive Coding
---+V15.3.1 Verify that the application only returns the required subset of fields from a data object. For …
---+V15.3.2 Verify that where the application backend makes calls to external URLs, it is configured to not …
---+V15.3.3 Verify that the application has countermeasures to protect against mass assignment attacks by …
---+V15.3.4 Verify that all proxying and middleware components transfer the user's original IP address …
---+V15.3.5 Verify that the application explicitly ensures that variables are of the correct type and performs …
---+V15.3.6 Verify that JavaScript code is written in a way that prevents prototype pollution, for example, by …
---+V15.3.7 Verify that the application has defenses against HTTP parameter pollution attacks, particularly if …

V15.3 Defensive Coding

This section covers vulnerability types, including type juggling, prototype pollution, and others, which result from using insecure coding patterns in a particular language. Some may not be relevant to all languages, whereas others will have language-specific fixes or may relate to how a particular language or framework handles a feature such as HTTP parameters. It also considers the risk of not cryptographically validating application updates.

It also considers the risks associated with using objects to represent data items and accepting and returning these via external APIs. In this case, the application must ensure that data fields that should not be writable are not modified by user input (mass assignment) and that the API is selective about what data fields get returned. Where field access depends on a user's permissions, this should be considered in the context of the field-level access control requirement in the Authorization chapter.

1. Overzicht

Titel Standaard
V15.3.1 Verify that the application only returns the required subset of fields from a data object. For …

Verify that the application only returns the required subset of fields from a data object. For example, it should not return an entire data object, as some individual fields should not be accessible to users.

V15.3.2 Verify that where the application backend makes calls to external URLs, it is configured to not …

Verify that where the application backend makes calls to external URLs, it is configured to not follow redirects unless it is intended functionality.

V15.3.3 Verify that the application has countermeasures to protect against mass assignment attacks by …

Verify that the application has countermeasures to protect against mass assignment attacks by limiting allowed fields per controller and action, e.g., it is not possible to insert or update a field value when it was not intended to be part of that action.

V15.3.4 Verify that all proxying and middleware components transfer the user's original IP address …

Verify that all proxying and middleware components transfer the user's original IP address correctly using trusted data fields that cannot be manipulated by the end user, and the application and web server use this correct value for logging and security decisions such as rate limiting, taking into account that even the original IP address may not be reliable due to dynamic IPs, VPNs, or corporate firewalls.

V15.3.5 Verify that the application explicitly ensures that variables are of the correct type and performs …

Verify that the application explicitly ensures that variables are of the correct type and performs strict equality and comparator operations. This is to avoid type juggling or type confusion vulnerabilities caused by the application code making an assumption about a variable type.

V15.3.6 Verify that JavaScript code is written in a way that prevents prototype pollution, for example, by …

Verify that JavaScript code is written in a way that prevents prototype pollution, for example, by using Set() or Map() instead of object literals.

V15.3.7 Verify that the application has defenses against HTTP parameter pollution attacks, particularly if …

Verify that the application has defenses against HTTP parameter pollution attacks, particularly if the application framework makes no distinction about the source of request parameters (query string, body parameters, cookies, or header fields).

1.1 Referenties

1.2 Geïdentificeerde eisen

1.3 Gerelateerde regelingen

2. Geïdentificeerde eisen

Eisen
Bron Eis

3. Gerelateerde regelingen

Regelingen
Bron Regelgeving
  • OWASP -

    EN: Publications of the OWASP Foundation, https://owasp.org/. OWASP® is a registered trademark of the OWASP Foundation, Inc.; GRCA is not affiliated with, nor endorsed by, the OWASP Foundation. Only the versions published by OWASP are authoritative.

    DE: Veröffentlichungen der OWASP Foundation, https://owasp.org/. OWASP® ist eine eingetragene Marke der OWASP Foundation, Inc.; GRCA steht in keiner Verbindung zur OWASP Foundation und wird von ihr nicht unterstützt. Maßgeblich sind allein die von OWASP veröffentlichten Fassungen.