title: Temporary files are not cleaned after OOM when parsing HTTP request data
description: In PHP versions 7.2.x below 7.2.31, 7.3.x below 7.3.18 and 7.4.x below 7.4.6, when HTTP file uploads are allowed, supplying overly long filenames or field names could lead PHP engine to try to allocate oversized memory storage, hit the memory limit and stop processing the request, without cleaning up temporary files created by upload request. This potentially could lead to accumulation of uncleaned temporary files exhausting the disk space on the target server.
problem types: CWE-400 Uncontrolled Resource Consumption
affected:
{
product: PHP
vendor: PHP Group
versions:
lessThan: 7.3.18, status: affected, version: 7.3.x, versionType: custom
lessThan: 7.4.6, status: affected, version: 7.4.x, versionType: custom
lessThan: 7.2.31, status: affected, version: 7.2.x, versionType: custom
}
metrics:
cvssV3_1: [
attackComplexity: LOW
attackVector: NETWORK
availabilityImpact: LOW
baseScore: 5.3
baseSeverity: MEDIUM
confidentialityImpact: NONE
integrityImpact: NONE
privilegesRequired: NONE
scope: UNCHANGED
userInteraction: NONE
vectorString: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
version: 3.1
]
workarounds: Setting post_max_size to value significantly lower than the memory limit prevents this issue from being exploited. Disabling file uploads also prevents this issue from happening.