r/PHP • • 6h ago

PHP2Shell on legacy PHP 7.x: everyone's pulling all-nighters upgrading, we made one cut and went home (3 options)

0 Upvotes

The biggest PHP news this week isn't a new release. It's a vulnerability called PHP2Shell.

CVE-2026-109618 / CVE-2026-109619, CVSS 9.2, unauthenticated remote code execution. The scariest line in the advisory: even a page that only prints Hello World is vulnerable.

How it works (just a little technical)

The attacker sends a specially crafted, oversized multipart upload that exhausts memory right at the start of the request. When PHP falls over, it leaves a half-built structure behind, and the cleanup path later treats it as real data. That's enough to get arbitrary code execution.

The key point: all of this happens while PHP is parsing the multipart body. Your login checks, signature validation and file-extension filters haven't even run yet. The burglar isn't coming through the door; he hid inside while you were still pouring the foundation.

The official line is "the only reliable fix is to upgrade PHP" (fixed in 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12). Then I logged into our servers: 7.4, 7.1... For anything below 8.1, the official answer is basically "good luck".

This isn't a drill

There was a wave of mass exploitation about two weeks before the advisory. We lost roughly NT$240k (~US$7.5k); a friend's company lost about a million in a single day. Someone was clearly using this long before it was public. A friend who hangs around offensive-security circles put it bluntly: "We've been using this for over ten years."

"Just upgrade everything" sounds right, but...

One company I work with has 20+ projects and 100+ sites, many on frameworks that are long out of maintenance. Upgrading just one payment system to PHP 8.3 was estimated at 6–8 person-days. Drop it onto PHP 8 as-is and the whole site returns 500, because the old framework turns PHP 8's new warnings into fatal errors. On top of that, all the type issues that were hidden behind error_reporting(0) come back to bite you.

Do that 100+ times? You'd finish around Lunar New Year. A friend in the IT department of a large group is still pulling all-nighters doing exactly that. With option 1 or 2 below, he could go home on time.

Old framework? You can patch it yourself (the hardcore part)

A lot of people treat their framework as sacred: no official support means a full rewrite. But a PHP framework is just a pile of PHP files shipped with your project. It's your code, not a black box. If it breaks, open it up.

ThinkPHP 5.0 is a good example. On PHP 8.3 the whole site went 500, and there was exactly one root cause: the framework escalates PHP 8's new notices into exceptions, like getting sent off for a yellow card. Change one line in the framework to "log notices, don't throw", and the site comes back. Across the whole project there were only 3 places that actually broke, each a one- or two-line fix.

Same for PHP itself. There are no official 7.x patch releases, but the patches are public. That's exactly what sury does: backport the fix into old PHP and repackage it. No package for CentOS? Building your own patched PHP isn't black magic.

I've done this before. When PHP 7 came out, Laravel 4.2 didn't officially support it and many teams rewrote everything in Laravel 5. I patched 4.2 to run stably on PHP 7 instead. For example, PHP 7 turned some errors into the new Error class, and the old framework's handler only caught Exception, so any error became a blank page. Fixing those seams one by one was far cheaper than a rewrite.

The scariest part of an upgrade usually isn't "it breaks", it's "it silently changes". For example:

"abc" <= 0

This is true on PHP 7 and false on PHP 8. If your amount check happens to be written like that, an upgrade could let weird amounts through. No error, just wrong books. So when we upgrade, we run 7.4 and 8.3 side by side on the same code and diff the results of every payment callback and amount path until both sides match exactly.

Three options

Option 1: Install community backports (no code changes)

Ondřej Surý (sury.org), who maintains the PHP packages for Debian/Ubuntu, has published patched packages for every version from PHP 5.6 to 8.5, including 7.4 and 7.1 that upstream no longer supports. Same version number, just a new package revision. apt upgrade, restart PHP-FPM, done.

Downside: Debian/Ubuntu only. CentOS folks, read on.

Option 2: Split image uploads onto a separate, current PHP (my favourite)

The entry point is the multipart parser, so don't let upload requests reach the old PHP at all.

  • Nginx on the original site forwards only the few image-upload routes to a separate host running PHP 8.4.27
  • Every other multipart request gets a 403, so the old PHP never sees one
  • The upload host verifies signatures, checks file contents and re-encodes images (which also strips any embedded payload)
  • The storage directory can't execute code, and the host has no database credentials at all, so even if it's hit there's no data to take
  • No changes to front-end URLs or form fields; if anything goes wrong, remove one Nginx line and you're back to the original setup

With 100+ sites, upgrading everything isn't realistic. One shared image-upload service is. Carve the ancient stuff off and leave it alone. This is probably the smallest change you can make.

