Daily Cyber Incidents · 22 October 2026
PHP2Shell: two critical PHP flaws let attackers run commands on web servers without a login
On 21 October 2026, the PHP team fixed two critical flaws, together called PHP2Shell (CVE-2026-109618 and CVE-2026-109619). They let a stranger make a PHP web server run commands without a login. Amazon saw a first attack attempt on 17 October, and attacks spread after the fix. Governments in Finland and the Netherlands took websites offline as a safety step. The only full fix is to update PHP and restart every worker.
Quick facts
- What: two critical flaws in PHP itself that allow remote code execution without a login.
- When: fix released on 21 October 2026; first attack attempt seen by Amazon on 17 October.
- Who is at risk: every PHP install that serves web pages (PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed).
- Fixed versions: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older need a vendor fix or an upgrade.
- Score: CVSS v4.0 9.2 for each flaw.
- Response: many sites went offline for a while; UK NCSC, CERT-EU and India's CERT-In issued warnings.
The full story (English, मराठी, हिंदी)
Pick your language. The story, the defence steps and the checklist are the same in all three.
PHP2Shell: the full story
1. What happened
PHP is the language that builds web pages on the server. WordPress, Drupal, Joomla and many control panels run on it. In this lesson you set PHP up and made its settings safe.
- On 21 October 2026, the PHP team released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. These fix two critical flaws: CVE-2026-109618 and CVE-2026-109619. Together they are called "PHP2Shell".
- Both flaws allow remote code execution (RCE) without a login. That means a stranger on the internet can make your server run their commands. Each flaw has a CVSS v4.0 score of 9.2.
- PHP says every PHP install that serves web pages is at risk: PHP-FPM, Apache with
mod_php, php-cgi, FrankenPHP and LiteSpeed. The risk is highest formod_php, where one request can start the attack before any of your PHP code runs. - Researchers from Calif, Wiz and OpenAI found the flaws with the help of AI tools. Details leaked on social media on 20 October, so the PHP team had to rush its warning.
- Amazon saw an attack attempt on its trap servers (honeypots) on 17 October, four days before the public warning. After the fix came out, Amazon said PHP2Shell is now "being broadly exploited in the wild".
- Many sites went offline as a safety step. Finland shut its government public web services for a while. The Dutch cyber security agency took its own website offline. Wikimedia took some systems down. The UK NCSC said: patch now, or take the system offline until you can. India's CERT-In also issued a critical warning.
- PHP 8.1 and older no longer get fixes from the PHP project. You need a fix from your Linux vendor, or a move to a supported version.
2. How the hack happened (public reporting only – high-level)
- Attackers scan the internet for servers that run PHP. They do not need to pick a victim. Any public PHP page is enough.
- They send one specially shaped form request to any PHP page. No login is needed. Datadog showed that even a page that only prints one short reply is enough.
- The request makes PHP stop in the middle of its work (for example, it runs out of memory). Some of PHP's own data is left half-ready.
- PHP then cleans up after the failed request, or the next request on the same worker uses old leftover data. PHP trusts this broken data.
- The attacker's command then runs as the web server user (like
apacheorwww-data). From there they can read files, read database passwords from config files, or leave a hidden backdoor. - Your login page, your input checks and your firewall rules inside the app do not help, because all this happens before your code runs.
3. How to stop it / defend (this lesson: secure PHP settings)
- Patch first. It is the only full fix. Check the version with
php -v. Update with your package manager (sudo dnf update 'php*'on Amazon Linux,sudo apt update && sudo apt upgradeon Ubuntu). Then restart every worker:sudo service php-fpm restart(Ubuntu:php8.3-fpm), andsudo service httpd restart(Ubuntu:apache2) if you use Apache. - Check the PHP that serves the web, not only the command line. The web server can use a different PHP. Open a test page with
phpinfo()on your own lab server, read the version, then delete the test page. - If you cannot patch today, take the site offline, as the NCSC advised. As a short-term extra step only, the PHP team lists
php.inisettings that block some attack paths:session.upload_progress.enabled = 0, a smallpost_max_size(8M if you have no uploads, 32M if you do) andupload_max_filesizesmaller thanpost_max_size. Put them inphp.inior the FPM pool file, not inini_set()or.user.ini, and restart. These settings do not make you safe. - Hiding errors does not stop this bug.
display_errors = Offis still right for production, but the PHP team says hiding errors withdisplay_errors,error_reportingor@does not help here. - Limit the damage. Run PHP as its own low-power user. Give the website's database user only the rights it needs. Keep secrets out of files the web user can read when you can.
- A WAF in front helps for a few days. Cloudflare added rules, but its CTO called them a "STOPGAP only".
4. How to take care so it won't happen again (checklist)
- Make a list of every place PHP runs: servers, containers, control panels and products that hide PHP inside.
- Patch internet-facing servers in hours, not weeks, when a critical flaw is out.
- After patching, restart every worker and rebuild container images.
- Look at logs from 17 October onwards: very large form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, and any shell started by the web server user.
- Move off PHP 8.1 and older. Plan upgrades before support ends.
- Keep production
php.inisafe:display_errors Off,expose_php Off, small upload limits, settings that apps cannot override.
PHP2Shell: पूर्ण गोष्ट
1. काय झालं
PHP ही server वर web pages बनवणारी language आहे. WordPress, Drupal, Joomla आणि बरेच control panels त्यावर चालतात. या lesson मध्ये तुम्ही PHP setup केलं आणि त्याचे settings safe केले.
- 21 ऑक्टोबर 2026 ला PHP team ने PHP 8.5.12, 8.4.27, 8.3.36 आणि 8.2.35 release केले. यांनी दोन critical flaws fix केले: CVE-2026-109618 आणि CVE-2026-109619. दोघांना मिळून "PHP2Shell" म्हणतात.
- दोन्ही flaws मुळे login शिवाय remote code execution (RCE) शक्य होतं. म्हणजे internet वरचा कोणताही अनोळखी माणूस तुमच्या server कडून त्याचे commands चालवून घेऊ शकतो. प्रत्येक flaw चा CVSS v4.0 score 9.2 आहे.
- PHP म्हणतं की web pages serve करणारा प्रत्येक PHP install धोक्यात आहे: PHP-FPM,
mod_phpसोबत Apache, php-cgi, FrankenPHP आणि LiteSpeed. धोकाmod_phpसाठी सगळ्यात जास्त आहे, जिथे एकच request तुमचा कोणताही PHP code चालायच्या आधीच attack सुरू करू शकते. - Calif, Wiz आणि OpenAI च्या researchers नी AI tools च्या मदतीने हे flaws शोधले. Details 20 ऑक्टोबरला social media वर leak झाले, म्हणून PHP team ला घाईने warning द्यावी लागली.
- Amazon ला त्याच्या trap servers (honeypots) वर 17 ऑक्टोबरला, म्हणजे public warning च्या चार दिवस आधीच, एक attack चा प्रयत्न दिसला. Fix आल्यानंतर Amazon ने सांगितलं की PHP2Shell आता "being broadly exploited in the wild" – म्हणजे मोठ्या प्रमाणावर वापरला जात आहे.
- Safety म्हणून बऱ्याच sites offline गेल्या. Finland ने सरकारी public web services काही काळ बंद केल्या. Dutch cyber security agency ने स्वतःची website offline केली. Wikimedia ने काही systems बंद केल्या. UK च्या NCSC ने सांगितलं: आत्ताच patch करा, नाहीतर patch होईपर्यंत system offline ठेवा. भारताच्या CERT-In ने पण critical warning दिली.
- PHP 8.1 आणि जुने versions ना आता PHP project कडून fixes मिळत नाहीत. तुम्हाला तुमच्या Linux vendor कडून fix लागेल, किंवा supported version वर जावं लागेल.
2. Hack कसा झाला (फक्त public reporting – high-level)
- Attackers PHP चालणाऱ्या servers साठी संपूर्ण internet scan करतात. त्यांना victim निवडायची गरज नाही. कोणतंही public PHP page पुरेसं आहे.
- ते कोणत्याही PHP page ला एक खास बनवलेली form request पाठवतात. Login लागत नाही. Datadog ने दाखवलं की फक्त एक छोटं उत्तर print करणारं page पण पुरेसं आहे.
- ही request PHP ला काम अर्ध्यात थांबवायला भाग पाडते (उदाहरणार्थ, memory संपते). PHP चा स्वतःचा काही data अर्धवट तयार राहतो.
- मग PHP failed request नंतर साफसफाई (cleanup) करतं, किंवा त्याच worker वरची पुढची request जुना उरलेला data वापरते. PHP या बिघडलेल्या data वर विश्वास ठेवतं.
- मग attacker चा command web server user म्हणून (जसं
apacheकिंवाwww-data) चालतो. तिथून ते files वाचू शकतात, config files मधले database passwords वाचू शकतात, किंवा एक लपलेला backdoor ठेवू शकतात. - तुमचं login page, तुमचे input checks आणि app मधले firewall rules काहीच मदत करत नाहीत, कारण हे सगळं तुमचा code चालायच्या आधीच होतं.
3. कसं थांबवायचं / बचाव (हा lesson: secure PHP settings)
- आधी patch करा. हाच एकमेव पूर्ण fix आहे.
php -vने version check करा. Package manager ने update करा (Amazon Linux वरsudo dnf update 'php*', Ubuntu वरsudo apt update && sudo apt upgrade). मग प्रत्येक worker restart करा:sudo service php-fpm restart(Ubuntu:php8.3-fpm), आणि Apache वापरत असाल तरsudo service httpd restart(Ubuntu:apache2). - फक्त command line चं नाही, web serve करणारं PHP check करा. Web server वेगळं PHP वापरू शकतो. तुमच्या स्वतःच्या lab server वर
phpinfo()असलेलं test page उघडा, version वाचा, आणि मग test page delete करा. - आज patch करता येत नसेल तर, NCSC ने सांगितल्याप्रमाणे site offline करा. फक्त थोड्या काळासाठी extra step म्हणून, PHP team ने काही
php.inisettings दिले आहेत जे काही attack paths block करतात:session.upload_progress.enabled = 0, लहानpost_max_size(uploads नसतील तर 8M, असतील तर 32M) आणिpost_max_sizeपेक्षा लहानupload_max_filesize. हेphp.iniकिंवा FPM pool file मध्ये टाका,ini_set()किंवा.user.iniमध्ये नाही, आणि restart करा. हे settings तुम्हाला safe बनवत नाहीत. - Errors लपवल्याने हा bug थांबत नाही. Production साठी
display_errors = Offअजूनही बरोबरच आहे, पण PHP team म्हणते कीdisplay_errors,error_reportingकिंवा@ने errors लपवून इथे काही फायदा होत नाही. - नुकसान कमी ठेवा. PHP ला त्याच्या स्वतःच्या कमी-power user म्हणून चालवा. Website च्या database user ला फक्त गरजेचे rights द्या. शक्य असेल तेव्हा secrets web user ला वाचता येणाऱ्या files मध्ये ठेवू नका.
- समोर WAF असेल तर काही दिवस मदत होते. Cloudflare ने rules add केले, पण त्याच्या CTO ने त्यांना "STOPGAP only" म्हटलं – म्हणजे फक्त तात्पुरता उपाय.
4. पुन्हा असं होऊ नये म्हणून काय काळजी घ्यायची (checklist)
- PHP कुठे कुठे चालतं याची list बनवा: servers, containers, control panels आणि आत PHP लपवलेली products.
- Critical flaw आला की internet-facing servers आठवड्यांत नाही, तासांत patch करा.
- Patch केल्यानंतर प्रत्येक worker restart करा आणि container images पुन्हा build करा.
- 17 ऑक्टोबरपासूनचे logs बघा: खूप मोठ्या form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, आणि web server user ने सुरू केलेला कोणताही shell.
- PHP 8.1 आणि जुन्या versions वरून पुढे जा. Support संपायच्या आधी upgrades plan करा.
- Production
php.inisafe ठेवा:display_errors Off,expose_php Off, लहान upload limits, apps बदलू शकणार नाहीत असे settings.
PHP2Shell: पूरी कहानी
1. क्या हुआ
PHP वह language है जो server पर web pages बनाती है. WordPress, Drupal, Joomla और कई control panels इसी पर चलते हैं. इस lesson में आपने PHP setup किया और उसकी settings safe कीं.
- 21 अक्टूबर 2026 को PHP team ने PHP 8.5.12, 8.4.27, 8.3.36 और 8.2.35 release किए. इन्होंने दो critical flaws fix किए: CVE-2026-109618 और CVE-2026-109619. दोनों को मिलाकर "PHP2Shell" कहते हैं.
- दोनों flaws से बिना login के remote code execution (RCE) संभव होता है. यानी internet पर कोई भी अनजान व्यक्ति आपके server से अपने commands चलवा सकता है. हर flaw का CVSS v4.0 score 9.2 है.
- PHP कहता है कि web pages serve करने वाला हर PHP install खतरे में है: PHP-FPM,
mod_phpके साथ Apache, php-cgi, FrankenPHP और LiteSpeed. खतराmod_phpके लिए सबसे ज़्यादा है, जहाँ एक ही request आपका कोई भी PHP code चलने से पहले ही attack शुरू कर सकती है. - Calif, Wiz और OpenAI के researchers ने AI tools की मदद से ये flaws ढूँढे. Details 20 अक्टूबर को social media पर leak हो गईं, इसलिए PHP team को जल्दी में warning देनी पड़ी.
- Amazon को अपने trap servers (honeypots) पर 17 अक्टूबर को, यानी public warning से चार दिन पहले, एक attack की कोशिश दिखी. Fix आने के बाद Amazon ने कहा कि PHP2Shell अब "being broadly exploited in the wild" – यानी बड़े पैमाने पर इस्तेमाल हो रहा है.
- Safety के लिए कई sites offline हो गईं. Finland ने सरकारी public web services कुछ समय के लिए बंद कीं. Dutch cyber security agency ने अपनी ही website offline कर दी. Wikimedia ने कुछ systems बंद किए. UK के NCSC ने कहा: अभी patch करें, या patch होने तक system offline रखें. भारत के CERT-In ने भी critical warning जारी की.
- PHP 8.1 और पुराने versions को अब PHP project से fixes नहीं मिलते. आपको अपने Linux vendor से fix चाहिए, या supported version पर जाना होगा.
2. Hack कैसे हुआ (सिर्फ़ public reporting – high-level)
- Attackers PHP चलाने वाले servers के लिए पूरा internet scan करते हैं. उन्हें victim चुनने की ज़रूरत नहीं. कोई भी public PHP page काफ़ी है.
- वे किसी भी PHP page पर एक खास तरह से बनी form request भेजते हैं. Login की ज़रूरत नहीं. Datadog ने दिखाया कि सिर्फ़ एक छोटा जवाब print करने वाला page भी काफ़ी है.
- यह request PHP को काम बीच में रोकने पर मजबूर करती है (जैसे memory खत्म हो जाती है). PHP का अपना कुछ data आधा-अधूरा रह जाता है.
- फिर PHP failed request के बाद सफ़ाई (cleanup) करता है, या उसी worker पर अगली request पुराना बचा हुआ data इस्तेमाल करती है. PHP इस बिगड़े हुए data पर भरोसा करता है.
- फिर attacker का command web server user के रूप में (जैसे
apacheयाwww-data) चलता है. वहाँ से वे files पढ़ सकते हैं, config files से database passwords पढ़ सकते हैं, या एक छिपा हुआ backdoor छोड़ सकते हैं. - आपका login page, आपके input checks और app के अंदर के firewall rules कोई मदद नहीं करते, क्योंकि यह सब आपका code चलने से पहले होता है.
3. कैसे रोकें / बचाव (यह lesson: secure PHP settings)
- पहले patch करें. यही एकमात्र पूरा fix है.
php -vसे version check करें. Package manager से update करें (Amazon Linux परsudo dnf update 'php*', Ubuntu परsudo apt update && sudo apt upgrade). फिर हर worker restart करें:sudo service php-fpm restart(Ubuntu:php8.3-fpm), और Apache इस्तेमाल करते हैं तोsudo service httpd restart(Ubuntu:apache2). - सिर्फ़ command line वाला नहीं, web serve करने वाला PHP check करें. Web server अलग PHP इस्तेमाल कर सकता है. अपने खुद के lab server पर
phpinfo()वाला test page खोलें, version पढ़ें, फिर test page delete करें. - अगर आज patch नहीं कर सकते, तो NCSC की सलाह की तरह site offline करें. सिर्फ़ थोड़े समय के extra step के रूप में, PHP team ने कुछ
php.inisettings बताई हैं जो कुछ attack paths block करती हैं:session.upload_progress.enabled = 0, छोटाpost_max_size(uploads नहीं हैं तो 8M, हैं तो 32M) औरpost_max_sizeसे छोटाupload_max_filesize. इन्हेंphp.iniया FPM pool file में डालें,ini_set()या.user.iniमें नहीं, और restart करें. ये settings आपको safe नहीं बनातीं. - Errors छिपाने से यह bug नहीं रुकता. Production के लिए
display_errors = Offअब भी सही है, लेकिन PHP team कहती है किdisplay_errors,error_reportingया@से errors छिपाने से यहाँ कोई फ़ायदा नहीं. - नुकसान कम रखें. PHP को उसके अपने कम-power user के रूप में चलाएँ. Website के database user को सिर्फ़ ज़रूरी rights दें. जहाँ हो सके, secrets को उन files में न रखें जिन्हें web user पढ़ सकता है.
- सामने WAF हो तो कुछ दिन मदद मिलती है. Cloudflare ने rules जोड़े, लेकिन उसके CTO ने उन्हें "STOPGAP only" कहा – यानी सिर्फ़ अस्थायी उपाय.
4. दोबारा ऐसा न हो, इसके लिए क्या ध्यान रखें (checklist)
- PHP कहाँ-कहाँ चलता है इसकी list बनाएँ: servers, containers, control panels और ऐसे products जिनके अंदर PHP छिपा है.
- Critical flaw आने पर internet-facing servers हफ़्तों में नहीं, घंटों में patch करें.
- Patch करने के बाद हर worker restart करें और container images दोबारा build करें.
- 17 अक्टूबर से के logs देखें: बहुत बड़ी form requests, "Allowed memory size ... exhausted ... in Unknown on line 0" errors, और web server user द्वारा शुरू किया गया कोई भी shell.
- PHP 8.1 और पुराने versions से आगे बढ़ें. Support खत्म होने से पहले upgrades plan करें.
- Production
php.inisafe रखें:display_errors Off,expose_php Off, छोटी upload limits, ऐसी settings जिन्हें apps बदल न सकें.
Why your login page did not help
Think of what happens when a request reaches a PHP website:
- The web server (Apache, Nginx or LiteSpeed) gets the request.
- PHP reads the request: the form fields, the cookies and the uploads.
- Only then does your PHP code run: the login check, the input checks, the database query.
PHP2Shell works in step 2. So the attack is over before step 3 starts. Your login check and your input checks never get a chance to say no.
| Defence | Does it stop PHP2Shell? | Why |
|---|---|---|
| Update PHP and restart workers | Yes | It removes the bug |
| Take the site offline until patched | Yes, for that site | No request reaches PHP |
| Login page, input checks in your code | No | The attack happens before your code runs |
display_errors = Off | No | Hiding errors does not fix the bug |
Temporary php.ini settings | Partly | They block some known paths only |
| WAF rules in front | Partly, for a short time | A stopgap until you patch |
Check and patch, stack by stack
Do this on your own servers. Check the PHP that serves the web, not only the php command.
| Your setup | Check the version | Update | Restart |
|---|---|---|---|
| Amazon Linux 2023 + Apache or Nginx + PHP-FPM | php -v and php-fpm -v | sudo dnf update 'php*' | sudo service php-fpm restart and sudo service httpd restart (or nginx) |
| Ubuntu + Apache with mod_php | php -v, then a phpinfo() test page | sudo apt update && sudo apt upgrade | sudo service apache2 restart |
| Ubuntu + Nginx + PHP-FPM | php-fpm8.3 -v (your version number) | sudo apt update && sudo apt upgrade | sudo service php8.3-fpm restart |
| Docker image with PHP | docker exec <container> php -v | Pull a fixed base image and rebuild | Replace the running containers |
| Shared hosting or a control panel | The panel's PHP version page | Ask your host, or switch to a fixed version in the panel | The host restarts it |
| WordPress, Drupal, Joomla, Magento | Check the server's PHP, not the CMS | A CMS auto-update does not update PHP | As per the server type above |
After the update, open your phpinfo() test page on your own lab server once more, confirm the new version, and then delete the test page.
What to look for in your logs
Amazon says to start looking from 17 October 2026, not from the day of the fix.
- In the web server access log: unusually large form (POST) requests to normal pages.
- In the PHP error log: "Allowed memory size ... exhausted ... in Unknown on line 0". "Unknown on line 0" means PHP failed before any script ran.
- On the server: any shell or command started by the web server user (
apache,nginxorwww-data). This is the strongest sign. - New or changed
.phpfiles in the website folder that nobody on your team made.
If you find signs, treat the server as broken in: keep the logs, build a clean server, and change the database and other passwords the website used.
Summary
| Question | Answer |
|---|---|
| What is PHP2Shell? | Two critical flaws in PHP: CVE-2026-109618 and CVE-2026-109619 |
| What can an attacker do? | Run commands on the server as the web user, without a login |
| Who is at risk? | Every PHP install that serves web pages |
| Main fix | PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, then restart every worker |
| If you cannot patch today | Take the site offline; temporary settings only reduce risk |
| Check logs from | 17 October 2026 |
Quick quiz: check what you learned
What can PHP2Shell let an attacker do?
- Run commands on the server, no login
- Read only the public home page text
- Change the website's domain name
- Send email from the visitor's phone
Show answer
A. It is remote code execution without a login.
Why did the site's login check not stop it?
- The attack runs before your code runs
- The attacker knew every user password
- Login pages are switched off by PHP
- The attack only targets admin pages
Show answer
A. PHP is hit while it reads the request, before your script starts.
What is the only full fix?
- Update PHP and restart every worker
- Set display_errors to Off in php.ini
- Add a CAPTCHA to the contact form
- Change the database root password
Show answer
A. Patched PHP versions remove the bug; restarts load the fix.
From which date should you check your logs?
- 17 October 2026, before the fix came
- 1 January 2026, start of the year
- Only from the day you patch PHP
- No need, a WAF blocks all of it
Show answer
A. Amazon saw a first attempt on 17 October, four days early.
Sources
- PHP: "Security advisory: Critical remote code execution vulnerabilities, update now", 21 October 2026
- AWS Security Blog, CJ Moses: "Amazon Threat Intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot", 21 October 2026
- BleepingComputer, Sergiu Gatlan: "PHP ships emergency patches for critical PHP2Shell flaws", 21 October 2026
- Datadog Security Labs: "PHP2Shell - Critical vulnerabilities in PHP (CVE-2026-109618, CVE-2026-109619)", 21 October 2026
- BBC News: "Websites taken down worldwide as critical PHP cyber-security update issued", 21 October 2026
- Reuters via CNBC: "Government websites go dark as software flaw sparks security scramble", 21 October 2026
- Business Today: "Critical PHP vulnerabilities: What is it, how it can affect websites" (CERT-In note), 22 October 2026
This page is a defensive, educational summary of public reporting. It does not include exploit code, attack requests or IP addresses.
Learn it properly
These pages go deeper: