CVE-2020-7062

7.5 HIGH

📋 TL;DR

This CVE describes a null pointer dereference vulnerability in PHP's file upload progress tracking feature. When upload progress tracking is enabled with cleanup disabled and a file upload fails, PHP attempts to clean up non-existent data, causing a crash. This affects PHP applications with file upload functionality running vulnerable PHP versions.

💻 Affected Systems

Products:
  • PHP
Versions: PHP 7.2.x below 7.2.28, 7.3.x below 7.3.15, 7.4.x below 7.4.3
Operating Systems: All operating systems running affected PHP versions
Default Config Vulnerable: ✅ No
Notes: Requires specific configuration: upload progress tracking enabled (session.upload_progress.enabled = On) AND session.upload_progress.cleanup = Off (0)

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Denial of service causing PHP process crashes, potentially disrupting web application availability and file upload functionality.

🟠

Likely Case

Intermittent crashes of PHP processes when file uploads fail under specific configurations, leading to service disruption.

🟢

If Mitigated

No impact if proper PHP versions are used or if upload progress tracking is disabled.

🌐 Internet-Facing: MEDIUM - Web applications with file upload functionality exposed to the internet could experience DoS attacks.
🏢 Internal Only: LOW - Internal applications with controlled user access have lower exploitation risk.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires ability to trigger file upload failures with specific PHP configuration. No public exploit code identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: PHP 7.2.28, 7.3.15, 7.4.3 or later

Vendor Advisory: https://bugs.php.net/bug.php?id=79221

Restart Required: Yes

Instructions:

1. Update PHP to version 7.2.28+, 7.3.15+, or 7.4.3+ using your distribution's package manager. 2. Restart PHP-FPM or web server (Apache/Nginx). 3. Verify the update with php -v.

🔧 Temporary Workarounds

Disable upload progress tracking

linux

Set session.upload_progress.enabled = Off in php.ini to prevent the vulnerable code path

sed -i 's/^session.upload_progress.enabled = On/session.upload_progress.enabled = Off/' /etc/php/*/php.ini

Enable upload cleanup

linux

Ensure session.upload_progress.cleanup = On (default) to avoid the null pointer condition

sed -i 's/^session.upload_progress.cleanup = 0/session.upload_progress.cleanup = 1/' /etc/php/*/php.ini

🧯 If You Can't Patch

  • Disable file upload functionality in affected applications
  • Implement web application firewall rules to block or limit file upload attempts

🔍 How to Verify

Check if Vulnerable:

Check PHP version with php -v and verify configuration: grep -E 'session.upload_progress.(enabled|cleanup)' /etc/php/*/php.ini

Check Version:

php -v | head -1

Verify Fix Applied:

Confirm PHP version is 7.2.28+, 7.3.15+, or 7.4.3+ with php -v

📡 Detection & Monitoring

Log Indicators:

  • PHP segmentation fault errors in system logs
  • Web server error logs showing PHP process crashes during file uploads

Network Indicators:

  • HTTP 500 errors following file upload attempts
  • Unusual patterns of failed file upload requests

SIEM Query:

source="*php*" AND ("segmentation fault" OR "null pointer" OR "upload_progress")

🔗 References

📤 Share & Export