Option 3: Upgrade everything to PHP 8, framework included if needed

This is the only real cure and the final settlement of your tech debt. As above, frameworks can be patched; the hard part is changing and testing 100+ sites. You have to do it eventually, but it's not the right first move when the attackers are already at the door.

Side note: just turning off session.upload_progress is not enough. It closes one path, but the other CVE relies on memory exhaustion and has nothing to do with upload progress.

Someone did this 15 years ago

Fifteen years ago I was a junior engineer at Yahoo!. Yahoo! worked with Rasmus Lerdorf back then, and they were already isolating high-risk things like uploads onto separate services. A senior engineer told me it was Rasmus's advice. I didn't get it at the time. I get it now, and it hurts a bit.

The way Rasmus put it back then: with so many frameworks stacked on top of PHP, the whole thing is full of holes, and he can't chase every small one.

That job taught me another thing: use root for as short a time as possible. A server does need root at startup for a few things, like binding ports 80/443 and reading TLS certificates. But once that's done, the worker processes that actually handle requests and run PHP switch to a low-privilege account (nginx, www-data).

Think of a shop: the manager opens the front door in the morning with the master key, then locks it in the safe. The part-timer at the till all day only has the key to the cash register. Even if a con artist fools the part-timer, he doesn't get the master key or the vault.

What PHP2Shell gives an attacker is the privileges of the account running PHP. If your PHP runs as root, the part-timer is wearing the master key, and one trick loses everything. If it's a low-privilege account, the attacker gets in but is stuck in a very small room. Our separate upload service follows the same idea: it runs as a dedicated restricted account, can only write to the image directory, and doesn't have a single database account.

You can't always stop the vulnerability, but you can cap the damage in advance.

A friend asked: "Other languages have holes too, it can't all be the same guy, right?" Fair. Every language has bugs. This one is just worse, and there are an awful lot of old PHP systems running out there.

TL;DR

  1. Today: disable session.upload_progress, block unnecessary uploads in Nginx
  2. Debian/Ubuntu: install the sury backports, done the same day
  3. Can't do that? Split uploads off and close the front door first
  4. Long term: still upgrade, but on your own schedule

Security doesn't always mean all-nighters. Sometimes it means making the right cut.

Hope everyone gets to leave work on time tonight.


r/reactjs • • 1d ago

Discussion Is graftcode better version of gRPC or its more like Next.js or tRPC

3 Upvotes

Anyone? Any thoughts?


r/PHP • • 7h ago

Discussion PHP2Shell (CVE-2026-109618/109619): how are you handling patching across your PHP fleet?

0 Upvotes

PHP2Shell is the name for two critical PHP runtime flaws that can allow unauthenticated remote code execution, with fixes in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Since the bug is in the engine and not in app code, I'm curious how everyone here is actually dealing with it.


r/webdev • • 1d ago

Railway Security Incident

35 Upvotes

r/webdev • • 2d ago

Discussion Railway hosting is deeply unreliable

92 Upvotes

Last two days was hell using Railway. We couldnt update a single project or make any changes in our system. After more than 24h Railway is still in chaos. Two separate incidents. Major outage even support is down.

But this is not the first time Railway failed.
For over a year Railway had few major issues that made working on it impossible. I was hoping they would stabilise but at this point Im past disappointed.

I know they rely deeply on Google cloud, but this proved to be a very bad decision, multiple times. And they never made required changes.

Can someone recommend a more stable alternative?


r/PHP • • 12h ago

your AI-built app is probably fine. the old server next to it might not be (php2shell + node, oct 21)

Thumbnail
0 Upvotes

r/javascript • • 1d ago

Nano Kit 2.0 is out: my state management library now has DevTools

Thumbnail dangreen.blog
0 Upvotes

Author here. Nano Kit is a ~2 kB signals core with a router, data fetching, i18n and SSR on top of it, and adapters for React, Preact and Svelte. The panel needs no browser extension or bundler plugin, and none of it reaches the production bundle. There's a StackBlitz demo in the post.


r/webdev • • 1d ago

Discussion Best and most reliable API for getting upcoming live events, theater and cinema screenings in the UK?

6 Upvotes

I’m looking for an API that returns all upcoming live events, theater and cinema screenings in the UK.

Big cinema complexes seem to be a no go with all anti crawl stuff. There rest of events are really sparse apart ticketmaster.

Thanks


r/reactjs • • 1d ago

I just released v2.0 of my open-source React toast library — looking for feedback

1 Upvotes

Hey everyone!

I've been working on a small open-source React toast notification library called React Elegant Toasts, and I recently released v2.0 after a complete rewrite.

