
PHP2Shell Vulnerability: How to Check and Protect Your Website and NAS
This post was translated from the original Korean article. Screenshots show the Korean interface.
Two critical PHP vulnerabilities that let attackers run commands on a server remotely without logging in (CVE-2026-109618 and CVE-2026-109619, together known as PHP2Shell) were disclosed on October 21, 2026. The PHP team released fixed versions (8.5.12, 8.4.27, 8.3.36, 8.2.35) the same day, and attack attempts were observed even before disclosure. If you run a website or online store on PHP, or have a home NAS exposed to the internet, check now.
This article is based on the official PHP advisory, CISA and KISA (Korea Internet & Security Agency) announcements, and NAS vendor security advisories, as of October 26, 2026. The situation is still evolving, so please also check the original sources listed under References.
What Is the Problem?
| Item | Details |
|---|---|
| Vulnerabilities | CVE-2026-109618 (corruption during out-of-memory handling), CVE-2026-109619 (use of freed memory) |
| Severity | Both CVSS v4.0 9.2 (Critical) |
| Attack conditions | Remote code execution with a web request alone, no authentication |
| Scope | Every PHP installation that serves web requests (PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed) |
| Fixed versions | 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 (released October 21, 2026) |
- CVE-2026-109618: If PHP hits its memory limit partway through processing request data, the cleanup stage treats the half-built data as valid. Because it triggers while PHP is still reading the request, before any application code runs, a login page or security plugin cannot stop it.
- CVE-2026-109619: Internal state from one request survives after its memory has been freed, and is reused by the next request handled by the same worker process (a use-after-free). It was confirmed through the session upload progress feature, which is enabled by default.
- The PHP team says mod_php (Apache module mode) carries the highest risk. The vulnerable code path is reported to date back to PHP 5.4.
Attacks in the wild (confirmed so far):
- Amazon Threat Intelligence says its honeypots saw attack attempts from October 17, four days before disclosure, and the security firm watchTowr has observed attempts since October 21. Whether these attempts actually succeeded has not been disclosed.
- The CVE IDs spread on social media shortly before disclosure, so PHP moved the release up from October 22 to October 21 (14:00 UTC).
- The US CISA issued an alert on October 21 urging immediate patching. For organizations that cannot update right away or run PHP 8.1 or earlier, it recommends keeping PHP systems offline until they are patched. As of October 23, neither CVE was in the Known Exploited Vulnerabilities (KEV) catalog.
- In South Korea, KISA recommended updating on October 22, and the same day the Ministry of Science and ICT and KISA raised the private-sector cyber threat level from “Interest” to “Caution”.
Does This Apply to Me?
The key question is whether your site or device uses PHP.
| Environment | Affected? | What to check |
|---|---|---|
| PHP-based websites and stores such as WordPress, Gnuboard, XE (Rhymix), Zeroboard, Joomla, Drupal, Magento | Yes | The server’s PHP version |
| Web hosting (in Korea, e.g. Cafe24, Gabia) | Yes (the host manages the server) | Your host’s notice and your plan’s PHP version |
| Linux servers and VPSs you run yourself | Yes | Distribution security updates |
| NAS (Synology, QNAP, ASUSTOR, TerraMaster, etc.) | Possibly | Vendor advisories, whether web services or PHP packages are in use |
| Static sites (Astro, Hugo, Jekyll, etc.), Node.js/Python/Java servers, hosted blog platforms | No | Just confirm no PHP admin tool (such as phpMyAdmin) runs on the same server |
- A site built from static files, like this blog, runs no PHP on the server and is not affected.
- If you only use a PC or smartphone, there is nothing to do directly. However, personal data may leak from sites that get attacked, so if you reuse the same password across sites, this is a good time to change it.
- Some devices with a web admin page, such as routers, CCTV recorders, and smart-home hubs, also use PHP. Check for firmware updates from the manufacturer.
How to Check
1. Check the PHP version on your server
If you can connect to the server over SSH, check with the command below.
php -v
However, the command-line (CLI) PHP and the PHP that handles web requests may be different versions. If you installed PHP from distribution packages, check the package versions too.
dpkg -l | grep php
rpm -qa | grep php
The first line is for Debian/Ubuntu, the second for RHEL, Rocky, and AlmaLinux. Distributions often keep the version number and only add the security fix (a backport), so do not rely on the version number alone; check your distribution’s security advisory for the package version that fixes these CVEs.
2. Do not leave a phpinfo file in a public location
If you created a file that calls phpinfo() to check the version through the web, delete it as soon as you are done. That page shows the PHP version, settings, and paths, which attackers use to pick vulnerable servers. Also make sure no old files named info.php or phpinfo.php are still lying around.
3. Web hosting users: check your host’s notice
On web hosting, the host manages PHP, so you cannot patch it yourself. Major Korean hosting companies responded quickly this time.
- Gabia: Announced that it applied PHP security patches to PHP 7.4, 8.4, and 8.5 on its web hosting between midnight and 3 a.m. on October 22 (KST).
- Cafe24: Announced its official security patch work and said it added separate protections for older versions that have no official fix. It does not modify customers’ source code, however.
For readers outside Korea, check your own hosting provider’s status page or support notices the same way. Confirm in your host’s notice whether your plan’s PHP version is covered by the patch. If you run an old store or message board on an old PHP version (7.x or earlier), the host’s protections are only a stopgap, so plan a PHP version upgrade. Depending on the plan, files or databases may be reset when you change the PHP version, so always download a backup first, and after the switch confirm that key features such as boards, member login, and payments still work.
What to Do
1. Update to a fixed version
| Your version | Action |
|---|---|
| PHP 8.5 | Update to 8.5.12 or later |
| PHP 8.4 | Update to 8.4.27 or later |
| PHP 8.3 | Update to 8.3.36 or later |
| PHP 8.2 | Update to 8.2.35 or later (8.2 reaches end of life on December 31, 2026) |
| PHP 7.4 / 8.0 / 8.1 | No official release. The PHP security team published source backports only → use distribution/LTS vendor packages or move to 8.3+ |
| PHP 7.3 and older (including PHP 5) | End of life, no fix → move to a supported version and block outside access until then |
On a Linux server, apply your distribution’s security updates and then restart the PHP workers, or the fix will not take effect.
sudo apt update && sudo apt upgrade
sudo dnf upgrade --refresh
After updating, restart the php-fpm service or Apache and check the version again using step 1. For PHP apps running in Docker, updating the host does not help; you need to pull the new container image and recreate the container.
2. Interim mitigations if you cannot patch right away
These are the interim measures from the official PHP advisory. The PHP team says no configuration change fully mitigates these vulnerabilities, so use them only to buy time until you can update.
- CVE-2026-109618: Set
memory_limit=-1throughphp_admin_valuein the PHP-FPM pool or Apache configuration, and make sure nothing else re-applies a limit. Since this removes the memory limit, set a lowpost_max_size(8M if you do not need file uploads, 32M if you do) and limit request sizes at the web server or proxy. - CVE-2026-109619: Add
session.upload_progress.enabled=0to php.ini or the FPM pool configuration. On PHP 8.5, also addfatal_error_backtraces=0. Usingini_set()or.user.inihas no effect. - After changing settings, restart all PHP workers for them to apply.
3. Temporary blocking with a WAF
Cloudflare has deployed WAF rules that block known attack patterns to all plans, including the free plan. If your site goes through the Cloudflare proxy (orange cloud), check that the WAF managed rules are enabled in the dashboard. Note that requests that bypass Cloudflare and hit your server IP directly are not blocked, and Cloudflare itself calls this a stopgap.
4. Block outside access until patched
If you are on an old version with no patch, or the update is delayed, blocking access from the internet is the most reliable option, as CISA and CERT-EU advise. For admin-only sites, allow only your own IP in the firewall, and if a site does not need to be public, consider taking it down for a while. It may already have been attacked before you patched, so after updating, check that no unknown PHP files have appeared in the web root and that no new admin accounts have been created.
Checking and Protecting Your NAS
A NAS is easy to forget about at home, and many people expose it to the internet through router port forwarding or QuickConnect for remote access, so it needs extra attention with this vulnerability. Most NAS devices use PHP in their web admin interface or in their web server, photo, and note apps.
Synology DSM 7.x
Synology published a security advisory (Synology-SA-26:14) on October 22 and marked it Resolved.
- Affected: Packages that use PHP. Synology’s list is Web Station, WordPress, phpMyAdmin, Joomla, MediaWiki, MailStation, Calendar, KodExplorer, vtigerCRM, and IDrive (third-party). Synology Drive is not affected.
- DSM itself: DSM includes a PHP component for internal use, but Synology says it has no externally accessible modules, so the risk is low. A patch is planned for a later DSM update.
- Action (DSM 7.2, 7.3, 7.4): Open Package Center, find the PHP packages (PHP 7.4, PHP 8.x, etc.) in the Installed list, and update them. The packages that depend on them restart automatically. MailStation must be updated manually.
- According to a summary by the security firm Kaspersky, the PHP 7.3 package will not be fixed, so if it is installed, move the apps that use it to PHP 7.4 or later and remove it.
- Search Package Center for Web Station, WordPress, and phpMyAdmin to see whether they are installed, and stop or remove any you do not use.
Older DSM 6.x, Xpenology, and other NAS that cannot get patches
Synology has not released PHP updates for DSM versions earlier than 7.2 and advises temporarily disabling the affected packages. Xpenology (DSM installed unofficially on non-Synology hardware) is not supported by the vendor, so there is no guarantee updates will work. For these devices, the key is “close it off” rather than “fix it”.
- Turn off unused web services: In Package Center, stop or remove Web Station, WordPress, phpMyAdmin, and PHP packages.
- Clean up router port forwarding: In your router’s port forwarding list, delete rules that forward the DSM admin ports (5000/5001) and web ports (80/443) to the NAS. Also check any custom ports you set.
- Turn off UPnP: Disable automatic port opening via UPnP on both the router and DSM. If it stays on, ports you deleted may be reopened.
- Turn off QuickConnect: If you do not use it, turn off QuickConnect under External Access in the DSM Control Panel.
- Use only a VPN for remote access: If you need the NAS away from home, use a VPN such as Tailscale instead of opening ports. I set up my own TrueNAS photo backup server so it is reachable only through Tailscale, with no open ports. (TrueNAS + Immich + Tailscale build log)
- Restrict access with the DSM firewall: Enable the firewall under Security in the Control Panel, allow only your home network (e.g. 192.168.0.0/24) and VPN range, and deny everything else. You can also allow by country (e.g. only your own), but that does not stop attacks from IPs in your country.
Even apart from this PHP issue, the bigger risk with old DSM versions is that newly found security vulnerabilities keep going unfixed. Do not expose them to the internet; use them on the local network only, and in the long run consider moving to a supported DSM version or a different NAS.
QNAP (QTS / QuTS hero)
QNAP published security advisory QSA-26-18 on October 22 and released fixed firmware on October 24.
| Product | Fixed version |
|---|---|
| QTS 5.2.11 and earlier | QTS 5.2.11.3661 build 20261023 |
| QTS 6.1.0 | QTS 6.1.0.3656 build 20261023 |
| QuTS hero h5.2.11 and earlier | h5.2.11.3661 build 20261023 |
| QuTS hero h6.0.x / h6.1.0 | h6.0.2.3656 / h6.1.0.3656 build 20261023 |
| QuTScloud c5.2.9 and earlier | c5.2.9.3661 build 20261023 |
| Note Station 3, QVR Surveillance (ARM32), QNE, TVR OS | Fixing (to be announced) |
- Update from Live Update under Control Panel > System > Firmware Update.
- QNAP’s advice until you can update: turn off router port forwarding and UPnP, disable UPnP port forwarding and myQNAPcloud Link in myQNAPcloud, use QVPN or your router’s VPN for remote access, allow the management ports (default 8080 and 443) only from trusted networks, and stop unused apps in App Center.
- To check for compromise: look for unexpected logins in QuLog Center, and run Security Center and Malware Remover with current definitions.
- PHP inside Container Station containers or third-party apps is not fixed by QNAP updates, so each image or app must be updated separately.
ASUSTOR (ADM)
ASUSTOR published security advisory AS-2026-023 (initial release October 22, revised October 23).
- ADM 5.0 / 5.1: Update PHP 8.3 to 8.3.36.r124 or later, or PHP 8.4 to 8.4.27.r106 or later
- ADM 4.1–4.3: Update PHP 8.3 to 8.3.36.r3 or later
- ADM 3.5 / 4.0: No fixed version → turn off the web server in Web Center and remove old PHP versions
- The end-of-life PHP 7, 7.3, 7.4, and 8.1 packages have been removed from App Central. If any are installed, remove them and use only PHP 8.3 or later.
TerraMaster (TOS) and other vendors
As of October 26, 2026, I could not find an official PHP2Shell security notice from TerraMaster. According to overseas reports, the company said on October 22 that it was investigating and testing. I also could not confirm official patches from other vendors such as UGREEN. For these products, reduce internet exposure with the common steps below until a patch is released.
If you run PHP apps such as Nextcloud or WordPress as containers (apps) on a NAS like TrueNAS or Unraid, update those apps to the latest version.
Common NAS checklist
| Check | What to do |
|---|---|
| Ports open to the internet | Review every router port forwarding rule pointing to the NAS and delete those you do not need |
| UPnP | Turn it off on both the router and the NAS (so ports are not reopened automatically) |
| Unused web services | Stop or remove unused web server, WordPress, phpMyAdmin, note, and photo apps |
| Remote access method | Use a VPN (Tailscale, etc.) instead of port forwarding or cloud relay |
| Admin account | Disable the default admin account, turn on two-factor authentication, change the password |
| Logs | Check recent login and connection logs for unknown IPs or odd times |
| Updates | Keep firmware (OS) and all installed packages and apps up to date |
| Backup | Keep an offline backup separate from the NAS, such as on an external drive |
Summary
| Situation | What to do |
|---|---|
| PHP server you manage | Update to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 or later, then restart workers |
| PHP 8.1 or earlier | Move to a supported version; block outside access until then |
| Web hosting | Check your host’s notice for your PHP version; if old, back up and switch versions |
| Cannot patch right away | Interim settings + WAF + block outside access (not a complete fix) |
| Synology DSM 7.2 or later | Update PHP packages in Package Center; update MailStation manually |
| DSM 6.x / Xpenology | Stop packages that use PHP; turn off port forwarding, UPnP, and QuickConnect; connect only via VPN |
| QNAP / ASUSTOR | Update firmware and PHP packages to the fixed versions in the vendor advisory |
| Static sites, Node.js, etc. | Not affected |
References
- PHP: Security advisory — Critical remote code execution vulnerabilities (2026-10-21)
- GitHub php-src security advisory: CVE-2026-109618 (GHSA-w8hw-w9fx-j79w)
- GitHub php-src security advisory: CVE-2026-109619 (GHSA-6wmf-4rv5-p3rp)
- CISA: Critical Vulnerabilities in PHP Require Immediate Patching (2026-10-21)
- CERT-EU Security Advisory 2026-018
- Kyunghyang Shinmun: KISA recommends PHP security update (2026-10-22, Korean)
- Synology Statement on PHP2Shell Vulnerabilities (Synology-SA-26:14)
- QNAP QSA-26-18: Vulnerabilities in PHP (PHP2Shell)
- ASUSTOR AS-2026-023: PHP (PHP2Shell)
- Kaspersky: How new PHP vulnerabilities threaten home users
- Gabia: Emergency PHP security patch for web hosting (Korean)
- Cafe24: Official PHP security patch notice (Korean)
- Financial News: Web hosts finish emergency PHP response, but old store versions remain a challenge (2026-10-26, Korean)
- Tenable: php2shell FAQ
- Datadog Security Labs: PHP2Shell detection, analysis, and remediation
- Amazon: PHP2Shell exploitation prior to public disclosure



Comments
No comments yet. Feel free to leave a question or comment.