Share
Embed
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
66 slides
-
A retrospective on PHP2Shell Volker "edorian" Dusch Ecosystem Security Lead
at The PHP Foundation PHP 8.5 Release Manager Head of Engineering at Tideways secIT Thementag by Heise -
My background ~20 years of PHP From long-lived web apps,
including a top 100 site by traffic, to medical and ecommerce software Working at Tideways on PHP performance tooling PHP 8.5 Release Manager Ecosystem Security Lead at The PHP Foundation Thank you to Tideways for making this work possible. -
Agenda A short refresher on PHP php2shell: discovery, exploit and
remediation Learnings and the way forward -
PHP's history A programming language built for the web. Since
1995. The original vibe coding language? A text editor, a shared host and an idea. Save. Refresh. It works. A generation learned to program by making things Server-side rendering, before we called it SSR. -
Getting started with programming Alongside Perl, PHP enabled beginners to
build things for the web and express themselves. In recent years, more of this education is done by the Python and JavaScript communities The beginner mistakes moved along with them PHP and its ecosystem have grown up -
PHP today - The language Community owned and driven Not
beholden to any big corporation. Fast, memory safe, easily scalable. Mature tooling for the whole software lifecycle. Testing, debugging, profiling, static analysis, fuzzing. A stable platform with an established ecosystem. -
PHP today - Users Lots of profitable businesses. Many free
and open source applications, self-hosted. A backbone of digital sovereignty. Very similar to the Ruby community in many aspects. -
PHP today - Examples CMS: WordPress, Drupal, TYPO3 Shops: Shopware,
Magento, PrestaShop, Sylius Learning platforms: Moodle, ILIAS Wikis: MediaWiki (Wikipedia) Time tracking: Kimai. Web analytics: Matomo. Frameworks for SaaS and APIs: Symfony, Laravel -
Modern PHP OOP mirroring Java's object model. Static analysis before
deployment. Types enforced at runtime. <?php final readonly class PoolConfig { public function __construct(public int $workers) {} } $config = new PoolConfig(workers: 4); // OK $input = json_decode('{"workers":"many"}', associative: true); $config = new PoolConfig($input['workers']); // TypeError Argument #1 ($workers) must be of type int, string given -
Runtime Source code -> bytecode -> Zend VM Compile PHP
into instructions called opcodes OPcache keeps that compiled code in shared memory The VM executes it and calls into native libraries Similar to the JVM and CPython -
The traditional PHP request nginx / Apache → PHP-FPM →
application → response FPM keeps a pool of ready-to-go worker processes One worker handles one request at a time PHP initializes the request and runs the application Request ends: clean up, then accept the next one Alternatively: FrankenPHP and other worker-style web servers -
PHP - Serverless? Think Lambdas, before "serverless" was a thing.
A request is the unit of work PHP variables start fresh for the next request The worker process stays ready for more work -
Scaling request by request Any ready worker can handle the
next request. No shared application heap between workers Add workers and servers behind a load balancer Put sessions, uploads and data in shared storage With all the downsides of this approach as well. -
Earlier runtime security incidents 2012: CVE-2012-0830 RCE during request parameter
processing. 2019: CVE-2019-11043 Unauthenticated RCE in uncommon nginx/PHP-FPM setups. 2024: CVE-2024-4577 Windows PHP-CGI argument injection via character conversion. -
Security releases PHP is released once every 4 weeks. Since
2020, ~40% of releases included a security fix. None of them requiring coordination on this scale. We haven't had much practice. -
How did we get here? In March 2026, the Linux
Foundation announced a grant to strengthen open source security. https://www.linuxfoundation.org/press/linux-foundation-announces-12.5-million-in-grantfunding-from-leading-organizations-to-advance-open-source-security Alpha-Omega’s mission is to protect society by catalyzing sustainable security improvements across open source. https://alpha-omega.dev/ -
Ecosystem Security The grant funded the new Ecosystem Security Team
at The PHP Foundation. Our goal: Secure the PHP ecosystem and support maintainers. https://thephp.foundation/blog/2026/05/18/announcing-ecosystem-security-team/ -
Security Engineers in Residence Rapid response Help in moments of
urgency Triage and disclosure Report issues while respecting maintainer bandwidth Cross-ecosystem collaboration Build up open source resources across languages Tooling Ensure access to models and scanning budget Storytelling Provide reassurance and share learnings https://seirs.dev/ -
The audit that found PHP2Shell Part of our ecosystem security
work is arranging audits for PHP projects. I reached out to Patch the Planet. Calif got in touch, and we set up an audit. Ryan at Calif, familiar with PHP, leveraging LLMs, begins his work. -
What is PHP2Shell? Engine-level vulnerabilities. Attackers can execute code on
servers running PHP. Hit memory_limit at the wrong moment, and PHP trusts half-initialized data. OOM errors longjmp() out of the error handler in zend_bailout(). The code in the calling function never finishes. https://ilia.ws/blog/php2shell-two-ways-php-corrupts-its-own-memory -
From longjmp() to RCE A simplified example using mod_php: 1.
A request hits memory_limit during startup 2. Fatal error: the request memory is freed, but globals like the session ID still point into it 3. The worker then serves the next request 4. This request fills memory with attacker data 5. PHP sends the stale session ID back as a cookie: leaked memory reveals addresses attackers need 6. Further requests turn a dangling pointer into writes: overwrite something PHP later calls -
RCE Remote code execution. mod_php: demonstrated before application code runs
PHP-FPM: other paths, with different requirements Code runs with the web worker's permissions https://calif.io/php2shell/ https://www.wiz.io/blog/php2shell-php-rce -
2024 - OSTIF/Quarkslab Audit Big security audit of php-src thanks
to the Sovereign Tech Fund A lot of fixes were released. https://ostif.org/php-audit-complete/ https://blog.quarkslab.com/security-audit-of-php-src.html -
Early signs During one of these fixes, a php-src developer
found the first signs of the OOM problem. No concrete exploit. No proven problems. Several possible ideas for fixes, each with trade-offs and BC considerations. Meanwhile: Tons of concrete work and things to fix from the audit and other reports. These got priority. -
2026 - Issue discovery July 30 Calif audits PHP under
OpenAI's "Patch the Planet". August 11 Calif reports an unconditional RCE. OpenAI shares more related findings. Triage begins. August 14 Calif shares the exploit with the php-src security team August 24 Wiz reports new vectors to the same underlying issue. September 18 OpenAI reports further attack vectors. -
Issue remediation The people behind the fix Arnaud Le Blanc
Ilija Tovilo Jakub Zelenka github.com/arnaud-lb github.com/iluuu1994 github.com/bukka -
Issue remediation Many weeks of focused work. All funded by
The PHP Foundation. A proper fix needed full-time people. I did the coordination work and helped with scanning. Ilija, Arnaud and Jakub handled the complex technical work diligently. -
Find and fix every vector We have to fix every
possible entry point. If we miss one, it's a problem. ~200 modified files. Over 10,000 lines of code (with tests). Agentic reviews reinforced confidence. Good tests helped distros build with confidence. -
The fix OOM handling Defer the fatal error to a
VM safe point. Exit the process if memory hits the hard limit. https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w Request state Reset request-owned globals before the next request can consume stale state. https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp -
Working with security teams A team of experts to rely
on was a massive help. Daily sync calls in the weeks leading up to the release. Working with people using LLMs for security research every day. Different harnesses, different ideas. Changes got validated by their toolchains. OpenAI provided access and credits to help us doublecheck our own work. -
Communication How the Slack interactions went: No AI in the
communication. No meeting transcripts. People paid attention, took notes and followed up on things. The people using AI to find the bugs didn't use it to talk to each other or to make decisions. -
Informing governments We informed CISA, ENISA and others ahead of
time. They passed information to national CERTs & partners. https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-requireimmediate-patching https://enisa.europa.eu/news/joint-statement-on-critical-php-vulnerabilities -
Coordinated public warnings CISA alert, with NSA, NCSC UK, Canada,
Australia, New Zealand and the Netherlands Joint EU statement: ENISA, CERT-EU, Europol and the CSIRTs Network ENISA: "Where immediate remediation is not feasible, consider isolating exposed applications from public networks until fixes can be applied." -
Informing distros Distributions and LTS vendors received the patches in
advance, and we helped with backports and testing. Distributions through Openwall Remi Collet: Fedora, RHEL and remirepo packages Ondřej Surý: Debian and Ubuntu packages, deb.sury.org, Freexian Docker official PHP images Zend for their commercial backports Our own Windows builds, ready at release time -
Early testing Most security patches are small. Impact is usually
easy to predict. This one wasn't. We needed to make sure it worked. A faulty patch could leave apps broken or vulnerable. Big thanks to Symfony and Automattic. -
Mitigations We prepared mitigation advice. Clear guidance to share with
everyone. Even mitigations can help attackers build exploits. -
Monitoring the situation We got in touch with WAF vendors.
Pre-established mutual non-disclosure agreements (mNDAs) from Wiz helped a lot in reaching everyone. They helped with early detection and mitigation. Looking for in-the-wild exploitation attempts. -
Prepared for a potential leak With more people in the
loop, a leak was more likely. So we prepared. Announcement drafted Mitigations written Release tags and tarballs built on Monday A plan for moving the date -
Tuesday, October 20 ~15:00 UTC CVE IDs are leaked. "Wrong"
details, CVSS of 10.0. We were prepared and discussed our options. Zero reports of in-the-wild exploitation. 19:30 UTC Announcement: release tomorrow. A good balance of informing defenders while not giving attackers too much time to develop exploits. -
Wednesday, October 21 Release Through the work up to that
point we were well prepared, had time to coordinate and the opportunity to protect users. -
The days after Screenshots of "working exploits" everywhere. Many relied
on specially modified Docker containers or other shortcuts taken by the AIs. My agent said it's working! So it's real! Others claimed it was impossible to exploit. -
Media management I prepared a small media strategy for the
team. No live interviews. We lack the media training for that. Have background calls with journalists. Tell our story. Approve quotes. Help them get the facts right. People are always looking for a human angle for the story. Give them a genuine one. Tell your story. Everything else is up to them. We can't control what people will make of it. Just be truthful. -
Media coverage Over 50 interviews, thousands of articles. You can't
control the headlines. AI Just Found a Bug That Puts Up to 70% of the World's Websites at Risk The Wall Street Journal php2shell: Critical flaws allow code injection in PHP Heise -
You can't win them all Thriller about a security
hole How a German saved the Internet Krimi um IT-Lücke Wie ein Deutscher das Internet rettete WDR 🙈 - But well, we made the best of it. -
But you can win some Genuine quotes humanized the whole
affair. Einer muss es ja machen. Well, someone's gotta do it. -
SNL - UK [...] Paddy: Yes, PHP is essentially related
to the way the internet works. Ania? Ania: Thanks, Paddy. So that’s PHP. And we really wish it the best of luck in the stuff that’s going on with it. -
Why so much attention? PHP matters. We took this seriously
and informed everyone who needed to know. A named vulnerability with a website. "Up to 70% of the world's websites". "AI found it". Governments advised temporarily isolating exposed applications if they couldn't be patched immediately. -
Industry reactions Positive feedback from within the PHP community. Supportive
reactions from the rest of the net as well. Sure, there are always some outliers, but I'm happy with the response and our work. Lots of support from other language communities. Anyone calling this wave a localized problem hasn't been paying attention. -
What's different now Finding issues at scale takes less effort
now. Human insight helps in steering. Expertise matters more than ever to inform choices. A security announcement is a hint. A released patch is a playbook for building exploits. Models read diffs faster than humans. Finding issues is easier than fixing them. And then everyone still has to patch. -
Now every day is patch day Happy #CyberSecurityAwarenessMonth 2026! October
2026 & November 2026 & December 2026 (most likely) -
And now everyone together! Node CVE-2026-111497, Python, .NET, ... Out-of-bounds
write in the Brotli decoder. Remote code execution. -
Cross-project vulnerabilities OpenSSH x musl: CVE-2026-123158 - https://sshhole.com Password longer
than 256 bytes considered valid We consider the root cause of this bug to be outside sshd https://www.openssh.org/releasenotes.html#10.6p2 It is my position that this is not a bug in musl just an erroneous use by the caller. https://www.openwall.com/lists/musl/2026/11/05/4 -
PHP November Release We got a lot of attention. Many
hundred reports filed on GitHub. Thousands of findings shared in other ways. Fixes for 17 CVEs with 5 RCEs https://www.php.net/ChangeLog-8.php#8.5.13 -
Dealing with the reports TAMIS: security report deduplication by Alexandre
Daubois Group duplicates and check claimed code paths Give maintainers evidence to make a decision https://github.com/php/tamis Alpha-Omega case study: https://alpha-omega.dev/blog/case-study-how-phps-security-engineer-in-residencehelped-coordinate-the-php2shell-response/ -
Open source projects Be prepared Fully automate your release process
Get audits/scans proactively Nobody cares more about your project than you Inform your users Help people update what matters A guide the Foundation prepared: https://thephp.foundation/blog/2026/08/19/so-you-received-a-security-report-now-what/ -
Organizations Everyone is fixing things at the moment. Know your
infrastructure and patch. Regularly. Not only when things are in the news. OS: unattended-upgrades or a rebuild pipeline. Containers: Pull updated base images, rebuild your application images, and redeploy. Languages: Stay on supported versions. Libraries and frameworks: Get on supported versions. Not every fix is announced: Update regularly. -
Takeaways Infrastructure management isn't optional anymore. #justPatch AI doesn't write
secure code by default. Rewrites won't absolve you from caring. Open Source is still winning. All AI builds on top of it, and with it. Explain how AI changes discovery and defense. Your business needs time and budget to respond. -
Thank you! Slides: https://speakerdeck.com/edorian Anything I can help with? Talk
to me today! Reach out later: [email protected] Discord: #ecosystem-security@phpc Invite: https://discord.com/invite/RYajXKxuuK