php-hardening

php-hardening is a skill for Claude Code from Kin9Zeus/senior-engineer-skills. It costs 221 tokens per session (2,492 once invoked), scanned A, original, MIT.

A defensive guide for securing PHP runtimes and PHP applications. PHP is the software that runs many web applications, while PHP-FPM and Apache are components that serve those applications.

In plain words
What is it for?
Use it to inventory PHP installations, apply patches, harden php.ini and PHP-FPM, move from Apache mod_php to FPM, and review Laravel, Symfony, WordPress, or plain PHP code.
Why use it?
It helps teams respond to serious PHP flaws, reduce what a compromised process can access, and fix insecure server settings and application code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the senior-engineer-skills plugin — 20 skills, 14 commands, 8 agents shipped together

Good fit Use it to inventory PHP installations, apply patches, harden php.ini and PHP-FPM, move from Apache mod_php to FPM, and review Laravel, Symfony, WordPress, or plain PHP code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kin9zeus/senior-engineer-skills/php-hardening
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Kin9Zeus/senior-engineer-skills --skill php-hardening
Clone the repo
git clone --depth 1 https://github.com/Kin9Zeus/senior-engineer-skills

Made for: Claude Code.

Or install senior-engineer-skills, the plugin that ships this one along with the rest of its 20 skills, 14 commands, 8 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for php-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/php-hardening/github.svg)](https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/php-hardening)
Your own site
<a href="https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/php-hardening"><img src="https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/php-hardening/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for php-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/kin9zeus/senior-engineer-skills/php-hardening"><img src="https://agentmods.dev/badge/skills/kin9zeus/senior-engineer-skills/php-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 221 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,492 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00221 $0.02492
Opus 5.5 $0.00088 $0.00997
Sonnet 5.5 $0.00044 $0.00498
Haiku 4.5 $0.00022 $0.00249

Measured 2d ago against content hash d6e43b6698cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

php-hardening scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/php-check.ps1, scripts/php-check.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/php-hardening/SKILL.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP Hardening

PHP runs a very large share of the public web, which is why a flaw in the interpreter itself is an event, not a nuisance. This skill does three things in order: get patched, shrink what a flaw in PHP could reach, and fix the PHP-shaped bugs in the application.

Scope: PHP systems the user owns or is authorised to assess. Defensive only: inventory, patch, configure, detect, fix. No exploit code, no probing of third-party hosts.

Fact-check rule. Versions and advisories change. The incident facts below are dated; before relying on them, re-read the official PHP advisory and your distribution's advisory. Never assert a CVE or a fixed version from memory.


1. The order of work

1  INVENTORY   every PHP you run — including copies you did not install
2  PATCH       upgrade, restart every worker, verify the RUNNING build
3  REDUCE      config that blocks known attack paths + shrinks blast radius
4  ASSUME      if exposed and unpatched in the window, treat as possibly compromised
5  HUNT        shells from web workers, new files, outbound traffic, crashes
6  HARDEN      baseline config, then application code, then dependencies
7  PREVENT     patch SLA, image rebuilds on advisory, detection that fires

Steps 1–5 are the incident (security-incident-response is the parent playbook); 6–7 are the lasting work.


2. Incident: "php2shell" (October 2026)

Last verified: 2026-10-23. Details evolve — confirm against the sources.

What was disclosed. On 21 October 2026 the PHP project released emergency fixes for CVE-2026-109618 and CVE-2026-109619, two critical flaws in the core interpreter allowing unauthenticated remote code execution against installations that serve web requests. CISA published an alert the same day.

Fixed releases PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35
PHP 7.4 – 8.1 No official release; the PHP security team published minimal source backports. Get a fixed build from your distributor, apply the backport, or upgrade
Older / EOL No fix from the project. Treat as unfixable in place — migrate or isolate
Root causes (per Tenable's summary) 109618: out-of-memory handling leaves request data half-initialised and cleanup treats it as valid. 109619: use-after-free from stale global state reused by a later request on the same worker
Reach Every SAPI that serves web requests: PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed. Highest risk reported for mod_php
Application-independent The bug is in PHP, not in WordPress/Laravel/your plugins. Updating the app does not fix it
Exploitation Reports conflict: Amazon Threat Intelligence reported an attempt on 17 October, four days before disclosure, and broader attempts after; CISA's alert said it had not observed exploitation at publication; neither CVE was in CISA's KEV catalogue as of 22 October. Treat as actively exploited

Read the full file on GitHub · 171 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 171 lines · 221 tokens per session scan A d6e43b6698cb

Subscribe to this mod's changes

php-hardening is a skill published in the GitHub repository Kin9Zeus/senior-engineer-skills (3 stars, last pushed 2d ago), licensed MIT. It adds 221 tokens to every session and 2,492 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-24.

Related

Other skills, from other repositories

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

php-pro

Use when building PHP applications with modern PHP 8.3+ features, Laravel, or Symfony frameworks. Invokes strict typing, PHPStan level 9, async patterns with Swoole, and PSR standards. Creates controllers, configures middleware, generates migrations, writes PHPUnit/Pest tests, defines typed DTOs and value objects…

Jeffallan/claude-skills · 107 tokens

llamaindex-development

Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.

Mindrally/skills · 32 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 70 tokens

craft-php-guidelines

Craft CMS 5 PHP coding standards and conventions. ALWAYS load when writing, editing, reviewing, or discussing any PHP in a Craft plugin or module — even small edits. Also when running ECS, PHPStan, or scaffolding with ddev craft make. Covers: PHPDoc blocks (@author, @since, @throws chains), section headers…

michtio/craftcms-claude-skills · 177 tokens

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 175 tokens