Incorrect Behavior Order: Early Amplification

Draft Base
Structure: Simple
Description

The product allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.

Common Consequences 1
Scope: Availability

Impact: DoS: AmplificationDoS: Crash, Exit, or RestartDoS: Resource Consumption (CPU)DoS: Resource Consumption (Memory)

System resources, CPU and memory, can be quickly consumed. This can lead to poor system performance or system crash.

Demonstrative Examples 1

ID : DX-157

This function prints the contents of a specified file requested by a user.

Code Example:

Bad
PHP
php

//read file into string* $file = file_get_contents($filename); if ($file && isOwnerOf($username,$filename)){ ``` echo $file; return true; } else{ echo 'You are not authorized to view this file'; } return false; }

This code first reads a specified file into memory, then prints the file if the user is authorized to see its contents. The read of the file into memory may be resource intensive and is unnecessary if the user is not allowed to see the file anyway.
Observed Examples 1
CVE-2004-2458Tool creates directories before authenticating user.
Applicable Platforms
Languages:
Not Language-Specific : Undetermined
Modes of Introduction
Architecture and Design
Implementation
Taxonomy Mapping
  • PLOVER
Notes
RelationshipOverlaps authentication errors.