Fix the Detected PHP2Shell and Node2Shell Vulnerabilities

Perform the following steps to fix the PHP2Shell and Node2Shell vulnerabilities reported by the scan:

  1. Review the detections for QIDs 520310, 533086, 520404, and 533203. Start with your internet-facing assets, and then fix each affected runtime.

  2. Upgrade each affected runtime to a fixed version.

    • PHP: 8.5.12, 8.4.27, 8.3.36, or 8.2.35. You can also use the backported build from your distribution.
    • Node.js: 22.23.4, 24.22.1, or 26.12.1. If you are running an end-of-life branch, such as 25.x, 23.x, 21.x, or 20.x or older, upgrade to one of the mentioned versions.

    If you cannot upgrade right away, apply a temporary mitigation and restrict access to the service until it is patched. For example, set session.upload_progress.enabled=0 or limit the Brotli payload size at the proxy.

    For the fixed versions and the temporary mitigation, see the vendor advisories, for example:

  3. Restart the affected services, such as mod_php, PHP-FPM, php-cgi, FrankenPHP, LiteSpeed, and any long-running Node.js services. Until you restart them, the running processes keep the vulnerable code in memory.

  4. Scan the same applications again with the Trending Vulnerability Intrusive Options option profile to confirm the fix. Run this scan only on patched systems or outside production, with the necessary approvals and within an approved maintenance window.

  5. If the QID is still reported, the fix is incomplete. Verify that the patched runtime is serving requests, then fix the application and rerun the scan.