Back to Articles

PHP Critical Vulnerabilities 2026 You Should Patch

I've been using PHP since 2013 when I was in high school. For many years, PHP was the go-to language for web development, especially for Content Management Systems (CMS). However, as technology evolves, new languages and frameworks emerge, each with its own strengths and weaknesses.

Recently, there have been some critical vulnerabilities discovered in PHP 8.5, and I've decided to write this article to share my thoughts and insights on the matter.

Critical Vulnerabilities

CVE-2026-109618

This vulnerability arises when an OOM (Out Of Memory) condition in PHP is triggered. PHP uses longjmp() (C-level mechanism) function to abort execution and clearing the request process if memory_limit is exceeded. However, in certain initialization contexts, longjmp() abruptly interrupts PHP execution, skipping the local cleanup and initialization code, and causes PHP's internal memory to be in uninitialized state.

This vulnerability is particularly critical because it can be triggered by an attacker through carefully crafted PHP code, potentially leading to remote code execution (RCE).

The attacker sends a maliciously crafted request to the server until PHP memory_limit is reached (This can be achieved with massive file upload request). If the condition above is met, the attacker can execute arbitrary code on the server.

CVE-2026-109619

This vulnerability focuses on stale global state in PHP's worker process. The root cause is when a fatal error occurs midway, PHP will halt the operations. However, there are some error handling that is maintained by the worker process and that status still point to the freed memory region belonging to an earlier request.

What is the attack mechanism?

  • The attacker sends an upload file request which was intentionally interrupted to cause fatal error, forcing PHP to delete session data and leaving behind a dangling pointer.
  • After that the attacker sends another request. By leveraging the dangling pointer, the attacker can overwrite the session data with their own malicious data, this method called "heap spraying".
  • The worker inadvertently executes a malicious program while reading that stale global pointer which could lead to RCE (Remote Code Execution).

Mitigations

Update PHP version

Update your PHP version on the server to the latest version immediately and restart your PHP-FPM (or equivalent service). The PHP community has released patches for both vulnerabilities in versions >= 8.2. Unfortunately, those still using old PHP version (e.g PHP 8.1, 8.0, 7.x or below) are not getting any patches and need to upgrade to newer PHP version to mitigate this vulnerability.

PHP BranchStatus (2026)Latest Patched VersionOfficial Patch Status
PHP 8.5Active Support8.5.12 (or >= 8.5.12)✅ Patched
PHP 8.4Active Support8.4.27 (or >= 8.4.27)✅ Patched
PHP 8.3Security Support8.3.36 (or >= 8.3.36)✅ Patched
PHP 8.2Security Support8.2.35 (or >= 8.2.35)✅ Patched
PHP 8.1End of Life (EOL)None (Unpatched)❌ No Official Patch
PHP 8.0End of Life (EOL)None (Unpatched)❌ No Official Patch
PHP 7.x & belowEnd of Life (EOL)None (Unpatched)❌ No Official Patch

Mitigate for EOL PHP version

  • If you are still using EOL PHP version, you can patch this vulnerability by applying the minimal source code backports manually. The patch is available in the PHP source code repository.
  • Install the WAF (Web Application Firewall) such as Cloudflare, though this will not permanently resolve the vulnerability, it can help mitigate the impact of the vulnerability.
  • Alternatively, you can also use commercial support services for EOL PHP version patch such as Ubuntu Pro, Tuxcare, etc.

Conclusion

I hope this article gives you a comprehensive understanding of the recent PHP vulnerabilities and how to mitigate them, here is a quick checklist to review :

  • Verify PHP Version: Ensure all production servers run patched versions (>= 8.2).
  • Restart Services: Always execute a full restart of php-fpm (or your process manager) after applying updates.
  • Review Upload Limits & OOM Handling: Audit memory_limit and upload buffer sizes to prevent attackers from intentionally exhausting worker memory..