PHP Security Issues to Watch in 2026
Unserialize, file uploads, sloppy queries, and dead PHP versions: the vulnerability classes that keep hitting PHP sites, and a hardening checklist.
27 Oct 2026 · 6 min read · Hazentic Quantum
PHP runs an enormous share of the web, and most PHP incidents we see are not exotic zero-days. They are the same handful of mistakes, repeated on sites nobody has looked at in years. A small business site on an old PHP version with an upload form and a few plugins is a better target than a well-defended big site, precisely because nobody expects it to be attacked.
Here are the vulnerability classes that keep showing up, and what to do about each one.
1. Running a dead PHP version
This is the least glamorous and most important item on the list. Every PHP branch gets a few years of support and then stops receiving security fixes entirely. As of late 2026, the supported branches are PHP 8.2 through 8.5, with 8.2's security support ending on 31 December 2026. Anything on 8.1 or older gets no upstream fixes at all — and October 2026 brought a critical PHP security release affecting web-facing installations, which is exactly the kind of flaw that does not wait for you to get around to upgrading.
Check your version today. In WordPress it is under Tools, then Site Health, then Info, then Server; in cPanel, under MultiPHP Manager. If the answer is 8.1 or older, plan the upgrade now: back up first, test on a staging copy if your host offers one, and target 8.4 or 8.5 rather than 8.2, so you are not doing this again in January. And check the official advisories on php.net — the PHP project's own announcements are the source of truth, not a blog summary.
2. Unserialize on user input
PHP's unserialize() turns a stored string back into a live object, and it has been a known danger for years: if an attacker controls that string, they can trigger object injection and, in the worst cases, remote code execution. Modern code should almost never call it on anything that came from a user, a cookie, or an API.
The practical rule is simple. If you see unserialize() in your codebase, find out what feeds it. If the answer involves user input in any way, replace it with json_decode() and a strict schema check — JSON cannot instantiate arbitrary classes, which is the whole point. If a plugin or library unserializes user data, treat that as a finding: patch it or replace the dependency.
3. File uploads done carelessly
Upload forms are one of the most reliable ways into a PHP site, because the failure mode is so direct: an attacker uploads a file, the server stores it somewhere web-accessible, and then the attacker visits it and runs it. The classic version is a PHP file disguised as an image. The subtler version is a legitimate file type stored in a predictable location with no access control.
A safe upload handler does several boring things, every time. Check the file's actual type, not just its extension. Rename the file on upload — never trust the original filename, which can contain path tricks. Store uploads outside the web root where possible, and serve them through a script that checks permission. Set a size limit. And never let an upload directory execute PHP: a server rule disabling script execution there costs nothing and closes the whole attack class even if another check fails.
4. SQL injection through sloppy queries
This one is old enough to be embarrassing and common enough that it still tops vulnerability lists. It happens whenever user input is stitched directly into a database query string instead of being passed as a parameter. One crafted input field later, the attacker is reading tables they were never meant to see.
The fix has not changed in twenty years: use prepared statements with bound parameters, everywhere, without exception. In PDO or mysqli, that means placeholders, not string concatenation. Then add a second layer: database accounts with the minimum permissions the app needs. A read-only account cannot drop tables, no matter what input it receives. If your codebase still builds queries by gluing strings together, that is not technical debt. That is an open door.
5. Outdated dependencies and forgotten plugins
The PHP code you wrote is usually not the weakest part of your site. The weakest part is the plugin installed in 2021, the abandoned package in composer.json, or the admin theme nobody remembers adding. Attackers do not audit your code. They scan for known-vulnerable versions of popular software and try the public exploit.
Run composer audit and actually read the output. Update what you can, remove what you do not use, and delete deactivated plugins and themes instead of leaving them on disk — deactivated code can still be reached directly in many setups. Put dependency updates on a monthly reminder. The same dependency risk hits Node.js sites — see Node.js threats in production.
Hardening checklist
- [ ] Confirm your PHP branch is supported; plan the upgrade if not.
- [ ] Search the codebase for
unserialize()on user-controlled data and replace it with JSON. - [ ] Uploads: verify type, rename files, store outside the web root, disable script execution.
- [ ] All database queries use prepared statements; database users have minimum permissions.
- [ ] Run
composer audit, update or remove vulnerable packages, delete unused plugins and themes. - [ ] Turn off error display in production — stack traces are free reconnaissance.
- [ ] Check php.net's security announcements monthly, and apply releases promptly.
None of this is exciting, and all of it is cheaper than cleaning up after a breach. If your site has been running untouched for a year or more, that checklist is a good afternoon's work — and if you would rather hand it to someone, our custom web apps work includes security reviews — see our work — or reach us through contact us. For a live example of a flaw in PHP itself, see PHP2Shell: two critical PHP flaws.
FAQ
How do I check which PHP version my site runs?
In WordPress, go to Tools, then Site Health, then Info, then Server. On cPanel hosting, look under MultiPHP Manager. If unsure, ask your host which version the site runs and whether it still receives security fixes.
What is the single most important PHP security step?
Run a supported PHP version and keep it patched. An unsupported version means known flaws will never be fixed for you, no matter how careful the rest of your code is.
How often should we check for PHP security updates?
Monthly at minimum, and immediately when php.net announces a security release. Security releases are not feature updates — they exist because something is already being exploited or is about to be.
Let’s find your bottleneck.
Tell us what is slowing the business down. We reply within one business day — with an honest answer, even if we are not the right fit.
Free website teardown · contact@hazenticquantum.com