PHP2Shell Enterprise Server Security Response
Start responding to PHP2Shell by updating PHP and restarting it on the live web service. If a breach is suspected, preserve evidence first. Log checks and credential rotation are needed even after patching.
- Check PHP usage on production servers and in products that include it.
- If a breach is suspected, isolate the server and preserve evidence before restarting.
- Apply a fixed version, or use the official temporary measures until you can update.
- Restart the service running PHP, then verify that the patch has taken effect on the live web service.
- Review past logs and rotate credentials on exposed servers.
Responding to PHP2Shell starts with identifying where PHP is used and applying a fixed version. Restart the services that run PHP after updating. If you suspect a compromise, preserve evidence before restarting. Log reviews and credential changes are also necessary after patching.
The versions and settings are based on the KISA notice dated October 22, 2026, and the additional PHP notice dated October 23.
What kind of vulnerability is PHP2Shell?
PHP2Shell is a PHP vulnerability that allows server-side code execution without authentication. It involves memory management while a web server processes requests. Whether an attack succeeds depends on the runtime environment and configuration.
| Category | Identifier | Nature of the issue |
|---|---|---|
| Out-of-memory handling issue | CVE-2026-109618 | Processes incomplete internal data under out-of-memory conditions |
| State left between requests | CVE-2026-109619 | Uses state pointing to freed memory in subsequent requests |
KISA lists the severity of both vulnerabilities as CVSS 9.2. A successful attack could allow web shell installation or customer data theft. A web shell is a file used to gain unauthorized remote control of a server. Attacks could also lead to website defacement and intrusion into internal networks.
KISA reported information disclosure and attempted attacks before patches were released. The researchers disclosed how they used AI to discover the vulnerabilities. The issues are in PHP itself and are not limited to a particular website product. KISA response guidelines for businesses, Researchers' explanation of PHP2Shell
Response sequence by situation
The order of updating and preserving evidence depends on whether a compromise is suspected. For routine patching, test first, then update and restart. Isolate servers with a suspected compromise first.
| Current status | What to do first | What to do next |
|---|---|---|
| Public-facing server with no signs of compromise | Review compatibility and apply a fixed version | Restart, verify the version actually running, and review logs |
| Web shell or suspicious connection found | Isolate the server from the network and report the incident | Preserve evidence, then take recovery measures |
| Server that cannot be updated immediately | Apply official temporary settings and upstream request limits | Schedule and apply the patch |
| Server where even temporary measures are difficult | Consider blocking external access or temporarily suspending service | Decide whether to resume after patching |
| Environment managed by a hosting provider or manufacturer | Ask the provider whether the fix has been applied | Obtain evidence that the runtime environment reflects the fix |
Restarting after an update ensures that the fixed code runs. During incident response, restarting is delayed to preserve evidence. Even on the same server, follow the latter sequence if a compromise is suspected.
How to identify where PHP is used
Check both your asset inventory and the servers actually running. Checking only the main website can miss servers that have fallen outside routine management. Devices and containers that include PHP must also be checked.
- List websites and systems exposed to the internet.
- Check outsourced websites and older websites.
- Check event servers, test servers, and admin pages.
- Check whether device management interfaces and software solutions include PHP.
- Check container images and running containers.
- Record the PHP version and the person responsible for each environment.
If you use hosting, ask the provider to confirm whether patches have been applied. For PHP embedded in devices, check for manufacturer updates. Check internal systems too, but address internet-facing servers first.
Fixed PHP versions and end-of-support criteria
The fixed version for the 8.5 branch in the official PHP notice is 8.5.12. The original KISA notice lists the same version. This does not mean you must wait for 8.5.13 to patch.
| Branch in use | Versions with fixes for both vulnerabilities | Response criteria |
|---|---|---|
| PHP 8.5 | At least 8.5.13 | Check the latest security release for this branch |
| PHP 8.4 | At least 8.4.27 | Check the latest security release for this branch |
| PHP 8.3 | At least 8.3.36 | Check the latest security release for this branch |
| PHP 8.2 | At least 8.2.35 | Patch and prepare to move to a newer branch |
| PHP 8.1 or earlier | Regular security support has ended | Move to a supported branch or check for vendor patches |
The table is based on the fixed versions announced on October 21, 2026. Distribution packages may retain the same displayed version. In that case, check the changelog to see whether both CVEs have been fixed. PHP security release notice
Security support for PHP 8.2 ends on December 31, 2026. KISA recommends moving to PHP 8.3 or later. Test application compatibility before migrating. PHP support schedule
Regular security support has ended for PHP 8.1 and earlier. Patches from distributions or long-term support providers must be checked separately. The source patches released for older versions this time do not mean that regular support has resumed.
How to update and restart
After replacing the installed files, restart the services that run PHP. Existing processes may continue running code still in memory. If you suspect a compromise, preserve evidence before carrying out the steps below.
- Review how the patch affects existing functionality.
- Check service compatibility in a test environment.
- Apply the fixed packages to internet-facing servers first.
- Restart all services that run PHP.
- For container environments, redeploy using fixed images.
- Verify that the update is reflected in the PHP instance that handles actual web requests.
Services to restart include PHP-FPM and Apache mod_php. Also check php-cgi, FrankenPHP, and LiteSpeed. If a server has multiple PHP environments, check each one.
php -v shows the version of PHP running on the command line. It may differ from the PHP used by the web service. Do not judge an update complete based only on command-line output.
Temporary configuration guidelines before updating
Temporary measures reduce some attack paths. They do not resolve all the vulnerabilities. If applying the settings is difficult, consider blocking external access.
How should memory_limit be configured?
The official temporary recommendation for this vulnerability is memory_limit=-1. This value removes PHP's own memory usage limit. Do not treat it as a normal production setting.
Removing the limit reduces certain paths that trigger out-of-memory conditions. It does not prevent actual memory allocation failures. Request size limits and resource management measures must also be considered. PHP out-of-memory vulnerability advisory
| Item | Official temporary measure | What to check when applying it |
|---|---|---|
memory_limit |
Set to -1
|
Apply an administrator-level setting so the application cannot change it |
session.upload_progress.enabled |
Set to 0
|
Use a configuration location that takes effect before request processing |
post_max_size |
8M is an example when uploads are unnecessary |
Review actual service requirements together with upstream limits |
upload_max_filesize |
Set to less than post_max_size
|
Check the impact on file upload functionality |
fatal_error_backtraces |
Set to 0 in PHP 8.5 |
Do not apply indiscriminately to other branches |
The settings in the table are based on the official response notices from October 2026. 8M is an example given for services that do not need uploads. It is not a standard size to apply to every service.
- Limit request sizes at the web application firewall, web server, and proxy.
- Check whether limits also apply to requests without size information.
- If uploads are unnecessary, block multipart requests upstream.
- Check the latest blocking rules for your web application firewall.
- Apply the settings in locations such as
php.inior the PHP-FPM pool configuration. - Check whether evidence must be preserved, then restart the PHP processes.
Do not apply temporary settings using only ini_set(). Settings needed before request processing may take effect too late. Do not expect PHP-FPM's .user.ini to serve that role either. Official PHP temporary measures
What to check in the additional October 23 notice
In its additional notice, PHP recommended disabling the upload progress feature. The notice addresses a separate execution path remaining under certain configuration combinations. If the feature is already disabled, the recommendation is to keep it disabled until the next regular bug-fix release.
The relevant conditions include changing the session serialization method at runtime. These conditions do not apply to every PHP installation. Check the additional notice before deciding whether to restore settings after patching. (Confirmed setting: recommendation to keep session.upload_progress.enabled=0 until the next regular bug-fix release · Source: php.net · Verified on 2026-10-23) Additional PHP Session upload progress notice
How to review logs and change credentials
KISA recommends reviewing, at a minimum, records from October 20, 2026 onward. Check earlier records too, if possible. Patching cannot undo a compromise or information leak that has already occurred.
| Review target | Signs to look for |
|---|---|
| Web server logs | Repeated HTTP 500 errors |
| PHP execution records | Abnormal termination and segfaults |
| Web, upload, and temporary folders | New or modified PHP files |
| Process execution records | The web server running sh, bash, or download tools |
| Network connections | Signs of new connections to unfamiliar external addresses |
| Website and admin pages | External scripts added without authorization |
Errors alone do not confirm a compromise. Conversely, the absence of unusual records does not confirm safety. KISA provides the following guidance.
Even if records show no anomalies, safety is not guaranteed, so carry out updates and credential changes together
KISA, “Business Security Response Guidelines for PHP Security Vulnerabilities (PHP2Shell)”
Credential changes are recommended for servers exposed to the internet before patching. Be sure to change credentials on servers where signs of compromise are found. This includes database passwords and administrator passwords. Also check whether API keys and access tokens may have been exposed.
For services connected to databases containing personal information, review database records too. Check for signs of bulk queries and data exfiltration. Also restrict direct internet access to phpMyAdmin. Reduce the web service account's database permissions to only what is needed. Personal Information Protection Commission preventive measures notice
Response sequence when a compromise is suspected
If you suspect a compromise, do not shut down the server or restart it immediately. Restarting may erase traces of an attack remaining in memory. Isolate the server from the network, then collect evidence.
- Block the server's external access at the network level.
- Businesses in South Korea should report the incident through the incident reporting menu on Boho Nara.
- Preserve logs and a list of running programs.
- Also preserve information about current network connections.
- Update and restart after collecting evidence.
- Remove web shells and change credentials.
The support contact in South Korea is KISA 118. The reporting menu is Boho Nara > Report a Security Incident > Submit a Report. If you operate overseas, check the reporting channel for that region.
Common mistakes compared
Verifying that a patch has been applied requires checking the running state and changelog too. An installation-complete message alone is not enough. Add the following assumptions to your checklist.
| Common assumption | What to verify |
|---|---|
The job is done once php -v changes |
Check the PHP actually used by the web service |
| Installing the package is enough | Confirm that the services running PHP have been restarted |
| An unchanged version number means no action was taken | Check the distribution changelog for the CVE fixes |
| Having a web application firewall means patching can be skipped | Check the latest rules and update PHP as well |
| Clean logs mean no data was leaked | Also review the possibility of credential exposure |
| The vendor will handle outsourced websites on its own | Request evidence of the fix for each service |
Do not run verification code found online on production servers. KISA warns of fake PoCs containing malware. A PoC is verification code that demonstrates whether a vulnerability can be exploited. Start by checking versions and patch histories to determine whether a system is vulnerable.
Completion checklist for outsourced and hosting environments
It is good practice to include supporting evidence for each service in a completion report. The table below groups the KISA response guidelines into operational check items. It is not a separate official submission form.
| Check item | What to request from the provider or person responsible |
|---|---|
| Missing targets | A checklist covering websites, admin pages, and test servers |
| Vulnerability fixes | The applied version or a package changelog listing both CVEs |
| Running state | Records of service restarts or container redeployments |
| Actual application of the fix | The PHP runtime environment verified through the web service |
| Compromise review | The period of logs reviewed and any findings |
| Credentials | Credentials to be changed and whether the changes are complete |
| Remaining work | Servers with only temporary measures applied and follow-up patch plans |
For example, suppose a provider reports only that package installation is complete. In that case, request the results of restart checks and verification of the web runtime environment. Log reviews and credential changes can be checked as separate items.
FAQ
Can PHP2Shell be blocked by changing the login password?
It can be exploited without logging in, so changing the password alone does not resolve the issue. A PHP security update is required. Rotating credentials is a separate measure to address possible exposure.
For PHP 8.5, do I need to wait until 8.5.13?
The original PHP and KISA notices list 8.5.13 as the fixed version for both vulnerabilities. This does not mean you need to wait for 8.5.13. When applying an update, also check the latest official release in that version series.
If I use PHP-FPM, can I skip the checks?
PHP-FPM also needs to be checked. The conditions required for an attack may vary depending on how PHP is run. Do not judge safety based solely on the environment's name.
If php -v shows a fixed version, is remediation complete?
The command-line PHP version may differ from the PHP version used by the web service. Check the environment that actually handles web requests. You must also check whether the running service has been restarted.
If the version number stays the same after patching, did the patch fail?
Distribution or vendor packages may incorporate fixes into existing versions. Check the package changelog to see whether fixes for both CVEs have been included.
Is memory_limit=-1 prohibited as part of the response to these vulnerabilities?
The official temporary guidance for these vulnerabilities includes this setting. It must be distinguished from general operational recommendations. Also review request limits and resource management measures.
Are sites without file uploads also affected?
A site cannot be ruled out as affected simply because it has no upload feature. These are vulnerabilities in PHP itself, so check the version in use and its patch status. Blocking unnecessary multipart requests is a temporary measure.
If a vendor patch is available for PHP 8.1 or earlier, can I keep using it?
Vendor patches must be checked separately from the end of regular support. Even if you apply such a patch temporarily, make a plan to move to a supported version.
If there is nothing unusual in the logs, can I keep the existing credentials?
Logs alone cannot establish that no information was leaked. KISA recommends rotating credentials for servers that were exposed to the internet before patching. If there are signs of compromise, you must rotate them.
If I suspect a compromise, should I update first?
First, isolate the system from the network. Report the incident and preserve evidence before updating. Restarting may erase traces of the attack remaining in memory.
What should hosting users check?
Ask the provider for evidence that patches have been applied to each service. Also request the results of checks confirming restarts and the actual web runtime environment. Separately confirm whether logs have been checked and credentials rotated.
Can I re-enable the upload progress setting after patching?
Check PHP's additional notice dated October 23, 2026. Keeping the feature disabled is recommended because of additional issues with some combinations of settings. Decide whether to restore the settings after checking subsequent fixes.
Sources
- KISA Boho Nara: Corporate security response guidelines for the PHP security vulnerability (PHP2Shell), October 22, 2026
- PHP 2026 notices: October 21 security update and October 23 additional guidance on Session upload progress
- PHP security advisory: RCE via OOM corruption
- PHP security advisory: RCE via stale global state
- PHP Supported Versions: Official support period
- PHP2Shell: Researchers' explanation of the vulnerability and the scope of its impact
- Personal Information Protection Commission: Call for measures to prevent personal information leaks related to the PHP security vulnerability, October 22, 2026
Images

