Notes · Oleksandr Osadchyi · Updated · 6 min read

After PHP2Shell (CVE-2026-109618): a weekly Magento security check with Claude Code

PHP2Shell (CVE-2026-109618) is fixed in PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, so the Magento security check for it is short. If your Magento or Adobe Commerce store runs one of those versions and the PHP workers were restarted, this bug is closed. The next one is still open, and my answer to it is a weekly AI security check of the code that goes into each release, run with Claude Code, with every finding filed as a ticket.

I am Oleksandr Osadchyi, an ex-Magento 2 core and ex-Adobe Commerce core engineer, Adobe Certified Master (Adobe Commerce Architect) and PHP architect.

PHP2Shell (CVE-2026-109618, CVE-2026-109619) in two minutes

CVEWhat it doesCVSS v4
CVE-2026-109618A crafted multipart request pushes PHP past memory_limit; the out-of-memory crash leaves memory half-initialised, and the attacker turns that into code execution.9.2
CVE-2026-109619A fatal error leaves a pointer to freed memory inside the worker, and the next request on that worker uses it.9.2

Both are bugs in PHP itself and need no account. Calif confirmed remote code execution without a login on Magento 2.4.9. No Magento patch closes it. Already patched? Check the version on the command line and in FPM, then restart the workers (replace 8.3 with your line):

php -v
php-fpm8.3 -v
sudo systemctl restart php8.3-fpm

php.net published no release for PHP 8.1: Magento 2.4.6 can move to 8.2.35, while 2.4.4 and 2.4.5 need a backported fix from the distribution or hosting vendor and an upgrade plan (dates in Magento 2 end of support dates).

Why patching is not enough any more

The vulnerable code has been in PHP since 5.4.0, released in 2012, and a related out-of-memory bug, #78876, was reported in 2019 and treated as denial of service only. In 2026 three teams independently turned that crash into code execution; Calif did it with an LLM agent on generally available models, and Wiz writes that one researcher did in about a week what used to take months. Attackers were ahead of the fix: Amazon logged an exploitation attempt on October 17, four days before the release, and CISA added both CVEs to its Known Exploited Vulnerabilities list on October 26. In November 2025 Anthropic reported an espionage campaign in which AI did 80 to 90 percent of the work. Magento stores are a regular target: Sansec estimated that 16 to 18 percent of all Magento stores had backdoors by October 26, 2025 after SessionReaper, and counted 4,275 stores hacked through CosmicSting. A PHP update closes two CVEs; a quarterly audit leaves three months of your own releases unread, and the same models are available to your team.

The weekly Magento security check, step by step

The check reads what changed since the last release, before deploy. A team can set it up in a day.

  1. Define the scope. In a Magento or Adobe Commerce release the scan covers:
    • the diff of custom modules in app/code and theme templates (.phtml output escaping);
    • composer.lock: new and updated packages;
    • GraphQL resolvers and REST endpoints in webapi.xml, above all anything with anonymous access;
    • checkout and payment code;
    • admin routes and their ACL resources in acl.xml;
    • file uploads, unserialize, eval, template and email-variable injection;
    • secrets in config: keys and passwords in app/etc/config.php, committed env.php, module code;
    • on headless stores, the PWA, Hyvä or Next.js frontend repository: API routes, tokens in client bundles, server-side requests to Magento.
  2. Run it locally on the release branch. /security-review is built into Claude Code and makes one pass over the pending changes of the current branch:
    git checkout release/2026-11-20
    claude
    /security-review
    To add the scope above, copy security-review.md from the action repository into .claude/commands/ and edit it.
  3. Put it on the release pull request. The GitHub Action scans the diff and posts inline comments:
    name: Security review
    on:
      pull_request:
        branches: [main]
    permissions:
      pull-requests: write
      contents: read
    jobs:
      security:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
            with:
              ref: ${{ github.event.pull_request.head.sha }}
              fetch-depth: 2
          - uses: anthropics/claude-code-security-review@main
            with:
              claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
              comment-pr: true
              exclude-directories: vendor,generated
    It returns findings-count and results-file for later steps. It is not hardened against prompt injection, so run it only on pull requests from your own team.
  4. Once a week, release or not, run a deeper pass on the working branch with the Claude Security plugin (any paid Claude Code plan):
    /plugin install claude-security@claude-plugins-official
    /claude-security scan my branch at high
    It writes RESULTS.md and a .sarif file into CLAUDE-SECURITY-<timestamp>/, with suggested patches in patches/ that are applied by hand with git apply. The SARIF file uploads to GitHub code scanning.
  5. Turn each finding into a ticket the same day:
    gh issue create --repo OWNER/REPO --title "SQL injection in Vendor_Module resolver" --body-file finding.md --label security
    
    claude mcp add --transport http atlassian https://mcp.atlassian.com/v2/mcp
    The second command connects Jira: sign in with /mcp, then ask Claude to create a work item per finding.
  6. Decide who fixes what before the release. A developer confirms every finding first.
    • Critical and High: the release waits. The developer who wrote the change fixes it, and the scan runs again.
    • Medium: ticket in the next sprint with a named owner.
    • Low: backlog, reviewed monthly.
  7. Once a month, scan the whole repository: /claude-security, then "Scan codebase". Old code gets read with this month's model.

On the Enterprise plan, Claude Security (beta) replaces steps 4 and 7: it connects up to 8 repositories, writes a threat model, scans as commits land, verifies each finding and sends it to Jira or Slack by webhook. Project setup for Claude Code itself is in how to set up Claude Code for Magento 2.

What I set up for you

Terms are on the pricing page.

FAQ

Is my Magento store still exposed to PHP2Shell (CVE-2026-109618) after updating PHP?

No, if php -v and the FPM binary show 8.2.35, 8.3.36, 8.4.27 or 8.5.12 and the workers were restarted after the update. A distribution that patches its own build may keep an older number: apt changelog php8.3-fpm | grep CVE-2026-109618. An update does not remove a backdoor, so check for traces from October 17.

How often should a Magento store run a security check?

On every release, and at least once a week. PHP2Shell was attacked four days before its patch existed, and Claude Security on the Enterprise plan already scans on each commit.

Can a Claude Code security review find vulnerabilities in Magento custom modules?

Yes. /security-review checks a branch diff for SQL injection, XSS, authentication and authorisation flaws, insecure data handling and vulnerable dependencies. Anthropic notes that scans are stochastic, and Calif writes:

No model is simply capable of unearthing 'all bugs' with simple prompts.

That is why the check repeats every week and a developer confirms each finding.

What does a weekly security check cost in time?

About a day to set up. After that the scan on the pull request runs by itself in CI, and the team's time goes into reading findings and fixing the confirmed ones. A first full scan with Claude Security takes from minutes to hours, according to Anthropic.

Does it work for headless Magento?

Yes. The scan covers GraphQL resolvers and REST endpoints in the Magento repository and the frontend repository next to it. Claude Security on the Enterprise plan connects up to 8 repositories in one project.