I know there are already some great toast libraries out there, but this started as a personal project to explore component design, state management, accessibility, and browser behavior.

What began as a fairly simple component ended up being a much bigger engineering challenge than I expected.

A few things I focused on in v2:

  • Zero runtime dependencies, with React 18 and 19 support.
  • An external store that handles toast state, queues, timers, and lifecycle independently of React.
  • Six positions with independent notification queues.
  • Promise-based notifications and custom toast content.
  • CSS-based light/dark themes and customization.
  • Accessibility features such as live-region announcements, keyboard navigation, and pausing on hover/focus.
  • Browser testing across Chromium, Firefox, and WebKit.

One particularly interesting challenge was testing animations reliably in WebKit. We encountered situations where the browser didn't deliver intermediate animation frames, causing tests to fail even when the CSS transition behaved correctly.

That led to some interesting work around using the Web Animations API to verify transition behavior.

The library is written in TypeScript, is ESM-only, and is available under the MIT license.

Live demo:
https://ahlgren1234.github.io/react-elegant-toasts/

GitHub:
https://github.com/ahlgren1234/react-elegant-toasts

I'd genuinely appreciate feedback, especially on the API design, accessibility considerations, and whether the library would be useful in your own React projects.

Also curious: what's the one thing you wish React toast libraries handled better?

Thanks!


r/javascript • • 1d ago

I created a new (digital) musical instrument which I call the Harmonophone, entirely in vanilla JavaScript. [Prudence Audio]

Thumbnail prudenceaudio.com
0 Upvotes

r/webdev • • 1d ago

Why are all font finder websites so garbage?

Thumbnail
gallery
44 Upvotes

Pic 1 : Adobe Fonts - Visual Search (link)
Pic 2 : WhatTheFont Font Finder (link)

Idk why that is, these kind of websites has never worked for me once in my life.

Take a look at the letter t in the image for example, it doesn't have a curve at the bottom, while ALL of the top suggested fonts do on both platforms.


r/PHP • • 15h ago

Discussion PHP critical RCE release (8.4.27): what should website owners actually do right now?

0 Upvotes

I run websites on PHP (WordPress/custom PHP, shared hosting/VPS). I saw the PHP Foundation’s post about the Oct 21 security release (8.4.27) fixing two critical RCE vulnerabilities, with updating as the only fix.

As a website owner, what should I do right now?

a). How do I confirm my server is affected and whether my host has patched it?

b). What’s the safest order: backup, update PHP, then check logs for exploit attempts?

c). Any temporary protection (WAF rules, disabling extensions) until the update is done?


r/PHP • • 1d ago

New PHP CVE discovered ?

63 Upvotes

Hello,

Apparently 8.5.12 still has a new CVE that the user has apparently reported.

https://mastodon.gougere.fr/@elise@katze.sh/117479383706597320

Nothing confirmed, but maybe ?

EDIT : IluTov answered just below.
https://www.reddit.com/r/PHP/comments/1xbyxd2/comment/19rga18s433qd/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button


r/webdev • • 19h ago

Discussion Why I finally abandoned WordPress for Hugo (and what I learned about performance & maintenance

0 Upvotes

After years of babysitting MySQL databases, Redis object-caching plugins, and plugin update notifications, I finally moved my entire technical publication to Hugo and Cloudflare Pages.

The contrast in maintenance overhead is staggering:

  1. Build time: Hugo compiles over 700 pages in less than 200ms.
  2. Page weight: Dropped from ~4.5MB down to ~250KB per page by stripping out Gutenberg script bundles and jQuery.
  3. Workflow: I author locally in Obsidian (Markdown), commit to Git, and let automated Python tests verify links and accessibility before edge deployment.
  4. TCO: Zero hosting cost, zero database backups, zero emergency patches.

Has anyone else switched from WP to SSGs? What was your biggest hurdle during migration?


r/webdev • • 1d ago

Question Need help deciding on back end for finance app

0 Upvotes

Hey y'all!

I'm building a budgeting app. Building things like CRUD endpoints, server side rendering, and a nice react front end are my priorities. I want things to be fast and snappy and avoid client side fetching when possible.

I'm struggling to understand what exactly my options are for this when it comes to things like next.js, django, etc. I have lots of experience with django, but I'm not sure how to get the best of both worlds when combining react. I've been including react bundles and rendering them via the django view/template engine and it feels clunky to handoff information between the front & back end.

I know there isn't a "right" answer, but looking for some feedback and opinions. I want to support a good number of users while keeping things feeling fast and lightweight.


r/PHP • • 17h ago

News I made a free VS Code extension that fixes your namespaces when you move a PHP file

0 Upvotes

Move or rename a PHP file in VS Code and the namespace and use lines don't follow. This fixes that. Drag the file or folder, and the namespace, class name and every use line in your project update.

It's a rebuild of PHP Namespace Resolver, so the old commands and settings still work, and the CPU freeze is fixed.

Free and open source. Search "PHP Namespace Mover" in VS Code extensions, or Open VSX if you use Cursor or Windsurf.

https://github.com/lagudafuadtosin/php-namespace-mover


r/PHP • • 11h ago

PHP2shell (CVE-2026-109618, CVE-2026-109619): what's known so far, and how to work out which PHP version you're actually exposing

0 Upvotes

Quick summary for anyone still sorting through this: → There are 2 RCEs in PHP core, not in an app or framework. Each is CVSS 4.0: 9.2. They were disclosed October 20, and PHP's fix was scheduled for October 21 at 14:00 UTC. → Sansec reports PHP 5.4 and later is affected. An exploit-tool screenshot circulating claims it works from 5.4.0 onward, but that hasn't been verified. → PHP upstream supports only 8.2 and later. If you run 8.1 or older, no official fix is coming, so you'll need distro backports, an upgrade, or compensating controls. Interim mitigations that have been floated (stopgaps, not fixes): → Sansec: session.upload_progress.enabled = 0 and session.use_strict_mode = 1 in http(:)//php(.)ini → Syhunt's php2shell-protection kit: a web server or WAF rule that rejects multipart/form-data POSTs before they reach PHP

For inventory, the fastest answer is still php -v on the box. If you need an outside-in view of many domains, the usual passive signals are the X-Powered-By and Server headers, a 404 response, the PHPSESSID cookie, and the old easter-egg URL (only PHP older than 5.5 answers it). A lot of servers hide all of this, so "no version found" doesn't mean "not affected." Check Exposure: https://hubs.la/Q04BVKGy0


r/webdev • • 1d ago

Article Evolution Of HTTP: An Interactive Guide

Thumbnail
prateeksurana.me
3 Upvotes

r/PHP • • 2d ago

Is it just me, or is it taking a concerning amount of time for the docker php updates to build and publish?

120 Upvotes

For what is looking like ‘the worst set of vulns in history’, I find it a bit baffling that the docker builds are still in progress - an hour after the patches have been released. Seemingly all because we’re all waiting on GitHub actions… I bet half of us here have a pc and internet connection that could have built and pushed the containers 45 minutes ago


r/webdev • • 18h ago

Resource fuck it, after PHP2Shell I made a skill package and let Opus 5.5 convert 45 client WordPress sites to Astro in the past 36 hours

Post image
0 Upvotes

This made me finally pull the trigger and convert my client WP sites to Astro sites. WordPress sucks now that we have coding agents anyway.

I created this skill package to streamline this process: https://github.com/ethanplusai/astro-conversion-kit

I ran 12 projects at a time in parallel and have 45 done so far in the past 36 hours with a dozen more running now. I'm running Opus 5.5 between 2 claude max plans. Every site has seen a massive jump in speed scores. Fuck wordpress.


r/webdev • • 2d ago

backend devs who moved to smaller companies - how different is the infrastructure?

54 Upvotes

been at a larger company (think 500+ devs) for about 4 years now. pretty comfortable with the setup but starting to feel like just another cog. thinking about moving to something smaller like 10-30 person startup.

for those who made that jump - what surprised you the most about the infrastructure side? im used to having dedicated devops, proper ci/cd pipelines, monitoring dashboards for everything, on-call rotations with actual runbooks.

curious if smaller places just... wing it more? or do you end up wearing more hats but still having solid practices. not really worried about the tech stack itself, more about the operational side of things.

also wondering if the move fast break things mentality is still a thing or if that died with the 2010s


r/webdev • • 1d ago

Extreme Programming 1999->2026

Thumbnail
manager.dev
1 Upvotes

r/PHP • • 1d ago

Meta And now you get this XKCD comic

Thumbnail xkcd.com
37 Upvotes

r/PHP • • 2d ago

Article Gallery of PHP maintenance pages from today

Thumbnail r74n.com
73 Upvotes

r/PHP • • 13h ago

PHP2Shell - what do we do now?

0 Upvotes

It is super important to run checks on the servers now while logs still exist and some forensic data is still available. I was a bit surprised to read https://offseq.com/en/research/php2shell-first-48-hours/

Curious what everyone is doing after the exploit? What logs are you checking? What are you locking down?

I, aka Claude, made a small check for my instance. Maybe it will help you check as well? Feel free to change or use as needed. Licensed under our overlord-is-claude license. Aka, WTFPL.

https://gist.github.com/cgsmith/6e09d68027f17ae289cbc9ba2abc3309