Tag: Detection Engineering

Detecting stolen GitHub tokens after SAP’s incident: 4 Sigma rules for the audit log

Detecting stolen GitHub tokens after SAP’s incident: 4 Sigma rules for the audit log

When a vendor says “suspicious activity” and the insiders say “stolen GitHub tokens,” the useful question for a defender is not what happened at SAP. It’s whether you would notice the same thing in your own GitHub organisation. In my analysis of the SAP incident I separated what SAP confirmed from what an insider told Der Spiegel and what company sources told Handelsblatt. This post is the practical half.

You get four Sigma rules for the GitHub audit log: one correlation for bulk cloning by a single token, two rules for attempts to get code past branch protection, and one hunting rule to find the classic personal access tokens that make this kind of theft worthwhile. None of them uses an indicator from the SAP case, because none has been published.

At a glance

  • Rules: 4 (one is a Sigma v2 correlation with its base rule in the same file).
  • Domain: Cloud-SaaS (GitHub).
  • Log source: product: github, service: audit, streamed from your organisation or enterprise to the SIEM, with Git events and token metadata.
  • ATT&CK: T1213.003 Code Repositories, T1550.001 Application Access Token, T1562.001 Disable or Modify Tools, T1565.001 Stored Data Manipulation.
  • Status: all experimental. The logic is inferred from reported behaviour, not from published IOCs.
  • GitHub: Detection Rules/Cloud/SaaS.

The case in brief

SAP confirmed on November 26, 2026 that it had identified suspicious activity and found no evidence of unauthorized access to customer business data. An insider cited by Der Spiegel said attackers had obtained SAP employees’ GitHub authentication tokens, which let them copy and alter source code. Handelsblatt reported a response called “Project Granite”; SecurityWeek, CyberInsider and the CSA, citing Handelsblatt, add that SAP limited GitHub access, paused automated development and replaced signing keys. SAP has confirmed none of those details, and nobody has said how the tokens were stolen. The analysis has the full picture.

For detection, that reported story breaks into four steps with different footprints. Nobody has said how the tokens were stolen; wherever that happened, it was outside GitHub, so the audit log won’t show it. Copying code shows up as git.clone and repo.download_zip events. Altering code shows up as git.push, and if branch protection is in the way, as overrides, rejected pushes or changes to the protection itself. GitHub attaches a hashed_token (a SHA-256 of the token) and a programmatic_access_type to many audit events, which is what ties those steps back to one credential.

Detection map

Detection map: GitHub audit log stream and Git events feed four Sigma rules (bulk clone correlation, protection change, override or rejected push, classic token hunt), mapped to T1213.003, T1550.001, T1562.001 and T1565.001, with token theft marked as a gap.
One log source, four rules. The theft of the token itself stays outside GitHub’s view.

Everything here depends on one telemetry source, and that is both the strength and the weakness of the set. If you stream the GitHub audit log with Git events, all four rules have their data, with one caveat: token metadata on Git events is still in public preview, and rules 1, 3 and 4 lean on token fields. If you don’t, none of them do, and you can’t fix it after the fact: Git events never show up in the web interface, and on Enterprise Cloud the REST API keeps them for seven days. The dashed box on the right is the honest gap: the theft of the token itself is outside GitHub’s view.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Single token clones many repositories within one hourCloud-SaaSgithub / auditCollection / T1213.003; Defense Evasion / T1550.001MediumExperimental
Branch protection removed or signing and force-push rules changedCloud-SaaSgithub / auditDefense Evasion / T1562.001MediumExperimental
Protected-branch override or rejected push using a tokenCloud-SaaSgithub / auditImpact / T1565.001; Defense Evasion / T1550.001MediumExperimental
Git activity with a classic personal access tokenCloud-SaaSgithub / auditDefense Evasion / T1550.001Low (hunting)Experimental

The rules

Single GitHub access token clones many distinct repositories within one hour

Context: “copy source code” is the reported step with the clearest log trail. A developer’s token usually touches a handful of repositories a day. An attacker with that token and a list of everything it can read tends to pull as much as possible, quickly, before someone revokes it.

Condition: a base rule keeps git.clone and repo.download_zip events that carry a hashed_token. The correlation counts distinct repo values (a common field on GitHub audit events; check your pipeline keeps the name) per hashed_token and fires at 25 or more within one hour.

ATT&CK: Collection (TA0009) – T1213.003 Data from Information Repositories: Code Repositories; Defense Evasion (TA0005) – T1550.001 Use Alternate Authentication Material: Application Access Token.

title: GitHub Git Clone or Source Archive Download Using an Access Token
id: 73613233-1c56-4b42-81ea-1750b63b4979
name: github_audit_git_clone_or_archive_download_by_token
status: experimental
description: |
    Base rule for the correlation below. Matches GitHub audit log git.clone and repo.download_zip events
    that carry a hashed token, meaning they were authenticated with a token or key rather than a browser session.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM with Git events included. Git events are not shown in the web UI and the Enterprise Cloud REST API keeps them for 7 days. Token metadata on Git events is in public preview. The correlation counts the repo field (a common GitHub audit field); check your pipeline does not rename it.'
detection:
    selection:
        action:
            - 'git.clone'
            - 'repo.download_zip'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - CI runners, mirroring jobs, backup tools and code-scanning services that clone many repositories with one token
level: low
---
title: Single GitHub Access Token Clones Many Distinct Repositories Within One Hour
id: 1550313d-5018-4c24-8e89-72ca663dd413
status: experimental
description: |
    Detects one GitHub access token (grouped by hashed_token) cloning or downloading archives of 25 or more
    distinct repositories within one hour. In the SAP incident, an insider reported that stolen employee GitHub
    tokens let attackers copy source code; bulk cloning with a developer's token is how that would look in the audit log.
    Threshold and logic are inferred, not taken from a published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
    - attack.defense-evasion
    - attack.t1550.001
correlation:
    type: value_count
    rules:
        - github_audit_git_clone_or_archive_download_by_token
    group-by:
        - hashed_token
    timespan: 1h
    condition:
        gte: 25
        field: repo
falsepositives:
    - Automation tokens used by CI, backup, mirroring or code-scanning tools; allowlist their hashed_token values after review
    - Developers bootstrapping a new machine with a script that clones every team repository
level: medium

View on GitHub

False positives and tuning: CI runners, repository mirrors, backup tools and code-scanning services do exactly this every night. Run the base rule alone for a week, list the tokens that cross 25, and allowlist the ones you can explain by hashed_token, not by user name (a stolen token keeps its owner’s name). Then think about lowering the threshold for human accounts. If your SIEM can’t do Sigma correlations, convert the base rule and do the distinct count in the SIEM’s own query language.

How to test: in a lab organisation, create a test token and clone 25 or more small test repositories in a loop within an hour. Confirm that git.clone events with a hashed_token reach the SIEM first; if they don’t, fix the streaming setup before touching the rule.

GitHub branch protection removed or signing and force-push rules changed

Context: altering code that ships means getting past the controls on release branches: required reviews, required signed commits, no force pushes, rules that also bind administrators. An attacker with an admin’s token can simply switch those off. So can a tired admin at 11 p.m., which is why this rule is medium and not high.

Condition: alert on any of protected_branch.destroy, protected_branch.update_signature_requirement_enforcement_level, protected_branch.update_allow_force_pushes_enforcement_level, protected_branch.update_admin_enforced or repository_ruleset.destroy.

ATT&CK: Defense Evasion (TA0005) – T1562.001 Impair Defenses: Disable or Modify Tools.

title: GitHub Branch Protection Removed or Signing and Force-Push Rules Changed
id: 343e1a93-36da-430b-b720-970323305025
status: experimental
description: |
    Detects GitHub audit log events where branch protection is deleted, a repository ruleset is deleted, or the
    required-signature, force-push or admin-enforcement settings of a protected branch are changed. An attacker
    who wants to alter source code, as an insider reported in the SAP incident, has to get past these controls first.
    Inferred logic; no published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.defense-evasion
    - attack.t1562.001
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM.'
detection:
    selection:
        action:
            - 'protected_branch.destroy'
            - 'protected_branch.update_signature_requirement_enforcement_level'
            - 'protected_branch.update_allow_force_pushes_enforcement_level'
            - 'protected_branch.update_admin_enforced'
            - 'repository_ruleset.destroy'
    condition: selection
falsepositives:
    - Repository administrators reorganising branch rules or migrating from branch protection to rulesets
    - The update events may also fire when a setting is tightened, not only loosened; check the new value in the event
level: medium

View on GitHub

False positives and tuning: the “update” events may also fire when a setting is tightened, so look at the new value in the event before escalating, or add a filter once you know how your SIEM parses it. Scope the rule to repositories that feed builds or releases if your organisation has thousands of scratch repos. Expect a burst of noise during a migration from branch protection to rulesets; suppress by change ticket, not forever.

How to test: in a test repository with a protected branch, turn “Require signed commits” off and back on, then delete the protection rule.

GitHub protected-branch override or rejected push using an access token

Context: this is the integrity signal. A token, not a person in the browser, either forcing a change past a protected-branch requirement or trying to push to a protected branch and being refused. The refused attempt matters as much as the successful one: it tells you someone with a token is probing your release branches.

Condition: alert on protected_branch.policy_override or protected_branch.rejected_ref_update when the event carries a hashed_token.

ATT&CK: Impact (TA0040) – T1565.001 Data Manipulation: Stored Data Manipulation; Defense Evasion (TA0005) – T1550.001 Application Access Token.

title: GitHub Protected Branch Override or Rejected Push Using an Access Token
id: aa421b51-1377-46e7-a151-ba9b3f319167
status: experimental
description: |
    Detects a protected-branch requirement being overridden, or a push to a protected branch being rejected,
    when the event was authenticated with a token or key (hashed_token present). An insider reported that stolen
    SAP employee GitHub tokens let attackers alter source code; a token pushing straight at protected branches,
    successfully or not, is the integrity signal to chase. Inferred logic; no published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.impact
    - attack.t1565.001
    - attack.defense-evasion
    - attack.t1550.001
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM; token metadata (hashed_token, programmatic_access_type) present on events.'
detection:
    selection:
        action:
            - 'protected_branch.policy_override'
            - 'protected_branch.rejected_ref_update'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - Release automation or bots that hold bypass rights on protected branches; allowlist their actor or hashed_token
    - Developers whose local Git client pushes to a protected branch by mistake (rejected_ref_update)
level: medium

View on GitHub

False positives and tuning: release bots and merge automation that hold bypass rights will trigger overrides; allowlist them by actor and hashed_token. Rejected pushes from developers who forgot which branch they were on are common and harmless; if they swamp you, require two rejected pushes from one token within ten minutes, or drop rejected pushes to low and keep overrides at medium.

How to test: with a personal access token in a lab repository, push a commit directly to a protected branch that requires pull requests. You should see a rejected ref update tied to the token’s hash.

GitHub Git activity authenticated with a classic personal access token

Context: this one is a hunt, not an alert. GitHub’s docs say a classic personal access token can access every repository its owner can, and GitHub recommends fine-grained tokens instead. That breadth makes classic tokens the most valuable thing to steal. You can’t protect tokens you don’t know exist.

Condition: list git.clone, git.fetch, git.push and repo.download_zip events where programmatic_access_type contains “classic”. I could not confirm GitHub’s exact string for this field from the docs, so check a real event and adjust the match.

ATT&CK: Defense Evasion (TA0005) – T1550.001 Application Access Token.

title: GitHub Git Activity Authenticated With a Classic Personal Access Token
id: 20a118bf-0c33-4456-a141-331a7a3230e4
status: experimental
description: |
    Hunting rule. Lists Git clone, fetch and push events and source archive downloads authenticated with a classic
    personal access token. A classic token can access every repository its owner can, which makes it the most useful kind
    to steal. Use the result to build a token inventory and to spot tokens used from unusual places or times.
references:
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.defense-evasion
    - attack.t1550.001
    - detection.threat-hunting
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub audit log streamed to the SIEM with Git events and token metadata (public preview for Git events). Check the exact programmatic_access_type value in your own events and adjust the match.'
detection:
    selection_action:
        action:
            - 'git.clone'
            - 'git.fetch'
            - 'git.push'
            - 'repo.download_zip'
    selection_token:
        programmatic_access_type|contains: 'classic'
    condition: all of selection_*
falsepositives:
    - Legitimate scripts and integrations still using classic tokens; that is the point of the hunt, review and migrate them
level: low

View on GitHub

False positives and tuning: every hit is a legitimate use until proven otherwise, and that’s fine. Group the results by hashed_token and actor, and turn the list into a migration plan to fine-grained, expiring tokens. Once a team has migrated, any new classic-token activity from that team becomes worth an alert.

How to test: clone any repository in a lab organisation with a classic token and look for the event.

Coverage and gaps

Step in caseTacticTechniqueRuleCovered?
Employee token stolenCredential Access (TA0006)Unknown method–Gap: outside GitHub
Stolen token usedDefense Evasion (TA0005)T1550.001Hunting, correlation, override rulesPartial
Source code copiedCollection (TA0009)T1213.003Bulk clone correlationYes, for bulk; not for slow, targeted cloning
Protections weakenedDefense Evasion (TA0005)T1562.001Protection or signing changedPartial: ruleset edits and review-setting changes not covered
Source code alteredImpact (TA0040)T1565.001Override or rejected pushPartial: pushes to unprotected branches are invisible
Altered code built and shippedInitial Access, downstream (TA0001)T1195.002–Gap: needs build provenance and signature checks

Three gaps matter. First, the token theft happened outside GitHub, by a method nobody has disclosed, so catching it needs endpoint, CI or browser-side telemetry, not GitHub logs. Second, Sigma can’t express “first time this token has been seen from this network”; do that in the SIEM with a lookup of hashed_token against past source addresses. Third, a quiet attacker pushes to a feature branch and waits for a reviewer to merge it. No log rule catches that. Required reviews, required signed commits and build provenance (SLSA attestations, Sigstore signatures) do, which is why the second rule protects those settings.

Deploying the rules

Grab the YAML from the GitHub folder and convert it with sigma-cli for your SIEM. GitHub audit logs have no standard field mapping in most backends, so check that action, hashed_token, programmatic_access_type and repo match what your ingest pipeline produces, and add a small custom pipeline if they don’t. For example:

sigma convert -t splunk --without-pipeline github_audit_branch_protection_or_signing_requirement_changed.yml
sigma convert -t lucene --without-pipeline github_audit_protected_branch_override_or_rejected_push_by_token.yml
sigma convert -t kusto --without-pipeline github_audit_classic_pat_git_activity.yml

Correlation rules need a backend that supports Sigma correlations; check yours before relying on the bulk-clone rule, or rebuild the count in the SIEM. Run everything in alert-only mode for a week before paging anyone, and make sure the audit log stream actually includes Git events before you trust a quiet dashboard.

My take

Stolen-token activity is detectable in GitHub, but only if you decided to collect the right log before you needed it. My guess is that plenty of organisations have the audit log but not Git events in it, and certainly not more than a week of them. If I could turn on only one thing after reading the SAP story, it would be audit log streaming with Git events. The rule I’d enable first is the protection-change rule, because it is quiet in a well-run organisation and catches the attacker who switches off release controls instead of working around them. It won’t see a push to a feature branch that a reviewer later merges.

I’d also like GitHub to make two things default: Git events visible in the regular audit log search, and a warning when a classic token with no expiration is used against a repository with protected branches. Detection should not depend on setting up streaming in advance to find out that a token was used to clone everything you own.

Sources

SAP’s reported GitHub token theft: a short statement and the integrity question it skips

SAP’s reported GitHub token theft: a short statement and the integrity question it skips

On Thursday evening, November 26, 2026, SAP put out a short statement: it had identified suspicious activity, taken measures, and found “no evidence of unauthorized access to customer business data.” That last line is true as far as anyone knows, and it answers the wrong question. The incident, as insiders describe it, is not about customer data at all. It is about who could read and change SAP’s source code, and for how long.

SAP confirms it saw suspicious activity and took countermeasures. Der Spiegel, citing an insider, reports that attackers stole SAP employees’ GitHub authentication tokens, which let them copy and alter source code. Handelsblatt, citing company sources, names the internal response “Project Granite”; SecurityWeek, CyberInsider and the CSA, citing Handelsblatt, add that SAP restricted GitHub access, paused automated development and replaced signing keys. SAP has confirmed none of this.

I rate this high. Not because anything bad has been shown to reach customers (nothing has), but because a possible integrity problem in the development pipeline of a major ERP vendor touches a very large number of organisations, and the public record is still thin.

At a glance

  • Victim: SAP. Reported location: GitHub (dpa), in software development (Handelsblatt).
  • Confirmed by SAP (November 26, 2026): suspicious activity identified, measures taken, no evidence so far of unauthorized access to customer business data.
  • Reported, not confirmed: stolen employee GitHub tokens that let attackers copy and alter source code (Der Spiegel insider); detection the week before, “Project Granite” (Handelsblatt); GitHub access restricted, automation paused, signing keys replaced (outlets citing Handelsblatt).
  • Attribution: none. No actor has been publicly named.
  • Shipped products: no public evidence that altered code reached software delivered to customers.
  • CVE / patch: none. This is an incident, not a vulnerability.
  • Who should care: SAP customers (especially anyone pulling SAP code from npm, Maven or GitHub, or applying SAP Notes and transports), and every organisation that keeps its own code on GitHub with long-lived tokens.
Three columns: what SAP confirmed, what insiders and press report, and what is still unknown about the SAP GitHub incident.
Only the left column comes from SAP. Everything in the middle is insider reporting that SAP has not confirmed, as of December 1, 2026.

What we know

Der Spiegel broke the story on November 26, citing SAP insiders and an internal notice to employees. The German news agency dpa reviewed part of that internal communication and reported that the suspicious activity was found within GitHub, and that employees were asked to check whether they needed to change their login credentials.

SAP’s statement, shared with several outlets including SecurityWeek, says it identified suspicious activity and took measures to protect customers and secure its services. It does not say when the activity began, how the attackers got in, whether code was copied or changed, or whether any release was affected. It names no attacker.

Handelsblatt, citing people inside the company, adds three things: SAP noticed the incident the week before the press reports, the target was software development, and the internal response runs under the name “Project Granite” with multiple teams affected. SecurityWeek, CyberInsider and the Cloud Security Alliance all attribute the same reported measures to Handelsblatt: restricted GitHub access, paused automated development workflows and replaced signing keys.

Two other things got mixed into the coverage and should be kept apart. In late October 2026 the Gentlemen ransomware group listed SAP on its leak site, pointing at Latin American operations; SecurityWeek says the two incidents do not appear to be connected. And on April 29, 2026, malicious versions of four SAP-related npm packages (mbt 1.2.48 and three @cap-js packages) were published in the “Mini Shai-Hulud” campaign, built to steal GitHub and npm tokens among other secrets. That April story is about token theft too, which makes the link tempting, but no public source connects it to Project Granite.

Timeline from the reported detection in the week of November 16, 2026, through the internal memo, the November 26 Spiegel report and SAP statement, to coverage on November 27 and the CSA note on November 29.
Detection date is approximate: Handelsblatt says only that SAP noticed the incident the week before its report.

How the attack reportedly unfolded

All of this comes from insider accounts, so read it as the reported shape, not a forensic timeline. Attackers obtained authentication tokens belonging to SAP employees. Nobody has said what kind: a personal access token (a long string a developer creates so scripts and tools can act as them), an OAuth token issued to some app, or a browser session. Nobody has said how they were stolen either.

Whatever the type, a GitHub token is a bearer credential. Whoever holds it gets the owner’s access, with no second factor and no password prompt. If the employee could read a repository, so could the attacker. If the employee could push to it, so could the attacker. That is why the two verbs in the Spiegel report matter so much. “Copy” means an attacker now has source code to study for bugs at leisure, which is a confidentiality problem with a long tail. “Alter” is an integrity problem, and its blast radius depends entirely on one question: did any changed code pass review, get built, get signed and get shipped?

The reported response measures fit that worry. Pausing automated development processes stops a build pipeline from turning a poisoned commit into a release. Replacing signing keys means future artefacts carry a new signature, whether or not the old keys were actually exposed. As the CSA note points out, key rotation is common precaution and does not by itself prove the keys were compromised.

Der Spiegel’s sources also suggested the attackers may have had help from AI. There is no technical detail behind that yet. A same-day BSI warning about agentic AI in attacks does not mention SAP, so I wouldn’t connect the two.

Who is affected and how badly

I’d expect customer business data to live in production systems and cloud tenants, not in a source-code platform, so SAP’s “no evidence” sentence is plausible and also not very informative. The real exposure sits in three places.

  • Code you consume from SAP: SAP Notes and transports, npm and Maven packages under SAP namespaces, SDKs and samples cloned from SAP’s GitHub organisations. If any altered code was released (nothing says it was), this is where it would land.
  • Signature verification: if signing keys were replaced, anything that pins SAP key fingerprints or certificates will need the new ones, and anything signed with the old keys around the incident window deserves a second look once SAP says which window that is.
  • Future vulnerabilities: if proprietary source was copied, expect bug discovery against SAP products to get easier for whoever has it. That is a reason to keep SAP patch latency short.

My honest risk rating for a typical SAP customer as of December 1, 2026: low immediate risk, high uncertainty. The uncertainty is the problem, and only SAP can remove it.

What to do now

For SAP customers:

  1. Ask your SAP account team, in writing, four questions: which repositories were accessed, whether any of them feed shipped products, whether any released build contains unauthorised changes, and the new signing key fingerprints with guidance on how to verify them.
  2. Inventory SAP-originated code entering your environment. The CSA suggests a look-back to April 2026, which also catches anything left over from the npm incident.
  3. Pin SAP open-source dependencies to reviewed versions with lockfile integrity hashes instead of floating ranges, and turn off install-time scripts in CI where you can.
  4. Keep applying security-critical SAP Notes after normal verification. Holding every patch because of an unconfirmed report trades a known risk for an unknown one.
  5. Rotate any credentials you share with SAP-operated developer tooling or GitHub integrations, and confirm the April npm cleanup is finished (SAP Note 3747787).

For anyone running a GitHub organisation, this is a good week to check your own house. Inventory personal access tokens and move people to fine-grained, expiring tokens with SSO enforced. Require signed commits and branch protection on release branches, with the rules applied to administrators too. And stream the audit log to your SIEM, because Git events (clones, fetches, pushes) never show up in the web interface and, on Enterprise Cloud, the REST API keeps them for only seven days.

Detection and monitoring

Nobody has published indicators for this incident: no IPs, no token hashes, no branch names. So I can’t give you a rule that says “you were hit by the same people.” What I can give you is a set of rules for the behaviour the insiders describe, aimed at your own GitHub organisation. All of them read the GitHub audit log, which records a hashed_token (a SHA-256 of the token) and a programmatic_access_type on many events. That is what lets you trace one stolen token across everything it touched.

RuleCategoryLog sourceATT&CKLevel
One token clones 25+ repositories in an hourGeneric TTP (correlation)GitHub auditT1213.003, T1550.001Medium
Branch protection removed or signing / force-push rules changedGeneric TTPGitHub auditT1562.001Medium
Protected-branch override or rejected push by a tokenGeneric TTPGitHub auditT1565.001, T1550.001Medium
Git activity with a classic personal access tokenHuntingGitHub auditT1550.001Low

The one I’d switch on first is the bulk-clone correlation, because “copy source code” is the part of the story with the clearest log trail. A base rule picks out git.clone and repo.download_zip events that were authenticated with a token. The correlation then counts distinct repositories (GitHub’s common repo field; check your pipeline keeps that name) per token and fires at 25 within one hour. The threshold is my guess, not a published indicator, so tune it to your own CI and backup tooling before it pages anyone.

title: GitHub Git Clone or Source Archive Download Using an Access Token
id: 73613233-1c56-4b42-81ea-1750b63b4979
name: github_audit_git_clone_or_archive_download_by_token
status: experimental
description: |
    Base rule for the correlation below. Matches GitHub audit log git.clone and repo.download_zip events
    that carry a hashed token, meaning they were authenticated with a token or key rather than a browser session.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/identifying-audit-log-events-performed-by-an-access-token
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
logsource:
    product: github
    service: audit
    definition: 'Requirement: GitHub enterprise or organisation audit log streamed to the SIEM with Git events included. Git events are not shown in the web UI and the Enterprise Cloud REST API keeps them for 7 days. Token metadata on Git events is in public preview. The correlation counts the repo field (a common GitHub audit field); check your pipeline does not rename it.'
detection:
    selection:
        action:
            - 'git.clone'
            - 'repo.download_zip'
    filter_main_no_token:
        hashed_token: null
    condition: selection and not filter_main_no_token
falsepositives:
    - CI runners, mirroring jobs, backup tools and code-scanning services that clone many repositories with one token
level: low
---
title: Single GitHub Access Token Clones Many Distinct Repositories Within One Hour
id: 1550313d-5018-4c24-8e89-72ca663dd413
status: experimental
description: |
    Detects one GitHub access token (grouped by hashed_token) cloning or downloading archives of 25 or more
    distinct repositories within one hour. In the SAP incident, an insider reported that stolen employee GitHub
    tokens let attackers copy source code; bulk cloning with a developer's token is how that would look in the audit log.
    Threshold and logic are inferred, not taken from a published indicator.
references:
    - https://www.securityweek.com/sap-confirms-cyberattack-source-code-reportedly-compromised/
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-sap-source-code-token-compromise-20261129/
    - https://netsec101.com/?p=632
author: netsec101.com
date: 2026-12-01
tags:
    - attack.collection
    - attack.t1213.003
    - attack.defense-evasion
    - attack.t1550.001
correlation:
    type: value_count
    rules:
        - github_audit_git_clone_or_archive_download_by_token
    group-by:
        - hashed_token
    timespan: 1h
    condition:
        gte: 25
        field: repo
falsepositives:
    - Automation tokens used by CI, backup, mirroring or code-scanning tools; allowlist their hashed_token values after review
    - Developers bootstrapping a new machine with a script that clones every team repository
level: medium

For monitoring, the hard part is retention, not logic. Git events never appear in the web interface, and on Enterprise Cloud the REST API holds them for seven days, so if you are not streaming the audit log today, you can’t look back at last month. Turn streaming on, then keep watching for protection changes and token-driven pushes for at least as long as your longest-lived token stays valid.

I wrote up all four rules, with tuning notes, lab tests and ATT&CK coverage, in a separate detection post. The YAML lives in my Detection Rules repo.

My take

SAP’s statement is written for a data breach, and this is not shaping up as one. For a company whose product is code, the sentence customers need is different: “We have verified that no unauthorised change reached any released artefact, and here is how you can check.” Until SAP says something like that, with dates, the customer-data line is reassurance about a question nobody serious was asking.

I’m not saying SAP is hiding anything. A week or two into a source-code investigation, the honest answer to “was anything altered?” is often “we’re still diffing.” Pausing pipelines and rotating keys is what I’d want them to do. But the industry has learned, the hard way, that build-pipeline compromises are judged by the release record, not by the press statement, and customers will rightly expect a code-integrity disclosure, not only a data-breach one.

The bigger pattern is boring and therefore important. Tokens are the perimeter now. This year we have seen poisoned npm packages built to steal developer tokens, a forgotten vendor key behind Barracuda’s cloud breach, and now, reportedly, employee GitHub tokens at SAP. A personal access token without an expiry date is a password with no MFA that never gets typed, so nobody notices it is gone. If you do one thing this week, list every long-lived token that can push to your release branches and kill the ones nobody can explain.

Sources

Detecting Cacti 4HTTP2SHELL: 4 Sigma rules for web logs, the poller and the web root

Detecting Cacti 4HTTP2SHELL: 4 Sigma rules for web logs, the poller and the web root

An unpatched bug with a public proof of concept and no CVE is the worst kind of week for a detection team: no vendor signature, no scanner plugin, nothing in the threat feeds. That is where Cacti users are with 4HTTP2SHELL, the four-request chain that turns an enabled guest account on Cacti 1.2.31 into command execution. Cacti merged matching fixes into its source branches on November 28, but no release carries them yet. I covered the bug, who is exposed and what to switch off in my analysis of the zero-day.

This post is the detection side. I found no published IOCs or request samples in the sources I read, so these four rules are built from the behaviour that watchTowr and RavenAI describe, plus my own reasoning where I say so. They are all experimental. Treat them as starting points to tune, not as alerts to page someone on at 3 a.m.

At a glance

  • Rules: 4 (one Sigma v2 correlation with three base rules, two host rules, one hunting rule).
  • Domains: Web/App and Linux.
  • Log sources: web server access logs with query strings, the PHP or web server error log and the Cacti log, Linux process creation and file creation (Sysmon for Linux, auditd or EDR).
  • ATT&CK: T1190, T1059.004, T1105, T1505.003.
  • Status: experimental. No CVE tag, because there is no CVE.
  • GitHub: Detection Rules/Linux and Detection Rules/Web-App.

The case in brief

The chain needs Cacti’s guest account to be enabled, which is not the default. According to RavenAI’s breakdown, the guest saves a text value into preview_graphs_per_page through auth_profile.php, a display setting that should be a number. A graph_view.php preview request then concatenates that stored value into a SQL LIMIT clause, and a stacked statement rewrites the arg1 command of a poller_item row. Finally a guest-reachable realtime graph request runs the poller path, which executes the command as the Cacti web and poller account. watchTowr adds that a warning about a non-numeric value may be logged along the way (RavenAI calls it a PHP warning), and lists new files created by the poller process as a pivot. The full story is in the analysis.

So the traces land in four places: the web access log (the request order), the PHP error log or Cacti log (the warning), the database (the rewritten poller command) and the host (whatever that command starts, and any files it writes). Sigma covers three of them. The database is the gap.

Detection map

Block diagram: web access logs, the PHP or Cacti log and Linux host process and file events feed four Sigma rules (request-order correlation, non-numeric warning hunt, suspicious poller child, PHP written in the Cacti tree) mapped to ATT&CK T1190, T1059.004 with T1105, and T1505.003, with the poller_item database rewrite marked as a gap.
Three log sources, four rules. The SQL rewrite of the poller command stays a database check.

Read it left to right. Web logs feed the correlation rule, which watches for the request order. The PHP error log or Cacti log feeds a keyword hunt. Host telemetry feeds the two rules I trust most: a suspicious child process under PHP, the web server or the spine poller, and a PHP file written into the Cacti tree by one of those processes. On the right, the red dashed box is the part none of the rules can see: the SQL write into poller_item. You close that with a scheduled database query, not a SIEM rule.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Suspicious command spawned by Cacti web server or pollerLinuxlinux / process_creationExecution / T1059.004, C2 / T1105HighExperimental
Profile update, then preview, then realtime graph (correlation)Web/AppwebserverInitial Access / T1190MediumExperimental
PHP file written in Cacti web root by a web processLinuxlinux / file_eventPersistence / T1505.003MediumExperimental
Non-numeric value warning in the PHP or Cacti log (hunting)Web/Appcacti / application (PHP or Cacti log)Initial Access / T1190LowExperimental

The rules

Suspicious command spawned by Cacti web server or poller

Context: the last step of the chain is the poller running a command an anonymous guest chose. Whatever the attacker does next (download a tool, open a reverse shell, check who they are) starts as a process under PHP, Apache or spine. This is the rule I would turn on first, because it does not depend on how the command got into the poller.

Condition: alert when PHP, Apache/httpd or spine starts a shell whose command line contains curl, wget, a /dev/tcp redirect, base64, whoami, netcat, socat, chmod +x or an inline Python one-liner, or starts one of those tools directly. The lineage is my inference: I assume Cacti hands the stored command to a shell, so I match both the shell and the direct case.

ATT&CK: Execution (TA0002) – T1059.004 Unix Shell; Command and Control (TA0011) – T1105 Ingress Tool Transfer.

title: Suspicious Command Spawned by Cacti Web Server or Poller - Possible 4HTTP2SHELL Exploitation
id: 60c2cf77-4095-4bbf-9a3d-fd67b80c2a27
status: experimental
description: |
    Detects a shell running download, reverse-shell, discovery or encoding commands, or such a tool started directly,
    under the PHP, web server or spine poller processes on a Linux Cacti host. The 4HTTP2SHELL chain rewrites a
    poller command that a realtime graph request then executes as the Cacti service account (inferred process lineage).
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.execution
    - attack.t1059.004
    - attack.command-and-control
    - attack.t1105
    - detection.emerging-threats
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent:
        - ParentImage|contains: '/php'
        - ParentImage|endswith:
              - '/apache2'
              - '/httpd'
              - '/spine'
    selection_shell:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
    selection_shell_payload:
        CommandLine|contains:
            - 'curl '
            - 'wget '
            - '/dev/tcp/'
            - 'base64'
            - 'whoami'
            - 'nc -'
            - 'ncat '
            - 'socat '
            - 'chmod +x'
            - 'python -c'
            - 'python3 -c'
    selection_direct_tool:
        Image|endswith:
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/whoami'
            - '/base64'
    condition: selection_parent and ((selection_shell and selection_shell_payload) or selection_direct_tool)
falsepositives:
    - Custom Cacti data input scripts that call curl or wget to poll HTTP APIs (scope by the script path and add a filter)
    - Other PHP applications on the same host; scope the rule to Cacti servers
level: high

View on GitHub

False positives and tuning: custom data input scripts that poll HTTP APIs with curl are the obvious one. Add a filter on their script path rather than dropping curl from the list. Scope the rule to hosts tagged as Cacti servers, because on a general PHP web server it will be noisier.

How to test: on a lab Cacti host, run a harmless command through PHP as the web user, for example sudo -u www-data php -r 'system("whoami");'. That produces PHP starting a shell that runs whoami, the same lineage the rule looks for.

Profile update, then preview, then realtime graph from one client

Context: RavenAI describes the chain’s footprint as a guest profile update followed by graph preview and realtime graph initialisation requests. Each request on its own is normal Cacti use. The order, from one client in a short window, is what stands out.

Condition: three informational base rules match auth_profile.php with action=update_data, graph_view.php with action=preview, and graph_realtime.php. A Sigma v2 temporal_ordered correlation fires when the same client IP hits all three in that order within 10 minutes. The action=update_data string comes from InfoSec Monkey’s hunting grep; action=preview is the standard Cacti preview URL and my assumption. Access logs do not show request bodies, so the rule cannot see the injected value itself.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Cacti Profile Update Request
id: 79a15d1d-b432-48fb-8b57-83e92d9f520c
name: cacti_profile_update_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches a request to the Cacti user profile update action,
    the step where the chain stores a value in a per-user display setting.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://infosecmonkey.com/cacti-4http2shell-zero-day/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/auth_profile.php'
        cs-uri-query|contains: 'action=update_data'
    condition: selection
falsepositives:
    - Users changing their own profile settings (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Graph Preview Request
id: d3eb6803-9216-45a4-98d5-c877fc4f3a35
name: cacti_graph_preview_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches the graph_view.php preview action, which reads the
    stored page-size preference back into a SQL query.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/graph_view.php'
        cs-uri-query|contains: 'action=preview'
    condition: selection
falsepositives:
    - Normal graph browsing in preview mode (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Realtime Graph Request
id: 7d465808-b5cb-44ec-be1f-89fbedd54bb0
name: cacti_realtime_graph_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches a request to graph_realtime.php, the page that
    triggers the realtime poller path where the rewritten command runs.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/graph_realtime.php'
    condition: selection
falsepositives:
    - Users opening realtime graphs (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Profile Update Followed by Graph Preview and Realtime Graph - Possible 4HTTP2SHELL Chain
id: efe4f9f7-cadc-41a8-b8f0-d7fd9ad6127f
status: experimental
description: |
    Detects one client sending a Cacti profile update, then a graph_view.php preview, then a graph_realtime.php
    request within ten minutes, the request order RavenAI describes for the 4HTTP2SHELL guest-to-shell chain.
    Inferred from published analyses; I found no published request samples in the sources I read.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
correlation:
    type: temporal_ordered
    rules:
        - cacti_profile_update_request
        - cacti_graph_preview_request
        - cacti_realtime_graph_request
    group-by:
        - c-ip
    timespan: 10m
falsepositives:
    - A logged-in user who changes the preview page size and then opens a realtime graph; check whether the client is a known admin or NOC address
level: medium

View on GitHub

False positives and tuning: a logged-in admin who changes the preview page size and then opens a realtime graph will trigger it. Exclude your NOC and admin subnets, or better, enrich with the session user if your web server logs it and alert only when it is the guest. If guest is off on all your servers, this rule should be silent; any hit is worth a look.

How to test: on a lab install, log in, change the graphs-per-page preference, open preview mode, then open a realtime graph, all within a few minutes.

PHP file written in the Cacti web root by a web process

Context: watchTowr lists new files created by the poller process as a detection pivot, and RavenAI mentions an unexpected web shell or marker file. Once an attacker can run commands as the web user, dropping a PHP file in the Cacti tree is the cheapest way to keep access after you turn guest off.

Condition: alert when a file ending in .php is created under a path containing /cacti/, and the writing process is PHP, Apache/httpd, spine or a shell. Legitimate Cacti code arrives through the package manager or an admin’s deployment, not through those processes.

ATT&CK: Persistence (TA0003) – T1505.003 Web Shell.

title: PHP File Written in Cacti Web Root by Web Server or Shell Process
id: 23d1ea44-9240-49d3-9768-00be868c537d
status: experimental
description: |
    Detects a .php file created under a Cacti installation path by PHP, the web server, the spine poller or a shell.
    watchTowr lists new files created by the poller process, and RavenAI an unexpected web shell or marker file, as pivots
    after 4HTTP2SHELL exploitation. Legitimate Cacti code is written by the package manager or an admin, not by these processes.
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - detection.emerging-threats
logsource:
    product: linux
    category: file_event
detection:
    selection_path:
        TargetFilename|contains: '/cacti/'
        TargetFilename|endswith: '.php'
    selection_writer:
        - Image|contains: '/php'
        - Image|endswith:
              - '/apache2'
              - '/httpd'
              - '/spine'
              - '/sh'
              - '/bash'
              - '/dash'
    condition: all of selection_*
falsepositives:
    - Cacti plugin installs or upgrades done through the web UI (match the time against change records)
    - Installs where Cacti lives outside a path containing /cacti/ will not match; adjust the path
level: medium

View on GitHub

False positives and tuning: plugin installs through the web UI write PHP as the web user, so match hits against change records. If Cacti lives in a path without /cacti/ in it, change the path. A shell writing the file is in the list on purpose: an attacker’s echo into a file comes from sh, not PHP.

How to test: as the web user, have PHP write a harmless file into the Cacti directory, check for the alert, then delete the file.

Non-numeric value warning in the PHP or Cacti log

Context: watchTowr and BleepingComputer both say a warning about a non-numeric value in a graph display setting may be logged when the chain runs, while the request itself succeeds. RavenAI describes it as a PHP warning. Depending on your setup it lands in the PHP or web server error log, or in Cacti’s own log, so forward both.

Condition: match the keyword non-numeric in the forwarded PHP error log or Cacti log. I could not find the exact message text in the sources, so I kept it to the keyword. That makes it a hunting rule, not an alert.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Non-Numeric Value Warning on a Cacti Host - 4HTTP2SHELL Hunting
id: af338bec-2440-4abd-8619-e984ec9031de
status: experimental
description: |
    Hunts for warnings about non-numeric values on a Cacti host. watchTowr notes a warning about a non-numeric value in a
    graph display setting may be logged when the 4HTTP2SHELL chain runs, while the request still succeeds; RavenAI calls it
    a PHP warning. Where it lands (PHP or web server error log, or the Cacti log) depends on the setup. The exact text is
    not published, so this matches the keyword only and needs review.
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://www.bleepingcomputer.com/news/security/unpatched-cacti-zero-day-with-public-poc-gives-remote-code-execution/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.threat-hunting
logsource:
    product: cacti
    service: application
    definition: 'Requirement: forward the PHP or web server error log and the Cacti log from the Cacti host to the SIEM (locations vary by install).'
detection:
    keywords:
        - 'non-numeric'
    condition: keywords
falsepositives:
    - PHP warnings from unrelated code paths or plugins with sloppy numeric handling
level: low

View on GitHub

False positives and tuning: any plugin with sloppy number handling can produce the same PHP warning. Once you see a real hit, copy the exact message into the rule and raise its level.

How to test: append a line containing “non-numeric” to the forwarded log in a lab and confirm it reaches the SIEM and matches.

Coverage and gaps

Step in caseTacticTechniqueRuleCovered?
Guest profile write, preview, realtime requestsInitial Access (TA0001)T1190Correlation rule, PHP or Cacti log huntYes (inferred URIs)
Stacked SQL rewrites poller_item.arg1Initial Access (TA0001)T1190NoneGap: database only
Poller runs the attacker commandExecution (TA0002)T1059.004Suspicious poller childYes, with process telemetry
Tool downloadCommand and Control (TA0011)T1105Suspicious poller childPartial
Web shell or file dropPersistence (TA0003)T1505.003PHP written in Cacti treeYes, with file telemetry
Follow-on actions (reading credentials, pivoting to devices)Variousn/aNoneGap: not described by sources

The biggest blind spot is the SQL write. Most teams do not audit the Cacti database, and a rewritten poller_item row looks like any other config change. I would close it with a scheduled read-only query: alert when a preview_graphs_per_page value in settings_user is not a plain number, and diff poller_item.arg1 against yesterday’s copy. The analysis post has the queries. The second gap is everything after the first command. Cacti servers hold SNMP credentials (the poller_item table itself has SNMP community and password columns) and can usually reach most network devices, so if the host rule fires, assume the attacker read the config and check your devices’ logs for logins from the Cacti server.

Deploying the rules

Grab the YAML from GitHub and convert it with sigma-cli for your SIEM. The Linux rules need a pipeline that maps Sysmon for Linux or your EDR’s field names; the web rules need your access log fields mapped to cs-uri-stem, cs-uri-query and c-ip. Correlation rules need a backend that supports Sigma v2 correlations (check yours); otherwise build the sequence as a saved search by hand. For example:

sigma list pipelines
sigma convert -t splunk --without-pipeline proc_creation_lnx_cacti_web_poller_suspicious_child.yml
sigma convert -t lucene --without-pipeline file_event_lnx_cacti_webroot_php_written_by_web_process.yml
sigma convert -t splunk --without-pipeline web_cacti_guest_profile_preview_realtime_sequence_correlation.yml

The --without-pipeline output keeps the Sigma field names, so rename them to your own schema, or swap in a pipeline from sigma list pipelines that matches your log source; pipeline names change between sigma-cli plugin versions. Run everything in alert-only mode for a week before it pages anyone, and tune the process rule’s filters with what your own data input scripts actually run.

My take

Honestly, the best detection for this bug is not a rule. It is setting Guest User to No User and taking the web UI off the internet, which closes the chain completely. Everything in this post is for the case where you cannot do that today, or where guest was on before you read about this and you need to know if someone got in.

Of the four, the process rule is the one worth keeping forever. Cacti has had four guest-reachable or unauthenticated paths published this year, and most of the impact flows through a poller that runs commands from a database table. Watching what that poller starts catches this chain and the next one. What I would really like is for Cacti to log changes to poller_item and to guest profile settings by default, with the user and source IP. That single log line would turn the biggest gap in this post into the easiest alert.

Sources

Cacti 4HTTP2SHELL: an unpatched guest-account RCE in the current release

Cacti 4HTTP2SHELL: an unpatched guest-account RCE in the current release

Cacti 1.2.31 shipped on June 15, 2026, and four days later the project published advisories for three critical bugs it fixed, each scored CVSS 9.8 and none needing a password (one of them only on installs with guest viewing turned on). On November 26, 2026, a researcher published a chain that turns that same release into a command shell for an anonymous visitor, in four HTTP requests.

The chain is called 4HTTP2SHELL (first published as 4HTTP2ROOT). It has no CVE and no fixed release. On November 28 the Cacti project merged security fixes that match the chain into its source branches, but it has not shipped a release or an advisory. A working proof of concept is public on GitHub. There is one big condition: the Cacti guest account has to be enabled. If yours is, you have a problem tonight. If it is not, you should still read on: this is the fourth guest-reachable or unauthenticated path into Cacti published this year, and the guest role was already the precondition for one of the June bugs.

Severity: high. Unauthenticated code execution on a server that usually sits in the middle of the network and talks to most of your devices, held back from critical only because guest access is off by default and the code runs as the Cacti service account.

At a glance

  • Name: 4HTTP2SHELL, also 4HTTP2ROOT. No CVE assigned, no CVSS score (watchTowr, November 26, 2026).
  • Affected: Cacti Core 1.2.31, the current release, as tested by the researcher. Whether 1.2.30 and older are affected is not established.
  • Precondition: the guest account is enabled. No credentials or session needed.
  • Impact: OS command execution as the account that runs the Cacti web server and poller. The researcher’s lab returned root; watchTowr notes that in many installs this is a low-privileged web user.
  • Exploitation: public PoC since November 26. No in-the-wild exploitation reported as of November 29. Not in CISA KEV.
  • Patch: no fixed release yet. Matching fixes were merged into the 1.2.31 and 1.2.x source branches on November 28. Mitigation is to disable guest access and keep the web UI off untrusted networks.
  • Who should care: network and NOC teams running Cacti, especially anyone who turned on guest viewing for wall dashboards or customer graph pages.

What we know

The researcher, who goes by ek0ms savi0r and publishes with a group called Church of Malware, posted the write-up and PoC to a GitHub repository on November 26, 2026, US Thanksgiving. BleepingComputer reports the researcher said the flaw was not reported to Cacti before release. I have not seen a statement from the Cacti project, and its GitHub advisory list shows nothing from November when I checked on November 28.

watchTowr published an FAQ the same evening. It lists the CVE as not assigned, the vendor patch as pending and no fixed version. As of November 27 it reported no exploitation in the wild. RavenAI published a technical breakdown of the researcher’s chain the same day, and BleepingComputer, BreachNews and others picked it up on November 27.

On November 28 the Cacti project merged two security pull requests that line up with the chain step by step. Pull request 9013, for the 1.2.31 maintenance branch, stops shared guest sessions from saving profile or graph preferences and normalizes pagination values before they reach graph queries; its description says the patch also applies to the original 1.2.31 release tag. Pull request 9014, for the 1.2.x branch, rejects guest writes with HTTP 403, clamps the LIMIT values in graph_view.php and checks graph permission in graph_realtime.php before it calls shell_exec(). Neither names 4HTTP2SHELL, so the match is my reading, not a vendor statement. As of November 29 there is still no new release, no advisory and no CVE, and nobody has reported exploitation in the wild.

What is confirmed: the chain works on a lab instance of 1.2.31 with guest enabled, as published by the researcher and described consistently by watchTowr and RavenAI. What is not confirmed: the range of affected versions, how many exposed servers have guest turned on, and when a fix will land. Do not confuse it with CVE-2026-39893, one of the June bugs that 1.2.31 already fixed.

Timeline: June 15, 2026 Cacti 1.2.31 released; June 19 advisories published for three critical bugs fixed in 1.2.31, none needing a password and one only with guest viewing on; November 26 4HTTP2SHELL chain and PoC published against 1.2.31, researcher says Cacti was not told first; November 28 Cacti merges matching security fixes into its source branches, with no release, CVE or advisory yet.
1.2.31 closed three critical bugs that needed no password, one of them only with guest viewing on. The new chain breaks that same release.

How the chain works

Nothing here is exotic. It is a second-order SQL injection: the attacker stores a malicious value in one place and a different page later trusts it. Here is the flow at the level the published analyses describe it, without the request details.

First, the guest writes a profile setting. Cacti lets users, including the guest user, save display preferences through auth_profile.php. One of them, preview_graphs_per_page, should be a number. According to RavenAI, the update accepts any string.

Second, the graph preview reads it back. graph_view.php in preview mode loads the stored preference without the integer check it applies to request input, and concatenates it into the LIMIT clause of a SQL query. On the tested database path the query interface accepted an extra statement, so the stored value runs as its own SQL command. watchTowr notes that a warning about a non-numeric value may be logged at this point, and RavenAI describes it as a PHP warning. Depending on your setup it lands in the web server or PHP error log, or in Cacti’s own log. The request still succeeds either way.

Third, the injected statement rewrites a poller command. Cacti keeps the commands its poller runs in the database. RavenAI names the arg1 field of a poller_item row as the target. Change that value and you have changed what Cacti will execute next.

Fourth, a guest-reachable realtime graph page triggers the poller path (graph_realtime.php through to lib/poller.php), which runs the rewritten command on the host. That is four requests from an anonymous browser to a shell.

Four-step attack chain: guest writes a text value into a numeric profile setting, graph preview concatenates it into a SQL LIMIT clause, the stacked query rewrites a poller command, a realtime graph request runs it as the Cacti service user.
The 4HTTP2SHELL chain as described by watchTowr and RavenAI. Every step is reachable by an anonymous guest.

The design choice that makes this hurt is not new: Cacti stores the command lines its poller executes in a database table, so any SQL write primitive is one step from command execution. A numeric field nobody bound as a parameter, plus a database path that accepts stacked statements, is simply the latest way to reach that table.

Who is affected and how badly

The guest precondition matters a lot. Cacti’s documentation says the guest user has not been enabled by default since 0.8.7. To turn on anonymous access an admin has to enable the guest user and select it as the Guest User under Authentication settings. So a stock install is not exposed. The trouble is that people turn guest on for good reasons: a NOC wall screen, a public status page, customers who want to see their own bandwidth graphs.

Then think about where Cacti lives. It polls routers, switches and firewalls over SNMP, so the box holds community strings or SNMPv3 credentials and a full inventory of the network, and it usually has a route to most management interfaces. Code running as the Cacti user can read that configuration and the database, plant files in the web root, and use the server as a pivot. Whether that user is root depends on how you installed it. The researcher’s lab returned root, which tells you something about how lab installs get built, not about the bug.

My rating: critical for any internet-facing Cacti with guest enabled, because the PoC is public and there is no fixed release yet. High for internal installs with guest enabled, because anyone on the network, including malware already on a workstation, can use it. Low for installs with guest off, assuming nothing else in the chain turns out to be reachable after login. No source has published exposure counts, so I will not guess one.

What to do now

  1. Turn off guest access. In the console go to Configuration, Settings, Authentication and set Guest User to No User, then disable the guest account under Users. This removes the precondition entirely. If a wall screen needs graphs, give it a named read-only account.
  2. Take the web UI off the internet. Cacti has no business being reachable from outside a management network. Restrict it at the firewall or in the web server config to the admin and NOC subnets.
  3. Check whether you were exposed. If guest was on and the UI was reachable at any point since November 26, review the poller data and the web root (queries below) before you assume you are clean. Turning guest off now does not undo a rewritten poller command or a dropped web shell.
  4. Stay on 1.2.31 for now. It fixes the three critical June bugs. Do not roll back hoping the new chain does not reach older versions; nobody has shown that, and the older releases are definitely vulnerable to the June issues. The fixes merged on November 28 are not in any release yet. When Cacti ships a release or advisory that includes them, patch, and keep guest off anyway.
  5. Check what the Cacti service account is. If the web server or poller runs as root, fix that on your next maintenance window; it is the difference between a compromised app and a compromised host.

For the exposure check, three read-only queries against the Cacti database (adjust the database name). The first shows whether a guest user is mapped, the second finds stored page-size preferences that are not plain numbers, the third lists poller commands containing shell metacharacters. Legitimate script data inputs can contain pipes or semicolons, so read the results rather than treating every row as a hit. The table and column names match the Cacti 1.2.x schema file; the regular expression escaping is mine, so check it against your schema and your MySQL or MariaDB version before relying on it.

SELECT name, value FROM settings WHERE name = 'guest_user';
SELECT user_id, value FROM settings_user
  WHERE name = 'preview_graphs_per_page' AND value NOT REGEXP '^[0-9]+$';
SELECT local_data_id, arg1 FROM poller_item
  WHERE arg1 REGEXP '[;|`]|\\$\\(';

Detection and monitoring

I found no published IOCs or request samples in the sources I read, so everything here is behaviour-based and marked experimental. The good news is that the chain has to touch three places you can log: the web server sees the request sequence, a PHP warning about a non-numeric value may show up in the web server or PHP error log or in Cacti’s log, and the host sees whatever the rewritten poller command starts. The step in the middle, the SQL write into poller_item, is invisible to most SIEMs, which is why the database queries above matter. Process and file telemetry on Linux are off unless you run Sysmon for Linux, auditd or an EDR on the Cacti box.

RuleCategoryLog sourceATT&CKLevel
Suspicious command spawned by Cacti web server or pollerLinuxprocess_creationT1059.004, T1105High
Profile update, then preview, then realtime graph from one clientWeb/App (correlation)webserverT1190Medium
PHP file written in the Cacti web root by a web processLinuxfile_eventT1505.003Medium
Non-numeric value warning in the PHP or Cacti logWeb/App (hunting)PHP error log or Cacti logT1190Low

The one I would turn on first is the process rule. A monitoring server’s PHP or poller process has no reason to start a shell that runs curl, wget, netcat, base64 or a /dev/tcp redirect, or to launch those tools directly. It does not care how the command got into the poller, so it also catches the next variant. The process lineage is my inference from how Cacti runs poller commands, not something the sources spell out. If your own data input scripts call curl to poll an HTTP API, add a filter for their path.

title: Suspicious Command Spawned by Cacti Web Server or Poller - Possible 4HTTP2SHELL Exploitation
id: 60c2cf77-4095-4bbf-9a3d-fd67b80c2a27
status: experimental
description: |
    Detects a shell running download, reverse-shell, discovery or encoding commands, or such a tool started directly,
    under the PHP, web server or spine poller processes on a Linux Cacti host. The 4HTTP2SHELL chain rewrites a
    poller command that a realtime graph request then executes as the Cacti service account (inferred process lineage).
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.execution
    - attack.t1059.004
    - attack.command-and-control
    - attack.t1105
    - detection.emerging-threats
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent:
        - ParentImage|contains: '/php'
        - ParentImage|endswith:
              - '/apache2'
              - '/httpd'
              - '/spine'
    selection_shell:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
    selection_shell_payload:
        CommandLine|contains:
            - 'curl '
            - 'wget '
            - '/dev/tcp/'
            - 'base64'
            - 'whoami'
            - 'nc -'
            - 'ncat '
            - 'socat '
            - 'chmod +x'
            - 'python -c'
            - 'python3 -c'
    selection_direct_tool:
        Image|endswith:
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/whoami'
            - '/base64'
    condition: selection_parent and ((selection_shell and selection_shell_payload) or selection_direct_tool)
falsepositives:
    - Custom Cacti data input scripts that call curl or wget to poll HTTP APIs (scope by the script path and add a filter)
    - Other PHP applications on the same host; scope the rule to Cacti servers
level: high

Until Cacti ships a release with the fix, keep these running and re-run the database checks weekly. If guest was ever enabled on a reachable server, retro-hunt your web and host logs back to November 26, 2026, when the PoC went public. Once a patched release lands, keep the process rule permanently: it is cheap, and Cacti has had four guest-reachable or unauthenticated paths published this year.

I wrote up all four rules, with tuning notes, lab tests and ATT&CK coverage, in a separate detection post. The YAML lives in my Detection Rules repo, in the Linux and Web-App folders.

My take

The headline name oversells it. “Root in four requests” needs a non-default setting, and root only if you installed Cacti badly. I would not put this in the same bucket as an exploited VPN bug. But I think the story is underrated in a different way. In June, Cacti fixed three critical bugs that needed no login, two of them SQL injections in graph_view.php and one of them reachable only with guest viewing on. Five months later the release that fixed them falls to another guest-reachable SQL injection in the same file, which ends in a database table full of commands the poller will happily run. Patching each hole as it appears is not working. Cacti needs to treat the guest role as hostile input everywhere and treat poller_item as security-critical configuration, with integrity checks, not as just another table.

On the disclosure, I am not a fan. Dropping a full chain with a PoC on a holiday, with no notice to the project, mostly hurts the network teams who run it. That said, the researcher’s frustration with vendor triage is clearly real, and Cacti’s advisory history this year shows its maintainers already had plenty to fix. The practical answer does not depend on who is right: guest off, UI off the internet, and a look at your poller table tonight. Those three things close this chain completely, which is more than most zero-days give you.

Sources

Detecting Drupal installer takeover: 4 Sigma rules for web logs and host files

Detecting Drupal installer takeover: 4 Sigma rules for web logs and host files

Drupal’s installer flaws are a detection engineer’s dream and nightmare at once. The dream: the attack has to go through one URL, /core/install.php, that a finished production site has no business serving. The nightmare: neither Drupal nor the researchers published a single IP address, hash or user agent, and Drupal itself says a compromised site may no longer look vulnerable.

This post is the companion to my analysis of CVE-2026-136716 and the earlier Fail2Install bug. Here you get four Sigma rules built on behaviour, what each one catches, how to tune it, and how to test it safely in a lab.

At a glance

  • Rules: 4 rule files (one of them a Sigma v2 correlation with its own base rule).
  • Domains: Web/App (3) and Linux (1).
  • Log sources: web server access logs with method and full path; host file events from Sysmon for Linux, auditd or an EDR.
  • ATT&CK: T1190 Exploit Public-Facing Application (Initial Access) and T1505.003 Web Shell (Persistence).
  • Status: one rule test (vector confirmed by Drupal), three experimental (built from researcher write-ups and my own reasoning).
  • GitHub: Detection Rules/Web-App and Detection Rules/Linux.

The case in brief

Drupal fixed CVE-2026-132165 (SA-CORE-2026-017) on November 18, 2026, and reported exploitation on live sites from November 19 at 19:00 UTC. A week later, on November 25, it fixed CVE-2026-136716 (SA-CORE-2026-019) for sites in unusual or incomplete installation states that the first fix missed, and said that one is exploited in the wild too. In both cases the attacker uses the installer to reinstall Drupal on a live site and take it over. The full story is in the analysis.

For detection, the steps that matter and where they leave traces are these. The attacker requests the installer, and for Fail2Install, puts pressure on the database or the server so that the “already installed” check fails (Searchlight Cyber’s research). That shows up in access logs. The attacker then most likely submits installer forms (my inference), which are POST requests to the same path. On some setups the attacker can go further: Searchlight describes writing a SQLite database file with a .php name into the web root and running it through a crafted path. The CSA and Hive Security write-ups give that path shape as .php/core/ in the middle. That leaves a file on disk and one more odd line in the access log. The account takeover itself happens inside Drupal and does not reach the web server logs in a useful way.

Detection map

Block diagram: web access logs and Linux host file events feed four Sigma rules (installer POST request, installer request burst correlation, .php/core/ path trick, PHP file in public files) mapped to ATT&CK T1190 and T1505.003, with the user 1 takeover marked as a gap to check by hand.
Two log sources, four rules. The admin takeover itself stays a manual check.

Two log sources feed four rules. The web access log carries three of them: the installer POST, the burst correlation and the .php/core/ path. Host file events carry the fourth, a PHP file appearing under sites/*/files. Together they cover the initial access and the web shell step. The account takeover in the middle is the gap: it lives in Drupal’s own logs and state, so I treat it as a manual check, not a rule.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Drupal installer POST requestWeb/AppwebserverInitial Access / T1190Hightest
Burst of installer requests from one clientWeb/Appwebserver (correlation)Initial Access / T1190Mediumexperimental
PHP file requested with trailing /core/ pathWeb/AppwebserverPersistence / T1505.003Highexperimental
PHP file created in Drupal public filesLinuxlinux / file_eventPersistence / T1505.003Highexperimental

The rules

Drupal installer POST request

Context: Drupal names the installer as the vector for both exploited bugs. My inference is that a reinstall most likely needs someone to submit installer forms on a site that is already running, with or without a resource flood, so this is the rule with the best signal. It is test rather than experimental because Drupal itself names the installer as the vector.

Condition: alert on any POST request whose path contains /install.php. The contains match also catches /core/install.php/foo style paths, which Drupal’s own hardening guide warns about.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Drupal Installer POST Request - Potential CVE-2026-136716 / CVE-2026-132165 Site Takeover
id: d251aa0a-f5e0-4e6a-85f2-31c59d86e62c
status: test
description: |
    Detects HTTP POST requests to the Drupal installer (install.php). Drupal names the installer as the vector for both
    exploited flaws, SA-CORE-2026-017 and SA-CORE-2026-019. A reinstall most likely requires submitting installer
    forms (inference), which a site that is already installed should never receive.
references:
    - https://www.drupal.org/sa-core-2026-019
    - https://www.drupal.org/sa-core-2026-017
    - https://www.drupal.org/docs/administering-a-drupal-site/security-in-drupal/securing-the-installer-installphp
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-136716
    - cve.2026-132165
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection_path:
        cs-uri-stem|contains:
            - '/core/install.php'
            - '/install.php'
    selection_method:
        cs-method: 'POST'
    condition: all of selection_*
falsepositives:
    - Building a brand new Drupal site or adding a multisite site through the browser installer
    - Staging or development hosts that are reinstalled on purpose (scope the rule to production hosts)
level: high

View on GitHub

False positives and tuning: new site builds and multisite additions done in the browser will fire it. Scope it to production host names, or add a filter for the IP addresses your team installs from. If you have already blocked the installer, you’ll see hits with status 403 or 404. Keep them; they tell you who is probing, and you can lower the level for blocked responses with a filter on sc-status.

How to test: on a lab Drupal site, send any harmless POST to /core/install.php (an empty form body is enough) and check that the access log line matches.

Burst of Drupal installer requests from one client

Context: Searchlight’s Fail2Install technique depends on a database check failing at exactly the right moment. My inference is that real attempts will hit the installer many times in a short window, much more than a scanner checking once. This rule is a Sigma v2 event_count correlation: a low-level base rule matches any installer request, and the correlation fires when one client crosses a threshold.

Condition: alert when one client address sends 30 or more requests to the installer on one host within one minute. The threshold is my starting point, not a value from any source.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Drupal Installer Request From Any Client
id: 75e838b2-152b-43ec-b7a4-413b0331d848
name: web_drupal_installer_request_any
status: experimental
description: |
    Base rule for the burst correlation below: any request to the Drupal installer. Not meant to alert on its own.
references:
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-132165
    - detection.threat-hunting
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|contains:
            - '/core/install.php'
            - '/install.php'
    condition: selection
falsepositives:
    - Uptime checks or scanners that request install.php
level: low
---
title: Burst Of Drupal Installer Requests From One Client - Potential Fail2Install Attempt
id: 8d2db544-b525-4e65-9bb3-fad5250d6ca7
status: experimental
description: |
    Detects one client sending many requests to the Drupal installer within a minute. The Fail2Install technique
    (CVE-2026-132165) relies on making database checks fail at the right moment, so I expect attempts to repeat the
    installer request many times (inference). The threshold of 30 per minute is my own starting point, not a source value.
references:
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-132165
    - detection.emerging-threats
correlation:
    type: event_count
    rules:
        - web_drupal_installer_request_any
    group-by:
        - c-ip
        - cs-host
    timespan: 1m
    condition:
        gte: 30
falsepositives:
    - Load tests or security scans aimed at the site
    - Many users behind one NAT or proxy address (group by X-Forwarded-For if your logs keep it)
level: medium

View on GitHub

False positives and tuning: load tests and authorised scans will trip it, and so will many users behind one NAT or proxy address. If your logs keep X-Forwarded-For, group by that instead of c-ip. Remember that CVE-2026-136716 may not need a flood at all, so a quiet result here does not clear a site. The base rule on its own is a decent hunting query for the retro-hunt.

How to test: send 30 plain GET requests to /core/install.php on a lab site from one machine within a minute and check that the correlation fires once your backend supports Sigma correlations.

PHP file requested with trailing /core/ path

Context: Searchlight explains that the stock Drupal .htaccess rule meant to stop PHP files outside core from running was not anchored, so a crafted path slipped past it. The Cloud Security Alliance note and Hive Security give the shape to look for: a .php file followed by an extra /core/<name>.php segment. I am matching the path shape only, not a full request.

Condition: alert on any request whose path contains a .php file followed by /core/ and another .php name.

ATT&CK: Persistence (TA0003) – T1505.003 Web Shell.

title: Drupal PHP File Requested With Trailing /core/ Path - Potential Fail2Install Code Execution
id: aba8fc39-98da-47fa-be7a-8609c0d87300
status: experimental
description: |
    Detects requests where a .php path is followed by an extra /core/<name>.php segment. Searchlight Cyber says a crafted
    path got past the stock Drupal Apache .htaccess rule in the Fail2Install chain (CVE-2026-132165); the CSA and Hive
    Security write-ups list this path shape as an indicator. Built from published research, not from vendor IOCs.
references:
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-drupal-fail2install-ai-found-installer-tak/
    - https://hivesecurity.gitlab.io/blog/drupal-cve-2026-136716-installer-takeover/
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - cve.2026-132165
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|re: '\.php/core/[^/]*\.php'
    condition: selection
falsepositives:
    - Scanners and vulnerability checks that probe this path pattern (still worth a look on a Drupal host)
level: high

View on GitHub

False positives and tuning: I don’t know of a legitimate Drupal route with this shape, so expect hits from scanners testing for the bug. Check the response code: a 200 for one of these paths deserves an incident ticket, a 404 is a probe. Make sure your log format keeps the full path; some setups split the path info part out.

How to test: request /modules/test.php/core/test.php on a lab site. It will typically return 404, depending on the server, and the log line should match.

PHP file created in Drupal public files directory

Context: Drupal’s public files directory under sites/<site>/files is for uploads and generated assets. The CSA note lists PHP files in the public files directory as an indicator. The exception is my own: from general Drupal knowledge, the default compiled Twig cache lives under files/php/twig, so I filter that path. A new PHP file anywhere else in that tree is most likely a web shell or a database file planted through the installer. This rule outlives the CVE, which is why it carries no emerging-threat tag.

Condition: alert when a file ending in .php is created under a path containing /sites/ and /files/, unless the path contains /files/php/twig/.

ATT&CK: Persistence (TA0003) – T1505.003 Web Shell.

title: PHP File Created In Drupal Public Files Directory
id: 9857fb99-344e-4407-8333-68aadb13f0f1
status: experimental
description: |
    Detects creation of a .php file under a Drupal sites/<site>/files directory. CSA lists PHP files in the public files
    directory as an indicator; excluding files/php/twig (the default compiled Twig cache) is my own tuning. A new PHP
    file there points to a web shell or to a database file planted through the installer (Fail2Install chain).
references:
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-drupal-fail2install-ai-found-installer-tak/
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://www.drupal.org/sa-core-2026-019
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - cve.2026-132165
    - cve.2026-136716
logsource:
    product: linux
    category: file_event
detection:
    selection:
        TargetFilename|contains: '/sites/'
        TargetFilename|endswith: '.php'
    selection_files_dir:
        TargetFilename|contains: '/files/'
    filter_main_twig_cache:
        TargetFilename|contains: '/files/php/twig/'
    condition: all of selection* and not 1 of filter_main_*
falsepositives:
    - Sites that moved the Twig cache or other generated PHP into a custom path under files/ (add that path as a filter)
    - Backup or migration tools that copy PHP files into the files directory
level: high

View on GitHub

False positives and tuning: if you moved the Twig cache or keep other generated PHP under files/, add that path as a filter. Backup and migration tools that copy whole trees can also trip it. The bigger limit is telemetry: file creation events are not collected by default on Linux, so you need Sysmon for Linux, an auditd watch on the files directory, or an EDR. A file written somewhere other than files/ will not match.

How to test: on a lab host with file telemetry on, run touch sites/default/files/test.php and check for an alert, then create a file under sites/default/files/php/twig/ and check that the filter keeps it quiet.

Coverage and gaps

Step in the caseTacticTechniqueRuleCovered?
Reach the installer and flood it (Fail2Install)Initial Access (TA0001)T1190Installer request burstPartly, threshold based
Submit installer forms and reinstallInitial Access (TA0001)T1190Installer POST requestYes
Take over user 1 or create an adminPersistence (TA0003)T1078 Valid AccountsNoneGap: Drupal logs and state, manual check
Write PHP through a SQLite filePersistence (TA0003)T1505.003PHP file in public filesYes, with host file telemetry
Run it through a .php/core/ pathPersistence (TA0003)T1505.003.php/core/ pathYes

What none of these rules can see is the account takeover itself. Drupal’s advice is to check logs for changes to or by user 1, set its email to one you control and consider resetting its password. Do that by hand, along with looking for administrators you don’t recognise. Hive Security also suggests checking the installer state with drush state:get install_task (expect done) and drush state:get install_time (expect the original install time). The CSA note lists database error strings that appear during the resource flood, such as PostgreSQL refusing extra clients or MySQL reporting too many connections. Those are worth a manual search of your database and PHP error logs for the days after November 18, but ordinary overload produces them too, so I did not turn them into a rule.

Deploying the rules

Pull the YAML from the GitHub folders above and convert it with sigma-cli for your SIEM. The web rules use the standard webserver field names (cs-uri-stem, cs-method, c-ip), so you need a pipeline that maps them to your Apache or nginx fields. The Linux rule uses TargetFilename as Sysmon for Linux does. A few examples:

sigma convert -t splunk --without-pipeline web_drupal_installer_post_request.yml
sigma convert -t lucene --without-pipeline web_drupal_php_path_info_core_bypass.yml
sigma convert -t splunk --without-pipeline file_event_lnx_drupal_php_file_in_public_files.yml

--without-pipeline keeps the Sigma field names as they are, so rename them to your own log schema (or write a small pipeline) before the query returns anything. The correlation rule needs a backend that supports Sigma correlations; if yours does not, run the base rule as a scheduled search with a count. Run everything in alert-only mode for a week before it pages anyone, and do a retro-hunt back to November 18, 2026 on day one.

My take

This is one of the more detectable critical bugs I’ve written rules for, and that’s because of where it lives. Every variant has to pass through one URL that a finished site never needs. If I could only deploy one rule, it would be the installer POST, and I’d pair it with the web server block from the analysis so that a hit means “someone tried” rather than “someone got in”.

The weak spot is the part attackers care about most: the takeover of user 1 happens inside Drupal, and default logging does not make it easy to see from outside. I’d like Drupal to log any write to the installer state, and any change to user 1’s email or password, to syslog by default, with a clear event name a SIEM can key on. Until then, the manual checks in the gaps section are not optional.

Sources

Drupal’s installer got patched twice in a week, and attackers used both gaps

Drupal’s installer got patched twice in a week, and attackers used both gaps

Every Drupal site ships with a file whose whole job is to build a brand new site: core/install.php. On most production sites it sits there for years, answering “already installed” to anyone who asks. In the last week it has answered something else, twice, and attackers were listening both times.

On November 25, 2026 the Drupal Security Team published SA-CORE-2026-019 (CVE-2026-136716), a “Highly critical” access bypass that lets an unauthenticated attacker take over a site through the installer. It exists because the fix from one week earlier, SA-CORE-2026-017 (CVE-2026-132165, the bug Searchlight Cyber nicknamed “Fail2Install”), did not cover sites stuck in unusual or incomplete installation states. Drupal says both are exploited in the wild, and CISA added the new one to its Known Exploited Vulnerabilities (KEV) catalog on November 27 with a November 30 deadline.

Severity in one line: critical. Unauthenticated, remote, full site takeover, confirmed exploitation, and a fix that only works if you also run the database updates.

At a glance

  • CVEs: CVE-2026-136716 (SA-CORE-2026-019, November 25, 2026) and the earlier CVE-2026-132165 (SA-CORE-2026-017, November 18, 2026).
  • Scores: Drupal risk 21/25 and 20/25, both “Highly critical”. CVSS 3.1 9.8 for both on NVD (CVE-2026-136716 from CISA’s ADP entry; CVE-2026-132165 from NVD, with CISA’s ADP entry at 8.1).
  • Affected: Drupal core before 10.6.23, 11.0.0 to before 11.3.23, and 11.4.0 to before 11.4.14, when the installer is reachable. Drupal 11.2.x and older, 10.5.x and older, and Drupal 8 and 9 are end-of-life and get no fix.
  • Exploitation: confirmed by Drupal for both. First reported exploitation of CVE-2026-132165 on November 19, 2026 at 19:00 UTC. Both are in CISA KEV (added November 24 and November 27).
  • Fix: 10.6.23, 11.3.23 or 11.4.14, then run update.php (or drush updatedb), then block install.php at the web server.
  • Who should care: anyone running a supported Drupal 10 or 11 release below the fixed versions, anyone on an end-of-life branch (Searchlight lists Drupal 8.9 and 9 as affected by the first bug), and teams whose deploys skip database updates.

What happened

The story starts with SA-CORE-2026-017 on November 18, 2026. Drupal’s advisory was short: under specific conditions an attacker can use the installer to try to reinstall Drupal on an existing site, which can lead to site takeover or remote code execution. Drupal credited the find to Anthropic’s OSS Scanner.

Drupal later updated that advisory: the Security Team received a report of exploitation on live sites as early as November 19 at 19:00 UTC. That is roughly a day after the patch. On November 24, CISA put CVE-2026-132165 into KEV, and Searchlight Cyber researchers Kevin Gervot and Adam Kues published their own write-up of the bug. Their report to Drupal had been a duplicate, but they had confirmed pre-auth code execution on a stock Apache and PostgreSQL setup back on October 27.

Then came SA-CORE-2026-019 on November 25. Drupal’s wording: the first fix closed several installer holes, but some sites in unusual or incomplete installation states were still open to takeover, production sites included. The vulnerable state is not visible in the admin interface, sites already compromised may no longer look vulnerable, and any site that left its installer reachable after SA-CORE-2026-017 may already have been taken over. The advisory is blunt: “This is being exploited in the wild.”

Timeline for November 2026: Nov 18 SA-CORE-2026-017 fixes CVE-2026-132165, Nov 19 exploitation reported from 19:00 UTC, Nov 24 Searchlight write-up and KEV listing, Nov 25 SA-CORE-2026-019 for exploited CVE-2026-136716, Nov 27 KEV listing with a Nov 30 deadline.
Two Drupal installer advisories in a week, both exploited.

How it works

Drupal has not published exploit details, so this section leans on named researchers, labelled as such, and stays conceptual.

The installer first asks: “Is Drupal already installed here?” According to Searchlight, in the vulnerable versions that check failed open. A transient database failure made the installer treat a live site as not installed, which brought the setup forms back.

The clever part of the Searchlight research is how they made that error happen on demand. They looked at three system limits: open file descriptors, the database’s maximum connections, and TCP ephemeral source ports. Push any of them to the edge and new database connections fail for a moment. Resource exhaustion is usually filed under “availability”; here it became an authentication bypass. Searchlight says it worked with Apache or PHP-FPM and MySQL or PostgreSQL on Drupal 8.9, 9, 10 and 11, with PHP-FPM harder. Drupal 7 and Drupal 8 before 8.9 are not affected, per the researchers.

Once the installer is open, the attacker gets to configure the site. Searchlight describes turning that into code execution: the installer accepted a user-chosen SQLite database file path, so a database file could be placed under the web root with a PHP extension and content the attacker controls, and the stock Apache .htaccess rule meant to stop such files running was not anchored, so a crafted path slipped past it. Even without that step, my reading is that whoever completes a reinstall controls the administrator account it sets up; Drupal itself just calls the result site takeover.

Four-step chain: starve the database so a check fails, the installer fails open on a live site, the attacker reinstalls and takes the administrator account, then a SQLite file with a .php name in the web root runs as code. Step three is my inference.
The Fail2Install chain as Searchlight Cyber describes it, at a conceptual level. Drupal has not published exploit details.

CVE-2026-136716 is the leftover gap. Drupal only says it affects sites in unusual or incomplete installation states and that an update hook must run to fix sites already in that state. Hive Security read the fix commit and inferred that the first patch missed one stored state: an install task recorded with no install time. The new update hook writes the missing values. That is a reading of a diff, not a Drupal statement, but it explains why upgrading code alone is not enough.

Who is affected and how badly

The precondition is simple: the installer has to be reachable from the internet. Drupal says sites that already secured install.php are not vulnerable to SA-CORE-2026-019. The catch: securing it is a web server rule or Composer script each site owner adds, per Drupal’s “Securing the installer” page, and the reported exploitation says enough sites never did.

No login is needed. For CVE-2026-136716 Drupal describes site takeover, and CISA scores it automatable with total technical impact. Code execution as the web server account comes from Searchlight’s research on the first bug, CVE-2026-132165. The unusual-state condition sounds narrow, but the admin UI can’t show it, so treat every reachable installer as exposed until updates have run.

End-of-life branches (Drupal 8, 9, 10.5 and older, 11.2 and older) get no fix from Drupal. Searchlight lists 8.9 and 9 as affected by the first bug; nobody has said whether they are affected by the second. Either way, blocking the installer is the only protection those sites can get, and Drupal says sites with a secured installer are not vulnerable to SA-CORE-2026-019.

Unknown as of November 28, 2026: who is exploiting these bugs, how many sites were hit, and what attackers do next. Drupal has published no victim count or IOCs.

What to do now

  1. Block the installer first, right now, before the maintenance window. On nginx, Drupal recommends a prefix match in the server block: location ^~ /core/install.php { return 404; }. Don’t use an exact location = match, which can miss paths like /core/install.php/foo. On Apache, put <Location "/core/install.php"> Require all denied </Location> in the virtual host, not in .htaccess, because Composer scaffolding overwrites .htaccess.
  2. Before you upgrade, save the evidence: web access logs since November 18, a database dump, and a copy of settings.php.
  3. Upgrade to 10.6.23, 11.3.23 or 11.4.14.
  4. Run update.php or drush updatedb. Drupal says an update hook must run to fix existing production sites in the vulnerable state. If your CI pipeline deploys code and skips database updates, the new release does not protect you.
  5. Check user 1, as Drupal advises: look at logs for changes to or by that account, set its email address to one you control, and consider resetting its password. Look for administrator accounts you don’t recognise.
  6. Verify the block from outside. Drupal’s page suggests requesting /core/install.php, /install.php and /core/install.php/foo; each should return 403 or 404. A 200 means the block isn’t working.
  7. If anything looks wrong, treat the site as compromised and follow the “Your Drupal site got hacked. Now what?” page that the advisory links. My own baseline for a compromised site: rebuild from trusted code, restore a database backup from before November 18, and rotate the database credentials and other secrets.

Detection and monitoring

Nobody has published IP addresses, hashes or user agents, so you detect behaviour. On an installed site nobody has a reason to submit installer forms, and that shows up in web access logs that record the method and full path. The code execution path Searchlight describes leaves two more traces: an odd .php/core/ request path, and a PHP file in the uploads directory, visible if you collect host file events. I wrote four Sigma rules around those signals.

RuleCategoryLog sourceATT&CKLevel
Drupal installer POST requestWeb/App, emerging threatwebserverT1190High
Burst of installer requests from one client (correlation)Web/App, emerging threatwebserverT1190Medium
PHP file requested with trailing /core/ pathWeb/App, emerging threatwebserverT1505.003High
PHP file created in Drupal public filesLinux, generic TTPlinux / file_eventT1505.003High

The one I’d turn on first is the simplest: alert on any POST request whose path contains /install.php. Scope it to production hosts, because building a new site or adding a multisite site through the browser fires it legitimately. It also fires on blocked attempts that got a 403 or 404, which is useful attempt telemetry even when the request failed.

title: Drupal Installer POST Request - Potential CVE-2026-136716 / CVE-2026-132165 Site Takeover
id: d251aa0a-f5e0-4e6a-85f2-31c59d86e62c
status: test
description: |
    Detects HTTP POST requests to the Drupal installer (install.php). Drupal names the installer as the vector for both
    exploited flaws, SA-CORE-2026-017 and SA-CORE-2026-019. A reinstall most likely requires submitting installer
    forms (inference), which a site that is already installed should never receive.
references:
    - https://www.drupal.org/sa-core-2026-019
    - https://www.drupal.org/sa-core-2026-017
    - https://www.drupal.org/docs/administering-a-drupal-site/security-in-drupal/securing-the-installer-installphp
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-136716
    - cve.2026-132165
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection_path:
        cs-uri-stem|contains:
            - '/core/install.php'
            - '/install.php'
    selection_method:
        cs-method: 'POST'
    condition: all of selection_*
falsepositives:
    - Building a brand new Drupal site or adding a multisite site through the browser installer
    - Staging or development hosts that are reinstalled on purpose (scope the rule to production hosts)
level: high

For monitoring, run the rules back over your logs to November 18, 2026, the day the first fix shipped, since Drupal says exploitation started as early as the next evening. Also check by hand that user 1 and the administrator list look right, and that the installer state looks finished after updates (Hive Security suggests drush state:get install_task, which should return done). Keep the installer rules on after you patch: any later hit means someone is testing for the next installer bug.

I wrote up all four rules, with tuning notes, lab tests and the ATT&CK gaps, in a separate detection post. The YAML lives in my Detection Rules repo.

My take

I think the patch is the least interesting part of this story. The real bug is cultural: a production web app that keeps a “build me a new site” endpoint online forever, guarded only by a runtime check that says “looks installed to me”. Searchlight fooled that check with a briefly unavailable database; the second advisory fooled it with state the first fix never imagined. A third bypass would not surprise me. A blocked URL doesn’t care about clever state.

So my first action on any Drupal estate today is the web server rule, not the upgrade. It takes minutes, it covers end-of-life sites that will never get a patch, and it protects you from whatever the next installer bug turns out to be. I’d also like to see Drupal block the installer by default once a site is installed. Leaving it to a docs page invites sites to skip it.

The underrated detail is the update hook. Pipelines that ship code and leave drush updatedb as a manual step will show the patched version and stay vulnerable. On a fleet, check that the hook ran, not just the version.

Finally, the speed. An AI scanner found the first bug, two human researchers found it independently, and attackers used it about a day after the fix. With a gap that short, “we patch Drupal monthly” is not a plan for highly critical core advisories.

Sources

Hunting after CVE-2026-58630: 6 Sigma rules for App Service credential abuse

Hunting after CVE-2026-58630: 6 Sigma rules for App Service credential abuse

Writing detections for a CVE with no IOCs, no mechanism and no patch feels a bit like building a smoke alarm for a fire that already went out. Microsoft gave CVE-2026-58630 a 10.0, fixed it on its own side before the July 23, 2026 advisory, and published one sentence about it. I covered what is and isn’t known in my analysis of the bug.

So let me be upfront: none of the six rules below detects CVE-2026-58630. They detect what anyone with elevated access to an App Service app would do next, whether they got it through a platform bug, a phished admin or an over-broad role: pull the deployment credentials, use them, and change the app so access sticks. That behaviour is the same with or without a CVE, which is why I think these are worth running permanently, and why I’d retro-hunt them over whatever log history you still have from before July 24.

At a glance

  • Rules: 6 (four single-event rules, one hunting base rule, one Sigma correlation). One is test, five are experimental.
  • Domain: Cloud-Azure.
  • Log sources: Azure Activity log (azure/activitylogs, Sentinel AzureActivity) and the App Service resource log AppServiceAuditLogs. Microsoft says resource logs aren’t collected by default and need a diagnostic setting.
  • ATT&CK: T1552 Unsecured Credentials, T1078.004 Cloud Accounts, T1556 Modify Authentication Process, T1505 Server Software Component.
  • What they are: hunting and hardening rules for App Service credential and config abuse. Not exploit signatures.
  • YAML: Detection Rules/Cloud/Azure in my GitHub repo.

The case in brief

CVE-2026-58630 is an improper access control (CWE-284) elevation of privilege in Azure App Service. Microsoft scored it AV:N/PR:N/UI:N with scope changed, says it was not exploited, and marked it “no customer action required”. The component, the exposure window and the rollout date of the fix are not public as of November 25, 2026. The full story, including the Azure Stack Hub naming mismatch, is in the analysis.

For detection that leaves one useful question: what does elevated access to an App Service app buy you, and where does using it show up? Microsoft answered that in May 2026, in a different case. In its Storm-2949 report, the actor called publishxml/action to download publishing profiles, which carry FTP, Web Deploy and Kudu credentials, and used them to get into auxiliary App Service apps. I used that as the template. Step one, credentials through the management plane, lands in the Activity log. Step two, logging in with them, lands in AppServiceAuditLogs. Step three, persistence through auth or deployment changes, is back in the Activity log.

Detection map

Block diagram: the Azure Activity log and AppServiceAuditLogs feed six Sigma rules (publishing profile retrieved, basic-credential publishing login, profile pulled then used correlation, basic auth policy changed, source control or extension changed, settings or Functions keys listed) mapped to ATT&CK T1552, T1078.004, T1556 and T1505, with the exploit itself and routine deploys and reads marked as gaps.
Two log sources, six rules. The CVE itself leaves no known tenant-visible trace.

Two log sources feed six rules. The single highest-signal one is the correlation in the middle: a profile pulled and then used for a basic-auth login on the same app within an hour. Around it sit the single-event rules for credential access and persistence, two of them tuned as hunting rules because they fire on everyday admin work. On the right are the gaps I couldn’t close with Sigma, starting with the obvious one: the exploit itself happened on Microsoft’s side, and nobody has said it leaves anything a tenant can see.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Publishing profile retrievedCloud-AzureActivity logCredential Access / T1552Mediumtest
Publishing login with basic credentialsCloud-AzureAppServiceAuditLogsPersistence / T1078.004Low (hunting)experimental
Profile retrieved, then used for basic login (correlation)Cloud-AzureBothCredential Access, Persistence / T1552, T1078.004Highexperimental
Basic auth publishing policy changedCloud-AzureActivity logPersistence / T1556Mediumexperimental
Source control or site extension changedCloud-AzureActivity logPersistence / T1505Mediumexperimental
Sensitive settings or Functions keys listedCloud-AzureActivity logCredential Access / T1552Low (hunting)experimental

A note on tags: I left the cve.2026-58630 tag off on purpose. Plenty of tooling counts CVE tags as coverage, and these rules don’t cover the CVE. The CVE is named in each description instead.

The rules

Azure App Service Publishing Profile Retrieved

Context: Microsoft says a publishing profile often contains basic-auth credentials for FTP, Web Deploy and the Kudu console. Datadog’s Stratus Red Team goes further: it says the XML holds the FTP and Web Deploy credentials in cleartext and that anyone with read-or-higher access can call publishxml without touching Key Vault. This is the step Storm-2949 used, and Stratus documents a sample Activity log event for it. That’s why this is the only rule I marked test: the operation name and the telemetry are confirmed, not guessed.

Condition: alert when anyone calls the publish-profile action on an App Service app or deployment slot.

ATT&CK: Credential Access (TA0006) – T1552 Unsecured Credentials.

title: Azure App Service Publishing Profile Retrieved
id: 1619694c-4499-4da8-b517-04386221afcb
name: azure_app_service_publishxml
status: test
description: |
    Detects retrieval of an App Service or slot publishing profile through the Azure management plane. Microsoft says the
    profile often contains basic-auth credentials for FTP, Web Deploy and Kudu; Storm-2949 used this action to compromise
    App Service apps. Hunting and hardening rule, not an exploit signature for CVE-2026-58630 (no IOCs are public).
references:
    - https://github.com/DataDog/stratus-red-team/blob/main/docs/attack-techniques/azure/azure.credential-access.app-service-publishing-credentials.md
    - https://www.microsoft.com/en-us/security/blog/2026/05/18/storm-2949-turned-compromised-identity-into-cloud-wide-breach/
    - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.credential-access
    - attack.t1552
logsource:
    product: azure
    service: activitylogs
detection:
    selection:
        operationName:
            - 'MICROSOFT.WEB/SITES/PUBLISHXML/ACTION'
            - 'MICROSOFT.WEB/SITES/SLOTS/PUBLISHXML/ACTION'
    condition: selection
falsepositives:
    - Developers clicking "Download publish profile" in the portal, or Visual Studio and older pipeline tasks that import a profile
    - Infrastructure-as-code or backup tooling that exports profiles; baseline callers per app and alert on a new caller or IP
level: medium

View on GitHub

False positives and tuning: the portal’s “Download publish profile” button, Visual Studio publish and older pipeline tasks all call this. Baseline callers and source IPs per app for 30 days, then alert on a new caller or a new IP. Stratus notes the operation is logged even when basic auth is disabled. Keep the rule on for those apps too: there, in my view, a profile download is even more suspicious, because nobody should need it.

How to test: in a lab subscription run az webapp deployment list-publishing-profiles -g <rg> -n <app> --xml, or stratus detonate azure.credential-access.app-service-publishing-credentials.

Azure App Service Publishing Login With Basic Credentials

Context: once someone has the profile, they log in over FTP, Web Deploy or Kudu. AppServiceAuditLogs records publishing logins with User, UserAddress and Protocol. Microsoft’s two pages differ on scope: the table reference says successful logons, the basic auth guide says successful and attempted logins, and the records carry no result field. The table reference says UserDisplayName holds an email address when publishing was authorised through Entra, and Microsoft’s basic-auth FTP example shows the app’s $ publishing user there instead. My inference: no @ in that field means basic publishing credentials. That’s not documented in so many words, so the rule is experimental.

Condition: flag any publishing login event where UserDisplayName contains no email address.

ATT&CK: Persistence (TA0003) – T1078.004 Valid Accounts: Cloud Accounts.

title: Azure App Service Publishing Login With Basic Credentials
id: f76d71dd-63dc-4f23-8283-15c6f486f4b8
name: azure_app_service_publishing_login_basic
status: experimental
description: |
    Hunting rule for FTP, Web Deploy or Kudu login events on an App Service app where UserDisplayName holds no email
    address. Microsoft documents an email there for Entra-authorised publishing, and its basic-auth FTP example shows
    the $app publishing user instead; treating "no @" as basic auth is my inference. Not a CVE-2026-58630 signature.
references:
    - https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/appserviceauditlogs
    - https://learn.microsoft.com/en-us/azure/app-service/configure-basic-auth-disable
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.persistence
    - attack.t1078.004
    - detection.threat-hunting
logsource:
    product: azure
    service: appserviceauditlogs
detection:
    selection:
        Category: 'AppServiceAuditLogs'
    filter_main_entra_user:
        UserDisplayName|contains: '@'
    condition: selection and not filter_main_entra_user
falsepositives:
    - Legacy FTP or Web Deploy pipelines that still use the publishing profile; move them to OIDC or managed identity
    - Apps where basic auth is intentionally enabled
level: low

View on GitHub

False positives and tuning: on apps that still deploy with FTP or a publishing profile this fires on every deploy, which is why it’s low and mainly feeds the correlation. Field names are the Log Analytics columns; if you stream resource logs through Event Hub they sit under properties.*, so map them in your pipeline. The logsource service appserviceauditlogs is my own name: SigmaHQ’s taxonomy appendix lists only activitylogs, auditlogs, riskdetection, pim and signinlogs for Azure.

How to test: enable basic auth on a lab app, add a diagnostic setting for AppServiceAuditLogs, and connect with an FTP client using the profile credentials.

Azure App Service Publishing Profile Retrieved Then Used For Basic Login

Context: either event alone is common in a busy subscription. A profile pull followed by a basic-auth login on the same app shortly after is the sequence Microsoft describes for Storm-2949. In my experience it’s uncommon for legitimate users, and Microsoft’s own guidance pushes deployments toward Entra, managed identity and OpenID Connect instead of basic auth.

Condition: alert when a publishing profile is downloaded and, within one hour, a basic-credential publishing login hits the same App Service resource. The one-hour window is my choice; no source gives a timing.

ATT&CK: Credential Access (TA0006) – T1552 Unsecured Credentials; Persistence (TA0003) – T1078.004 Cloud Accounts.

title: Azure App Service Publishing Profile Retrieved Then Used For Basic Login
id: e4c61c2a-dcaf-47f7-9685-ac7fe75fc695
status: experimental
description: |
    Detects a publishing profile download followed, within one hour, by a basic-credential FTP, Web Deploy or Kudu login
    on the same App Service resource, the sequence Microsoft's Storm-2949 report describes. Hunting and
    hardening rule, not an exploit signature for CVE-2026-58630; the one-hour window is my choice, not a source value.
references:
    - https://www.microsoft.com/en-us/security/blog/2026/05/18/storm-2949-turned-compromised-identity-into-cloud-wide-breach/
    - https://github.com/DataDog/stratus-red-team/blob/main/docs/attack-techniques/azure/azure.credential-access.app-service-publishing-credentials.md
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.credential-access
    - attack.persistence
    - attack.t1552
    - attack.t1078.004
correlation:
    type: temporal_ordered
    rules:
        - azure_app_service_publishxml
        - azure_app_service_publishing_login_basic
    aliases:
        app_resource:
            azure_app_service_publishxml: resourceId
            azure_app_service_publishing_login_basic: _ResourceId
    group-by:
        - app_resource
    timespan: 1h
falsepositives:
    - A developer who downloads the profile and deploys with it from Visual Studio or an FTP client in the same hour
level: high

View on GitHub

False positives and tuning: a developer downloading the profile and deploying from Visual Studio in the same hour will trip it. That’s also a habit worth breaking. The join is on the resource ID, which the Activity log often writes in upper case and resource logs in lower case, so normalise case first. If your backend can’t convert Sigma correlations, this KQL does the same job in Sentinel or Log Analytics:

AzureActivity
| where OperationNameValue in~ ("MICROSOFT.WEB/SITES/PUBLISHXML/ACTION",
                                "MICROSOFT.WEB/SITES/SLOTS/PUBLISHXML/ACTION")
| project PullTime = TimeGenerated, Caller, CallerIpAddress, Site = tolower(_ResourceId)
| join kind=inner (
    AppServiceAuditLogs
    | where UserDisplayName !contains "@"
    | project LoginTime = TimeGenerated, User, UserAddress, Protocol, Site = tolower(_ResourceId)
  ) on Site
| where LoginTime between (PullTime .. (PullTime + 1h))
| project PullTime, LoginTime, Site, Caller, CallerIpAddress, User, UserAddress, Protocol

How to test: run the two tests above against the same lab app within the hour.

Azure App Service Basic Auth Publishing Policy Changed

Context: Microsoft’s guidance, and my advice in the analysis, is to disable FTP and SCM basic auth through the basicPublishingCredentialsPolicies resource. An attacker who wants the profile credentials to work flips it back. That should almost never happen once a tenant has rolled out the hardening.

Condition: alert on any write to the FTP or SCM basic auth policy of an app or slot, unless the logged request body shows "allow": false.

ATT&CK: Persistence (TA0003) – T1556 Modify Authentication Process.

title: Azure App Service Basic Auth Publishing Policy Changed
id: 3c3f0ea3-b47b-47c1-96f1-59e7ea4f1ee3
status: experimental
description: |
    Detects a write to the FTP or SCM basic authentication publishing policy of an App Service app or slot, unless the
    logged request body shows it being disabled. Re-enabling basic auth brings back long-lived deploy passwords. Hardening
    rule, not an exploit signature for CVE-2026-58630; the request body logic is inferred and depends on your export.
references:
    - https://learn.microsoft.com/en-us/azure/app-service/configure-basic-auth-disable
    - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.persistence
    - attack.t1556
logsource:
    product: azure
    service: activitylogs
detection:
    selection:
        operationName:
            - 'MICROSOFT.WEB/SITES/BASICPUBLISHINGCREDENTIALSPOLICIES/WRITE'
            - 'MICROSOFT.WEB/SITES/SLOTS/BASICPUBLISHINGCREDENTIALSPOLICIES/WRITE'
    filter_main_disable:
        properties.requestbody|contains:
            - '"allow":false'
            - '"allow": false'
    condition: selection and not filter_main_disable
falsepositives:
    - Planned exceptions where a team needs FTP or Web Deploy basic auth for a legacy tool
    - Policy writes without a logged request body fire as well; check the resulting setting before escalating
    - ARM or Bicep deployments that re-apply the policy resource on every run
level: medium

View on GitHub

False positives and tuning: I built the filter as an exclusion on purpose. If your export doesn’t carry properties.requestbody for this operation (I couldn’t confirm that it does), the rule still fires on every policy write instead of going silent. Expect noise from ARM or Bicep templates that re-apply the policy on each deployment; exclude those deployment identities by caller. The Azure Policy remediation task that turns basic auth off will also show up if no request body is logged.

How to test: on a lab app, run Microsoft’s documented command with true instead of false: az resource update --resource-group <rg> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app> --set properties.allow=true. That covers SCM (Web Deploy and Git); use --name ftp for FTP, and note Microsoft says SCM basic auth must be on before FTP basic auth can be enabled. Repeat both with false to check the filter.

Azure App Service Source Control or Site Extension Changed

Context: pointing an app’s deployment source at a new repository, or installing a site extension, both can put code into the app. My view, not a documented fact: they draw less attention than dropping a file over FTP, and resetting the publishing credentials alone doesn’t undo them.

Condition: alert when someone writes the source control configuration or installs a site extension on an app or slot.

ATT&CK: Persistence (TA0003) – T1505 Server Software Component.

title: Azure App Service Source Control or Site Extension Changed
id: 4053a354-7f2c-413a-9b0d-98efe1ca0b68
status: experimental
description: |
    Detects changes to an App Service app's source control (deployment source) configuration, or installation of a site
    extension, on the app or a slot. Either one lets a caller run code inside the app. Hunting and hardening rule for
    App Service config abuse, not an exploit signature for CVE-2026-58630.
references:
    - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
    - https://learn.microsoft.com/en-us/azure/app-service/monitor-app-service-reference
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.persistence
    - attack.t1505
logsource:
    product: azure
    service: activitylogs
detection:
    selection:
        operationName:
            - 'MICROSOFT.WEB/SITES/SOURCECONTROLS/WRITE'
            - 'MICROSOFT.WEB/SITES/SLOTS/SOURCECONTROLS/WRITE'
            - 'MICROSOFT.WEB/SITES/EXTENSIONS/WRITE'
            - 'MICROSOFT.WEB/SITES/SLOTS/EXTENSIONS/WRITE'
    condition: selection
falsepositives:
    - Initial setup of GitHub Actions or Azure DevOps deployment from the portal Deployment Center
    - Teams that install site extensions such as monitoring agents; scope to production apps and known owners
level: medium

View on GitHub

False positives and tuning: Deployment Center setup and monitoring-agent extensions are the usual hits. Both are one-off events per app, so the volume stays manageable. Scope to production subscriptions and route to the app owner rather than the SOC queue if you need to.

How to test: connect a test GitHub repository in Deployment Center on a lab app, or install any site extension on a Windows lab app.

Azure App Service Sensitive Settings or Functions Keys Listed

Context: config/list/Action returns what Microsoft calls security-sensitive settings: publishing credentials, app settings and connection strings. The listkeys actions return Functions host and function keys. For a retro-hunt this is where a credential grab would show up if it didn’t use the profile.

Condition: return every call that lists sensitive settings or Functions keys, for review by caller, IP and app.

ATT&CK: Credential Access (TA0006) – T1552 Unsecured Credentials.

title: Azure App Service Sensitive Settings or Functions Keys Listed
id: 26acce63-709c-4cbb-a608-6d163674c25d
status: experimental
description: |
    Hunting rule for listing App Service security-sensitive settings (publishing credentials, app settings, connection
    strings) or Azure Functions host and function keys through the management plane. Useful for a retro-hunt by caller
    and IP; noisy as an alert. Not an exploit signature for CVE-2026-58630.
references:
    - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.credential-access
    - attack.t1552
    - detection.threat-hunting
logsource:
    product: azure
    service: activitylogs
detection:
    selection:
        operationName:
            - 'MICROSOFT.WEB/SITES/CONFIG/LIST/ACTION'
            - 'MICROSOFT.WEB/SITES/SLOTS/CONFIG/LIST/ACTION'
            - 'MICROSOFT.WEB/SITES/HOST/LISTKEYS/ACTION'
            - 'MICROSOFT.WEB/SITES/SLOTS/HOST/LISTKEYS/ACTION'
            - 'MICROSOFT.WEB/SITES/FUNCTIONS/LISTKEYS/ACTION'
            - 'MICROSOFT.WEB/SITES/SLOTS/FUNCTIONS/LISTKEYS/ACTION'
    condition: selection
falsepositives:
    - The portal Configuration and Function keys blades call these actions whenever someone opens them
    - Deployment pipelines, Terraform and the Azure CLI read settings and keys on every run
level: low

View on GitHub

False positives and tuning: opening the Configuration blade in the portal calls this, and so does every Terraform plan. Don’t alert on it. Stack it by caller and IP and read the bottom of the list, or join it to your list of identities that normally manage each app.

How to test: az webapp config appsettings list -g <rg> -n <app> or az functionapp keys list -g <rg> -n <app>.

Retro-hunting the pre-fix window

If your workspace still holds data from before July 24, 2026, start with a stack count rather than alerts. These are the two queries from the analysis draft, slightly widened to cover slots, deployments and slot swaps:

AzureActivity
| where TimeGenerated < datetime(2026-07-24)
| where OperationNameValue has "MICROSOFT.WEB/SITES"
| where OperationNameValue has_any ("PUBLISHXML/ACTION", "CONFIG/LIST/ACTION",
    "LISTKEYS/ACTION", "CONFIG/WRITE", "BASICPUBLISHINGCREDENTIALSPOLICIES/WRITE",
    "EXTENSIONS/WRITE", "SOURCECONTROLS/WRITE", "DEPLOYMENTS/WRITE", "SLOTSSWAP/ACTION")
| summarize events = count(), first = min(TimeGenerated), last = max(TimeGenerated)
    by Caller, CallerIpAddress, OperationNameValue, _ResourceId
| order by events asc

AppServiceAuditLogs
| where TimeGenerated < datetime(2026-07-24)
| summarize logins = count(), first = min(TimeGenerated), last = max(TimeGenerated)
    by _ResourceId, User, UserDisplayName, UserAddress, Protocol
| order by logins asc

Remember the retention maths from the analysis: the platform keeps the Activity log for 90 days, which on November 25 reaches back only to August 27. If you never exported it, these queries come back empty for July, and that tells you nothing about July.

Coverage and gaps

StepTacticTechniqueRuleCovered?
Exploit CVE-2026-58630Privilege EscalationUnknown, platform-side–Gap: no mechanism or tenant-visible trace published
Pull publishing profileCredential AccessT1552Publishing profile retrievedYes
List settings, connection strings, Functions keysCredential AccessT1552Settings or keys listedYes (hunting)
Log in with publishing credentialsPersistenceT1078.004Basic login + correlationYes, needs AppServiceAuditLogs
Re-enable basic authPersistenceT1556Basic auth policy changedYes
New deployment source or site extensionPersistenceT1505Source control or extension changedYes
Deployments, zip deploy, slot swaps, app settings rewritesPersistenceT1505–Gap: too routine for a rule; retro-hunt query only
App’s managed identity used against other resourcesCredential AccessT1528–Gap: needs a per-identity baseline
Files and environment variables read through KuduCollection––Gap: the Activity log typically does not capture read operations

The biggest gap is the one I can’t do anything about: the vulnerability itself. CWE-284 with scope changed suggests a boundary inside the platform, and Microsoft hasn’t said whether exploiting it would leave anything in tenant logs at all. Beyond that, two gaps are worth closing with other tools. Managed identity token misuse (MITRE’s T1528 page uses managed identity tokens as an example) needs a baseline of which resources each app identity normally calls, which is a UEBA job on AADManagedIdentitySignInLogs rather than a Sigma rule. Kudu file and environment reads are data-plane activity that the Activity log typically does not capture; the HTTP logs of the app’s SCM site may show some of it, but I haven’t verified what they record. For platform-side detection, Microsoft’s Storm-2949 report recommends Defender for App Service and names a Defender for Resource Manager alert, “Suspicious invocation of a high-risk ‘Credential Access’ operation detected (Preview)”. I haven’t tested what either one fires on.

Deploying the rules

Clone the repo, take the six files from Detection Rules/Cloud/Azure, and convert them with sigma-cli. For Sentinel or Log Analytics the Kusto backend fits best, but its azure_monitor pipeline is marked alpha and, per its README, maps fields only for SecurityEvent and SigninLogs. So pass a small custom pipeline that sets the table to AzureActivity and renames the fields. I checked that this pipeline loads and renames the fields with pySigma’s built-in test backend; I haven’t run it through the Kusto backend itself:

# azureactivity_pipeline.yml
name: AzureActivity table for azure/activitylogs rules
priority: 1
transformations:
- id: azureactivity_table
  type: set_state
  key: "query_table"
  val: ["AzureActivity"]
  rule_conditions:
  - type: logsource
    product: azure
    service: activitylogs
- id: azureactivity_fields
  type: field_name_mapping
  mapping:
    operationName: OperationNameValue
    resourceId: _ResourceId
  rule_conditions:
  - type: logsource
    product: azure
    service: activitylogs

# then
python -m pip install sigma-cli pysigma-backend-kusto
sigma check "Detection Rules/Cloud/Azure"
sigma convert -t kusto -p azure_monitor -p azureactivity_pipeline.yml azure_app_service_publishing_profile_retrieved.yml

The pipeline doesn’t map properties.requestbody, which in AzureActivity sits inside the Properties column, so adjust the basic auth policy rule by hand. For Splunk or Elastic you’ll map the fields yourself: operationName is the Event Hub schema name, and your add-on or integration may rename it. With no pipeline at all, sigma-cli needs --without-pipeline (for example sigma convert -t splunk --without-pipeline <file>) and keeps the field names as written. The AppServiceAuditLogs rule uses Log Analytics column names, so expect to remap it anywhere else. Not every backend converts Sigma correlations yet; where yours doesn’t, use the KQL join above. Run everything in alert-only mode for a week, baseline your pipeline identities, and only then page anyone. All six passed my structural validator (6 of 6 files, no errors or warnings) and sigma check (0 errors, 0 issues) on November 25, 2026. I haven’t converted them with a production backend or run them against a live workspace.

My take

Honestly, CVE-2026-58630 is barely detectable from where a customer sits, and I’d distrust anyone selling a “CVE-2026-58630 detection”. What you can detect is the playbook that follows any App Service takeover, and that playbook is well documented now. If I could turn on only one thing it would be the publishing profile rule, with a per-app caller baseline. It’s cheap, the telemetry is confirmed, and it sits on the exact step Storm-2949 relied on.

The better answer is to make the rules boring. Disable basic auth everywhere, and the profile becomes useless and the login rule goes quiet. Then the policy-change rule becomes your tripwire. I’d also like Microsoft to log App Service publishing logins by default rather than behind a per-app diagnostic setting. A platform that issues 10.0 cloud CVEs with “no customer action” should at least make sure customers have the logs to check that claim against their own tenants.

Sources

CVE-2026-58630: A CVSS 10 Azure App Service Flaw With Nothing to Patch

CVE-2026-58630: A CVSS 10 Azure App Service Flaw With Nothing to Patch

On July 23, 2026, Microsoft published a perfect 10.0 for Azure App Service. Network attack, no credentials, no user interaction, scope changed. Then, in the same advisory, it told every customer there was nothing to do. CVE-2026-58630 is the rare critical bug that you can’t patch, can’t scan for and, four months later, probably can’t fully investigate either.

That last part is why I’m writing about it now. Microsoft says the flaw is fully mitigated on its side. I believe that. But “mitigated” describes the platform after the fix, not your tenant before it, and the default Azure log retention windows have quietly rolled past July 23. If you want to know whether anything touched your apps before the fix, the clock has mostly run out unless you exported logs.

Severity: critical on paper, no known exploitation, zero patch work. The real work is a log question.

At a glance

  • CVE: CVE-2026-58630, CWE-284 (improper access control), elevation of privilege.
  • CVSS 3.1: 10.0 from Microsoft (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N, temporal 8.7). NVD’s own score is 9.8 (S:U, A:H).
  • Product: advisory title says “Azure App Service on Azure Stack Hub”; the CVE record and NVD list “Azure App Service for Linux”, version “-“.
  • Exploitation: Microsoft says not exploited and not publicly disclosed. CISA’s SSVC entry says exploitation none, automatable yes, technical impact total. Not in CISA’s KEV catalog (checked against catalog version 2026.11.25).
  • Fix: mitigated server-side by Microsoft. Customer action required: no.
  • Who should care: anyone running production workloads on App Service (especially Linux plans) who wants to rule out pre-fix abuse, and Azure Stack Hub operators confused by the title.

What we actually know

Very little, and I want to be precise about it. The MSRC entry went live on July 23, 2026 as part of the July 2026 release, revision 1. The full description is one sentence: improper access control in Azure App Service allows an unauthorized attacker to elevate privileges over a network. The FAQ adds that the issue “has already been fully mitigated by Microsoft” and that users have nothing to do. No researcher is credited.

NVD published the CVE on July 24, finished its analysis, and last modified the entry on October 24. The CVE record itself was updated again on November 19, 2026, without any new technical detail that I could find. Both carry the exclusively-hosted-service tag, which is Microsoft’s marker for “this lives only in our cloud, you don’t patch it”.

What nobody has published, as of November 25, 2026: the affected component, the attack surface (front end, Kudu, worker isolation, something else), when the bug was introduced, when the mitigation actually rolled out, and whether any tenant was notified. If you read a write-up that explains the mechanism, ask where it came from. The secondary coverage I checked, including the Safeguard.sh post from October 18, says plainly that the MSRC page could not be read, so it couldn’t describe the mechanism either. Some pages get the fix wrong: the IONIX threat center entry from July 24 tells readers to “Apply the security update published by Microsoft” and recommends immediate patching. There is no update to apply.

How it works, and why I can’t tell you

I won’t invent a mechanism. CWE-284 is the broadest access control bucket there is: “the system didn’t check whether you were allowed to do this”. What the vector does tell us is the shape of the problem.

PR:N and UI:N mean no account and no victim click. AC:L means no special conditions. C:H and I:H with A:N means reading and changing things, not knocking them over. The interesting part is S:C, scope changed. In CVSS terms that means the vulnerable component and the impacted component sit under different security authorities. On a multi-tenant platform, that is the kind of score you’d expect for a bug that crosses a boundary Microsoft relies on, such as from one app or sandbox into something it shouldn’t reach. I’m careful here: Microsoft has not said tenant-to-tenant, and S:C can also describe a jump from an app into the platform layer.

NVD disagreed. NIST scored it S:U with availability high, landing at 9.8. Two scorers, same one-line description, different reading of the blast radius. That tells me NIST didn’t have more information than the rest of us.

Then there is the name. The advisory title says Azure App Service on Azure Stack Hub, which is the version that customers run themselves on their own Stack Hub hardware. The affected-product field says Azure App Service for Linux, the public multi-tenant service. The MITRE record even uses a generic azure_app_service CPE while NVD uses azure_app_service_for_linux. A cloud-only tag plus “no customer action” fits the public service much better than a product you install and upgrade yourself. My read is that the title is the outlier, but that’s an inference, not something Microsoft has confirmed.

Timeline from Microsoft's June 2024 cloud CVE policy through the July 23, 2026 advisory, NVD publication and analysis, the Azure Stack Hub 26R1 release, the November 19 CVE record update, and the point where the 90-day activity log window passed the advisory date.
CVE-2026-58630 disclosure timeline. The start of the vulnerable window and the mitigation rollout date are not public.

Who is affected and how badly

Going forward, nobody. The open question is backward-looking: was it exploited before the fix, and did anyone notice? Microsoft says no exploitation, which is a statement about what Microsoft observed. It’s the best signal available and I’d weight it, but platform-level abuse may not leave traces in the logs a tenant can see.

For Azure Stack Hub operators I checked the App Service on Azure Stack Hub 26R1 release notes (build 102.20.2.2, announced September 28, 2026). They list runtime, Kudu and OS updates and two fixed issues, and they don’t mention CVE-2026-58630 or any CVE. I found no Stack Hub update tied to this bug. Combined with customerActionRequired set to false, I would not treat this as a Stack Hub patch item. If you run Stack Hub and want certainty, open a support case and ask directly; the title alone justifies the question.

My risk rating for a typical tenant: low residual risk, high uncertainty. Worth an hour of checking what your logs can still show.

The log retention problem

Here is the uncomfortable math. Azure keeps activity log events for 90 days and then deletes them. Counting back 90 days from November 25, 2026 lands on August 27, 2026, five weeks after the advisory. Entra sign-in and audit logs are kept for 7 days on Free and 30 days on P1/P2. App Service resource logs, like AppServiceAuditLogs, are not collected at all unless you set up a diagnostic setting.

So if you never exported anything, the portal can’t show you July. If you send logs to a Log Analytics workspace, Sentinel or a third-party SIEM with longer retention, you can still look. That’s the split that decides what you do next.

Bar chart comparing default Azure log retention as of November 25, 2026: activity log 90 days back to August 27, Entra sign-ins 30 days on P1/P2 and 7 days on Free, App Service resource logs not collected by default, all ending after the July 23 advisory date.
With default retention, none of the native Azure logs still cover the period before July 23, 2026.

What to do now

  1. Don’t open a patch ticket. There’s nothing to deploy. If a scanner or vendor feed flags this CVE against an asset, close it with a reference to the MSRC FAQ.
  2. Check retention first. Find out whether AzureActivity, AppServiceAuditLogs and the Entra sign-in tables reach back before the July 23, 2026 advisory in your workspace. If they don’t, write that down and move to hardening.
  3. If they do, run the hunt in the detection section below for the period before the July 23, 2026 advisory, starting as far back as your data allows. The queries end at July 24 so that time zone offsets don’t cut off the last hours of July 23. Nobody knows when the bug was introduced.
  4. Turn off basic auth publishing credentials. Set basicPublishingCredentialsPolicies/ftp and /scm to allow=false per Microsoft’s guide, and assign the built-in Azure Policy audit and remediation definitions. Long-lived username/password deploy creds are exactly what you’d want to steal after any access control bug.
  5. Rotate what an App Service app holds if you can’t rule things out: publishing profiles, connection strings and secrets in app settings, Functions host keys. Move secrets to Key Vault references and managed identity where you haven’t already.
  6. Fix the retention gap for next time. Export the activity log and Entra logs to a workspace or storage with at least a year of retention, and enable AppServiceAuditLogs on production apps. The next cloud CVE with no customer action will ask the same question.

Detection and monitoring

There are no IOCs for this CVE. Microsoft published none, and I won’t make any up. So nothing below detects the bug itself. What you can catch is what anyone does with elevated access to an App Service app: pull its deployment credentials and secrets, log in with them, and change the app’s config so access survives. That lives in two places: the Azure Activity log (control plane, collected by default but kept for 90 days) and AppServiceAuditLogs (FTP, Web Deploy and Kudu logins, a resource log that Microsoft says isn’t collected until you add a diagnostic setting).

I wrote six Sigma rules for that, all hunting and hardening rules rather than exploit signatures:

RuleCategoryLog sourceATT&CKLevel
Publishing profile retrievedCloud-AzureActivity logT1552Medium
Publishing login with basic credentialsCloud-AzureAppServiceAuditLogsT1078.004Low (hunting)
Profile retrieved, then basic login on the same app within an hour (correlation)Cloud-AzureActivity log + AppServiceAuditLogsT1552, T1078.004High
Basic auth publishing policy changed (not to disabled)Cloud-AzureActivity logT1556Medium
Source control or site extension changedCloud-AzureActivity logT1505Medium
Sensitive settings or Functions keys listedCloud-AzureActivity logT1552Low (hunting)

The one I’d turn on first is the publishing profile rule. A call to publishxml/action returns the app’s publishing profile, which Microsoft says often contains basic-auth credentials for FTP, Web Deploy and Kudu. Microsoft documented Storm-2949 using it in May 2026 to compromise App Service apps. Stratus Red Team’s sample event confirms the operation shows up in the Activity log, and Stratus notes it is logged even when basic auth is disabled. Alert on any caller, then baseline who legitimately downloads profiles per app.

title: Azure App Service Publishing Profile Retrieved
id: 1619694c-4499-4da8-b517-04386221afcb
name: azure_app_service_publishxml
status: test
description: |
    Detects retrieval of an App Service or slot publishing profile through the Azure management plane. Microsoft says the
    profile often contains basic-auth credentials for FTP, Web Deploy and Kudu; Storm-2949 used this action to compromise
    App Service apps. Hunting and hardening rule, not an exploit signature for CVE-2026-58630 (no IOCs are public).
references:
    - https://github.com/DataDog/stratus-red-team/blob/main/docs/attack-techniques/azure/azure.credential-access.app-service-publishing-credentials.md
    - https://www.microsoft.com/en-us/security/blog/2026/05/18/storm-2949-turned-compromised-identity-into-cloud-wide-breach/
    - https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/web-and-mobile
    - https://netsec101.com/?p=502
author: netsec101.com
date: 2026-11-25
tags:
    - attack.credential-access
    - attack.t1552
logsource:
    product: azure
    service: activitylogs
detection:
    selection:
        operationName:
            - 'MICROSOFT.WEB/SITES/PUBLISHXML/ACTION'
            - 'MICROSOFT.WEB/SITES/SLOTS/PUBLISHXML/ACTION'
    condition: selection
falsepositives:
    - Developers clicking "Download publish profile" in the portal, or Visual Studio and older pipeline tasks that import a profile
    - Infrastructure-as-code or backup tooling that exports profiles; baseline callers per app and alert on a new caller or IP
level: medium

For the retro-hunt, run the same conditions over everything your workspace holds before July 24, 2026, and sort by caller and IP so the rare ones float up. Keep expectations honest: a clean result means nothing suspicious reached your tenant-visible logs. It doesn’t prove the platform bug was never used against you, because the Activity log typically does not capture read operations and isn’t an authentication audit log. Going forward, keep the rules on as standing detections; “basic auth re-enabled” and “profile pulled, then used within the hour” are worth an alert in any tenant, CVE or not. There are no IOCs to age out here, only retention to extend.

I wrote up all six rules, with the KQL retro-hunt, tuning notes, lab tests and ATT&CK gaps, in a separate detection post. The YAML lives in my Detection Rules repo.

My take

I’m glad this CVE exists. Since June 2024 Microsoft has committed to “issue CVEs for critical cloud service vulnerabilities, regardless of whether customers need to install a patch.” My guess is that before that policy, a fix like this would most likely have gone out without a CVE, since no customer had anything to install.

But a CVE with one sentence of description, a contradictory product name and two different CVSS vectors is transparency in format more than in substance. It tells you a 10.0 existed in a service you depend on and gives you nothing to judge your own exposure: no component, no rollout date, no exposure window. Customers need the window more than anything else. “Fixed before publication” without a “vulnerable since” leaves defenders guessing how far back to hunt.

The real lesson is about us, not Microsoft. Cloud CVEs with no customer action are going to keep arriving, and the only thing they ever ask of you is a look backward. Ninety days of activity log and thirty days of sign-ins can’t answer that. If your retention is still on defaults, fixing that is the one action this CVE actually gives you, and I’d do it this week. I’d also ask Microsoft, through your account team, for the exposure window. They’re the only ones who know it.

Sources

Detecting Upload2Shell: 5 Sigma rules for Ghostscript shells and disguised uploads

Detecting Upload2Shell: 5 Sigma rules for Ghostscript shells and disguised uploads

Upload2Shell has no IOCs. No IP addresses, no hashes, no file names you can grep for. pwn.ai published a proof of concept on November 21, 2026 that turns a disguised PostScript file into commands running as www-data or lp, and the only artefacts it mentions are what its own proofs left behind: a marker file in /var/tmp on the print server and a PHP file on the WordPress test, with no path given. If you want to know whether someone tried this on your servers, you have to watch behaviour.

The good news is that the behaviour is unusually clean. Ghostscript is a document renderer, and a renderer that starts a shell or opens a network socket has stopped rendering. This post is the detection companion to my analysis of the bug: five Sigma rules, what each one catches, how to tune it and how to test it without an exploit.

At a glance

  • Rules: 5 (two high, two medium, one low hunting rule), all status: experimental.
  • Domains: Linux (four rules) and Network (one rule).
  • Log sources: Linux process creation, network connection and file creation (Sysmon for Linux, auditd or EDR), plus the Zeek HTTP log.
  • ATT&CK: T1059.004 Unix Shell, T1190 Exploit Public-Facing Application, T1105 Ingress Tool Transfer, T1036.008 Masquerade File Type.
  • CVEs: CVE-2026-125396 (Ghostscript), CVE-2026-65640 (WordPress upload path).
  • YAML: my Detection Rules repo on GitHub, folders Linux and Network.

The case in brief

An attacker uploads a file named like an image or a PDF that actually contains PostScript. It might come through a WordPress upload field, as a Roundcube attachment or as an anonymous IPP print job to a shared CUPS queue. ImageMagick and Pillow pick a decoder by content, libvips reaches Ghostscript through its magickload (ImageMagick) loader, and on the IPP path CUPS hands the job to Ghostscript through its gstopdf filter. Either way, the file lands in Ghostscript. The use-after-free in the Type 1 font loader switches off -dSAFER, and the document’s code runs as whichever account called Ghostscript. pwn.ai saw uid=33(www-data) for web apps and Roundcube, uid=7(lp) for CUPS, roundcube_sysuser on Plesk and uid 1000 inside a Mayan EDMS container. The full story is in the analysis.

That gives three places to look: the upload on the wire, the process tree on the host, and whatever the payload does next (a connection, a dropped file). pwn.ai describes no attacker post-exploitation beyond its proof artefacts, so everything past “a command runs” is my inference about what an attacker would do with a shell. That is why every rule here is experimental.

Detection map

Block diagram: Linux process creation, network connection and file creation logs plus the Zeek HTTP log feed five Sigma rules (PostScript upload posing as image or PDF, gs spawns shell or tool, renderer or CUPS filter child, gs network connection, temp-dir drops) mapped to T1190, T1036.008, T1059.004 and T1105, with print jobs, mail attachments and in-memory payloads marked as a gap.
Four log sources, five rules. Print and mail delivery and in-memory payloads stay outside Sigma.

Read it left to right. Host telemetry carries most of the weight: three of the four sources are Sysmon for Linux event types (or their auditd and EDR equivalents), and none of them is on by default on a typical web or print server. The Zeek rule is the only one that fires before any code runs, but it needs to see uploads in cleartext, which means a sensor behind your TLS terminator. The dashed box is what nothing here covers well: print jobs, mail attachments and payloads that never leave the Ghostscript process.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Ghostscript spawning shell, interpreter or download toolLinuxlinux / process_creationExecution / T1059.004, Initial Access / T1190HighExperimental
Image converter, PHP or CUPS filter spawning suspicious child as service accountLinuxlinux / process_creationExecution / T1059.004, C2 / T1105MediumExperimental
Outbound network connection initiated by GhostscriptLinuxlinux / network_connectionC2 / T1105HighExperimental
Ghostscript or service account writing to temp directoriesLinuxlinux / file_eventC2 / T1105Low (hunting)Experimental
PostScript upload disguised as an image or PDFNetworkzeek / httpInitial Access / T1190, Defense Evasion / T1036.008MediumExperimental

The rules

Ghostscript spawning shell, interpreter or download tool

Context: this is the moment of compromise. Once -dSAFER is off, the obvious next move for a document is to open a pipe to a command, and Ghostscript does that by starting sh. SnapAttack’s 2024 write-up on CVE-2024-29510 showed exactly this tree (gs starting dash), and Splunk’s ESCU “Linux Ghostscript Exploitation” analytic alerts on gs parents with sh -c children. My rule uses the same idea with a broader child list. I wrote it independently and didn’t copy their search.

Condition: alert when the parent image is gs, gsc or ghostscript and the child is a shell, Python, Perl, Ruby, PHP, curl, wget, netcat, socat, telnet or openssl. Exclude it only if the gs command line itself carries a %pipe% output. The direction is what makes this work: callers starting gs is routine (ImageMagick’s delegates.xml defines its Ghostscript delegate as a shell-quoted command line), but gs starting a shell is not normal.

ATT&CK: Execution (TA0002) – T1059.004 Unix Shell; Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Ghostscript Spawning Shell, Interpreter or Download Tool - Potential -dSAFER Escape
id: 9a8d85d9-4f81-45f2-906b-1bf101ade773
status: experimental
description: |
    Detects a Ghostscript process (gs, gsc, ghostscript) starting a shell, script interpreter or network/download tool.
    A -dSAFER escape such as CVE-2026-125396 (Upload2Shell) ends with the interpreter running commands as the service
    account that called it (www-data, lp). Direction matters: callers starting gs is normal (ImageMagick runs it as a delegate command line), gs starting a shell is not.
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://research.splunk.com/endpoint/580f99d8-a4c8-4ef1-9c84-f355867bca41/
    - https://github.com/ImageMagick/ImageMagick/blob/main/config/delegates.xml.in
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.execution
    - attack.t1059.004
    - attack.initial-access
    - attack.t1190
    - cve.2026-125396
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent:
        ParentImage|endswith:
            - '/gs'
            - '/gsc'
            - '/ghostscript'
    selection_child_name:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
            - '/zsh'
            - '/ksh'
            - '/busybox'
            - '/perl'
            - '/ruby'
            - '/php'
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/telnet'
            - '/openssl'
    selection_child_python:
        Image|re: '/python[0-9.]*$'
    filter_optional_pipe_output:
        # Print setups that put an output pipe on the gs command line itself (for example -sOutputFile=%pipe%lpr)
        ParentCommandLine|contains:
            - '-sOutputFile=%pipe%'
            - '-sOutputFile=|'
    condition: selection_parent and 1 of selection_child_* and not 1 of filter_optional_*
falsepositives:
    - Print or conversion setups that pipe Ghostscript output to another command (the %pipe% device runs it through sh); keep the optional filter only where the pipe is on the gs command line, not in the document
    - Desktop or batch workflows that script Ghostscript with %pipe% output
level: high

View on GitHub

False positives and tuning: the real false positives come from Ghostscript’s %pipe% output device, which some print setups use to send output to lpr. That pipe runs through sh, so you get gs, then sh, then lpr. The optional filter drops those, but only when the pipe sits on the gs command line, where the caller put it. A malicious document opens its pipe from inside the PostScript, so the parent command line stays clean and the alert still fires. Don’t widen the filter to match on the child command line. On desktops, scripted gs workflows can trip it too. Scope to servers if that’s noisy.

How to test: on a lab box, run gs -dNOSAFER -dNODISPLAY -dBATCH -c "(%pipe%id) (w) file closefile". That turns off the sandbox on purpose and asks gs to pipe to id, which should log gs starting sh without any exploit. Don’t expect a tidy gs, sh, id chain: dash often execs a single command in place, so id may show up with gs as its parent instead of sh. The rule fires on the sh event either way.

Image converter, PHP or CUPS filter spawning a suspicious child as a service account

Context: rule one depends on a process actually named gs. That isn’t always the case. ImageMagick can be built against libgs and run Ghostscript inside its own process, Pillow and libvips sit inside Python or PHP workers, and a bundled copy in a container may carry another name. This rule looks one level up, at the processes that hand files to Ghostscript, and only when they run as the accounts pwn.ai saw: www-data, lp and roundcube_sysuser, plus the usual apache, nginx and http.

Condition: the parent is ImageMagick (convert, magick, mogrify, identify, montage), vips, Apache, PHP or PHP-FPM, Python, or anything under a CUPS filter directory. The user is one of the service accounts. The child is either a download or network tool, or a shell whose command line fetches something, opens /dev/tcp, decodes base64 or touches /dev/shm. Shells that carry -sDEVICE= are excluded: every Ghostscript delegate command in ImageMagick’s delegates.xml sets an output device, so a shell with that flag is a delegate call, not a payload. CUPS parents are handled separately and only match download or network tools.

ATT&CK: Execution (TA0002) – T1059.004 Unix Shell; Command and Control (TA0011) – T1105 Ingress Tool Transfer; Initial Access (TA0001) – T1190.

title: Image Converter, PHP or CUPS Filter Spawning Download Tool or Suspicious Shell as Service Account
id: 82a7bb2c-e41d-4241-8367-913ab6251b2a
status: experimental
description: |
    Detects ImageMagick, libvips, PHP, Python, web server or CUPS filter processes running as a web or print service account
    that start a download or network tool, or a shell whose command line fetches or opens a connection. Catches the Upload2Shell
    chain one level up, including builds where Ghostscript runs in-process (libgs). Inferred from the pwn.ai process context, not from incident data.
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://www.patchstack.com/articles/when-a-png-isnt-a-png-wordpress-patches-an-author-level-imagick-rce/
    - https://github.com/ImageMagick/ImageMagick/blob/main/config/delegates.xml.in
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.execution
    - attack.t1059.004
    - attack.command-and-control
    - attack.t1105
    - attack.initial-access
    - attack.t1190
    - cve.2026-125396
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent_web_name:
        ParentImage|endswith:
            - '/convert'
            - '/magick'
            - '/mogrify'
            - '/identify'
            - '/montage'
            - '/vips'
            - '/apache2'
            - '/httpd'
    selection_parent_web_versioned:
        ParentImage|re: '/(php-fpm[0-9.]*|php[0-9.]*|python[0-9.]*)$'
    selection_parent_cups:
        ParentImage|contains: '/cups/filter/'
    selection_user:
        User:
            - 'www-data'
            - 'apache'
            - 'nginx'
            - 'http'
            - 'lp'
            - 'roundcube_sysuser'
    selection_child_tool:
        Image|endswith:
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/telnet'
            - '/busybox'
    selection_child_shell:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
        CommandLine|contains:
            - 'curl '
            - 'wget '
            - '/dev/tcp/'
            - '/dev/udp/'
            - 'nc '
            - 'ncat '
            - 'socat '
            - 'base64 -d'
            - '/dev/shm/'
    filter_main_gs_delegate:
        # ImageMagick's gs delegate commands (delegates.xml) set -sDEVICE=; a shell carrying that is a delegate call, not a payload
        CommandLine|contains: '-sDEVICE='
    # CUPS filters are often shell scripts, so CUPS parents only match download/network tools, never shells
    condition: ((1 of selection_parent_web_* and 1 of selection_child_*) or (selection_parent_cups and selection_child_tool)) and selection_user and not filter_main_gs_delegate
falsepositives:
    - PHP or Python applications that legitimately shell out to curl or wget (update checkers, webhooks); exclude by full command line after a baseline
    - CUPS backends or custom filters that fetch resources over the network
    - Service accounts named differently on your distribution; extend the user list rather than removing it
level: medium

View on GitHub

False positives and tuning: this is the noisiest of the process rules, because PHP and Python apps do call curl, for update checks and webhooks. Baseline for a week and exclude by full command line, not by parent. The CUPS branch only matches download and network tools, never shells, because many CUPS filters are shell scripts and their ordinary children would drown you. If your distribution names its web user differently, add the name to the list. Don’t delete the user clause, or this turns into a generic web shell rule that fires all day.

How to test: sudo -u www-data php -r 'system("curl -s http://127.0.0.1/");' produces php, then sh with a curl command line, under the right user.

Outbound network connection initiated by Ghostscript

Context: a payload that lives inside the gs process, such as a reverse connection built from the memory primitive rather than a child shell, gets past both process rules. A renderer has no business opening sockets, so any connection from gs is worth a look. pwn.ai published no network indicators. This rule is pure inference from the bug class.

Condition: alert when gs, gsc or ghostscript initiates a connection to anything other than loopback.

ATT&CK: Command and Control (TA0011) – T1105 Ingress Tool Transfer.

title: Outbound Network Connection Initiated by Ghostscript
id: c8efc9fe-8344-4263-a90a-a5093c46df3c
status: experimental
description: |
    Detects a Ghostscript process (gs, gsc, ghostscript) initiating a network connection to a non-loopback address. A renderer
    that converts or thumbnails documents has no reason to talk to the network, so a connection suggests the interpreter is
    running attacker code after a -dSAFER escape such as CVE-2026-125396. Inferred from the bug class; pwn.ai published no network indicators.
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.command-and-control
    - attack.t1105
    - cve.2026-125396
logsource:
    product: linux
    category: network_connection
detection:
    selection:
        Image|endswith:
            - '/gs'
            - '/gsc'
            - '/ghostscript'
        Initiated: 'true'
    filter_main_loopback:
        DestinationIp|cidr:
            - '127.0.0.0/8'
            - '::1/128'
    condition: selection and not filter_main_loopback
falsepositives:
    - Print servers where Ghostscript itself writes to a network printer socket configured on its command line; confirm which printer ports your print path uses and scope out those hosts and ports
level: high

View on GitHub

False positives and tuning: on most web hosts I’d expect it to stay silent. On print servers, check whether gs ever writes straight to a printer socket before you page anyone, and exclude those hosts and printer ports if it does. Which ports that means depends on your print path, so check rather than assume. Sysmon for Linux only logs network connections if your config includes event 3, so check that first.

How to test: a benign gs run seldom opens a socket itself (in the rule one test, the connection would come from the child). The easiest check is to replay a synthetic Sysmon event 3 with Image set to /usr/bin/gs into your SIEM and confirm the converted query matches.

Ghostscript or service account writing to temp directories

Context: the one concrete artefact pwn.ai mentions is a marker file its proof wrote under /var/tmp on the Debian print server (/var/tmp/GS_CUPS_PIPE_RCE). That name only tells you the proof ran, so I treat it as a lab artefact, not an indicator. The broader pattern is worth hunting, though: attackers who land as www-data or lp tend to stage things in world-writable temp directories.

Condition: match any of three things. First, gs writes into /var/tmp, /dev/shm or a /tmp file that isn’t one of its own scratch files or an ImageMagick temp file. I assumed the prefixes gs_ and magick- for those; check what your builds actually write before you trust the filter. Second, a web or print service account creates a script, shared object or binary-looking file in any of the three directories. Third, the PoC marker file shows up.

ATT&CK: Command and Control (TA0011) – T1105 Ingress Tool Transfer.

title: Ghostscript or Web/Print Service Account Writing Scripts or Unexpected Files to Temp Directories
id: fce501fb-70ab-4899-b2a0-1634140ed9cd
status: experimental
description: |
    Hunts for Ghostscript writing files in /var/tmp or /dev/shm, or outside its own scratch files in /tmp, and for web or print
    service accounts dropping scripts or binaries into /tmp, /var/tmp or /dev/shm. The pwn.ai proof wrote a marker file under
    /var/tmp on the Debian print server; that exact name is included as a lab and PoC artefact, not an in-the-wild indicator.
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.command-and-control
    - attack.t1105
    - cve.2026-125396
    - detection.threat-hunting
logsource:
    product: linux
    category: file_event
detection:
    selection_gs_image:
        Image|endswith:
            - '/gs'
            - '/gsc'
            - '/ghostscript'
    selection_gs_path:
        TargetFilename|startswith:
            - '/tmp/'
            - '/var/tmp/'
            - '/dev/shm/'
    filter_gs_scratch:
        # Assumed prefixes, verify on your hosts: gs scratch files gs_, ImageMagick temp files magick-
        TargetFilename|startswith:
            - '/tmp/gs_'
            - '/tmp/magick-'
    selection_svc_user:
        User:
            - 'www-data'
            - 'apache'
            - 'nginx'
            - 'http'
            - 'lp'
            - 'roundcube_sysuser'
    selection_svc_path:
        TargetFilename|startswith:
            - '/tmp/'
            - '/var/tmp/'
            - '/dev/shm/'
    selection_svc_ext:
        TargetFilename|endswith:
            - '.sh'
            - '.py'
            - '.pl'
            - '.php'
            - '.elf'
            - '.so'
            - '.bin'
    selection_poc_marker:
        TargetFilename: '/var/tmp/GS_CUPS_PIPE_RCE'
    condition: (selection_gs_image and selection_gs_path and not filter_gs_scratch) or (selection_svc_user and selection_svc_path and selection_svc_ext) or selection_poc_marker
falsepositives:
    - Applications that point Ghostscript's TMPDIR or -sOutputFile into /var/tmp or /dev/shm; add that prefix to the filter
    - PHP applications that cache compiled templates or plugin files as .php under /tmp
    - Package or plugin installers running as www-data
level: low

View on GitHub

False positives and tuning: it’s a hunting rule at level: low for a reason. PHP apps cache templates as .php under /tmp, plugin installers run as www-data, and some apps point gs’s TMPDIR at /var/tmp. Review it weekly, add the prefixes your apps legitimately use, and don’t alert on it. Note that the User field depends on your Sysmon for Linux version and field mapping. With auditd you’ll match on uid instead.

How to test: sudo -u lp touch /var/tmp/test.sh.

PostScript upload disguised as an image or PDF

Context: this is the delivery trick, and the only rule that fires before any code runs. Patchstack’s analysis of the WordPress fix (CVE-2026-65640) shows the gap: WordPress picked the editor by file extension, while ImageMagick read the magic bytes. A file named .png or .jpg that starts with %!PS is almost never innocent on an upload form.

Condition: an HTTP POST or PUT whose request body Zeek identifies as application/postscript, with an uploaded file name ending in an image or PDF extension. Zeek records both in http.log as orig_mime_types and orig_filenames.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application; Defense Evasion (TA0005) – T1036.008 Masquerade File Type.

title: HTTP Upload of PostScript Content With an Image or PDF File Name - Upload2Shell Delivery
id: 7bd3de21-4aff-4be3-b42d-2244ebbee66c
status: experimental
description: |
    Detects an HTTP upload whose body Zeek's content sniffing identifies as PostScript (it starts with %!PS) while the uploaded
    file name ends in an image or PDF extension. This is the Upload2Shell delivery trick: ImageMagick and Pillow pick a decoder
    by content, so a .jpg, .png or .pdf full of PostScript reaches Ghostscript. Needs cleartext HTTP visibility (after TLS termination).
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.patchstack.com/articles/when-a-png-isnt-a-png-wordpress-patches-an-author-level-imagick-rce/
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.initial-access
    - attack.t1190
    - attack.defense-evasion
    - attack.t1036.008
    - cve.2026-125396
    - cve.2026-65640
    - detection.emerging-threats
logsource:
    product: zeek
    service: http
detection:
    selection_method:
        method:
            - 'POST'
            - 'PUT'
    selection_mime:
        orig_mime_types|contains: 'application/postscript'
    selection_name:
        orig_filenames|endswith:
            - '.jpg'
            - '.jpeg'
            - '.png'
            - '.gif'
            - '.bmp'
            - '.tif'
            - '.tiff'
            - '.webp'
            - '.pdf'
    condition: all of selection_*
falsepositives:
    - Print, prepress or design portals where users upload EPS artwork under the wrong extension; scope to upload endpoints of apps that never accept PostScript
    - Zeek only fills orig_filenames when the multipart part carries a file name; drop selection_name for a broader, noisier hunt
level: medium

View on GitHub

False positives and tuning: design and prepress portals do get EPS artwork with the wrong extension, so scope the rule to upload endpoints of apps that never accept PostScript. Both fields are arrays in Zeek, so check how your backend handles contains and endswith on lists. The bigger limit is visibility: Zeek must see the request after TLS termination, so a sensor on the internet side of your load balancer sees nothing useful.

How to test: upload any benign EPS file renamed to test.jpg to a lab application behind your Zeek sensor.

Coverage and gaps

Step in the caseTacticTechniqueRuleCovered?
Disguised PostScript uploaded over HTTPInitial Access, Defense EvasionT1190, T1036.008PostScript upload disguised as image or PDFYes, with cleartext Zeek visibility
Anonymous IPP print job to shared CUPS queueInitial AccessT1190NoneGap: no content check in CUPS logs (my understanding, verify)
Disguised attachment in Roundcube or mail importInitial AccessT1190NoneGap: mail path not covered
gs escapes -dSAFER and runs a commandExecutionT1059.004Ghostscript spawning shell or toolYes
In-process libgs or renamed gs runs a commandExecutionT1059.004Renderer or CUPS filter childPartial: needs a suspicious child
Tool download or reverse connectionCommand and ControlT1105Ghostscript outbound connection, renderer childYes
Files staged in temp directoriesCommand and ControlT1105Temp-dir writes (hunting)Hunting only
PHP file written by the WordPress proofPersistenceT1505.003NoneGap: path not published
Payload that stays inside gs memoryn/an/aNoneGap

The two delivery paths I can’t cover in Sigma are print and mail. For CUPS, the practical control is configuration, not detection: require authentication on shared queues and watch /var/log/cups/access_log for Print-Job requests from hosts that never print. That’s a manual hunt: as far as I know, the access log tells you who printed, not what the file was, so check your own CUPS logs before relying on that. For mail, a gateway or Zeek files.log with MIME sniffing on SMTP can apply the same “PostScript posing as an image” logic. The WordPress proof wrote a PHP file, but pwn.ai doesn’t say where, so file integrity monitoring on the web root is the honest answer there. A payload that never leaves the gs process needs syscall-level telemetry (eBPF tools such as Falco or Tetragon) or, better, a seccomp or AppArmor profile that stops gs from calling execve or connect at all.

Deploying the rules

Grab the YAML from GitHub and convert it with sigma-cli. The Linux rules use Sysmon for Linux field names (Image, ParentImage, CommandLine, User), so either your data already uses those names or you add a small custom pipeline that maps them to auditd, ECS or your EDR schema. Converting without a pipeline, as below, keeps the Sysmon names. The Zeek rule uses native Zeek field names.

sigma convert -t splunk --without-pipeline proc_creation_lnx_ghostscript_spawns_shell_or_tool.yml
sigma convert -t lucene --without-pipeline net_connection_lnx_ghostscript_outbound_connection.yml
sigma convert -t lucene -p ecs_zeek_beats zeek_http_upload_postscript_disguised_as_image_or_pdf.yml

Check the converted queries by hand, especially the |re modifiers and the array fields, because backends treat both differently. Run every rule in alert-only mode for a week before it pages anyone, and use the lab tests above to prove each one fires in your SIEM rather than just compiles.

My take

This is one of the more detectable bugs I’ve written rules for, as long as you have process telemetry on the boxes that render files. That’s the catch. Thumbnailing workers, print servers and webmail hosts are exactly the machines that tend to get no EDR and no Sysmon, because nobody thinks of them as exposed. If you only do one thing, put process-creation logging on those hosts and turn on the gs-spawns-shell rule. It’s cheap, it’s quiet, and it will catch the next -dSAFER escape too, not just this one.

I’d also argue the best “detection” here is prevention that leaves a log. A seccomp or AppArmor profile that stops gs from executing anything turns a successful exploit into a denied syscall in the audit log, and that’s a better alert than any of my five rules. Ghostscript distributions could ship such a profile by default. Until they do, the process tree is your best bet.

Sources

Upload2Shell: how a Ghostscript font bug turns upload boxes and printers into RCE

Upload2Shell: how a Ghostscript font bug turns upload boxes and printers into RCE

Someone sends a print job to a shared printer on a Debian 13 box. Nobody logs in, nobody clicks anything, and a command runs on the print server as the lp user. Swap the printer for a Roundcube inbox or a WordPress contact form with a file field and you get the same result as www-data. That is the core of Upload2Shell, the research Paulos Yibelo of pwn.ai published on November 21, 2026.

The bug itself, CVE-2026-125396, is a use-after-free in Ghostscript’s Type 1 font loader that lets a crafted document switch off the -dSAFER sandbox. The interesting part is not the memory bug. It is how many applications quietly hand an uploaded “JPG” or “PDF” to Ghostscript without anyone deciding they should. I rate this high: a public proof of concept exists, the fix (Ghostscript 10.08.0) has been out since September 8, 2026, and as of November 23 nobody has reported exploitation in the wild.

At a glance

  • CVE: CVE-2026-125396 (Ghostscript), plus CVE-2026-65640 for the WordPress core upload path.
  • CVSS: 8.5 under CVSS 4.0 and 7.8 under CVSS 3.1 in the CVE record (CNA VulnCheck), both with a local attack vector. WordPress scored its own fix 8.8. I could not retrieve an NVD assessment.
  • Affected: upstream Ghostscript before 10.08.0, including copies bundled into containers and application bundles.
  • Exploitation: public PoC from pwn.ai, replicated by iTnews. No in-the-wild exploitation reported as of November 23, 2026.
  • Fix: Ghostscript 10.08.0 or your distribution’s backport; WordPress 7.0.4, 6.9.7 and older-branch releases for CVE-2026-65640.
  • Who should care: anyone running a service that thumbnails, previews, converts or prints files from untrusted people. That is more of you than it sounds.

What we know

The CVE record, published November 9, 2026 by VulnCheck, describes the flaw plainly: a font helper called .putgstringcopy in gs_fonts.ps calls the privileged .forceput operator without checking what it was handed. A crafted PostScript or PDF file can trigger a type error, grab .forceput back through its own error handler, and cause a use-after-free across save/restore that leads to code execution. Ken Sharp is credited with the fix, which landed in Ghostscript 10.08.0 on September 8, 2026.

The disclosure history is messier than usual. WordPress shipped its mitigation on August 12, 2026, nearly a month before the Ghostscript release. Debian fixed trixie on September 25 (DSA-6516-1), and Ubuntu’s USN-8949-1 on October 21 covered a “font operand validation” issue with no CVE attached. According to iTnews, pwn.ai only requested a CVE on November 6, almost two months after the fix shipped. On oss-security, Jan Schaumann argued the bug should be treated as public from September 8 and said the coordination “leaves much to be desired.” I agree with him.

One date needs clearing up. CyberSecurityNews wrote that the research came out on November 17. The pwn.ai page itself, its timeline and iTnews all point to November 21, when Yibelo announced on X that the exploit would be released. I’m going with November 21.

Timeline of six dates: WordPress fix August 12, Ghostscript 10.08.0 September 8, Debian DSA September 25, Ubuntu USN October 21, CVE published November 9, and the pwn.ai write-up on November 21, 2026 with the PoC released that weekend
The fix shipped in September; the CVE arrived in November. Dates from pwn.ai, the CVE record and iTnews.

How it works

Ghostscript is a PostScript interpreter, and PostScript is a full programming language. -dSAFER is the sandbox that stops a document from opening files or running commands. Internally, Ghostscript’s own startup code still needs to do privileged things, so it has operators like .forceput that ignore access protections. The whole security model rests on those operators never being reachable from document code.

Per pwn.ai, the font helper needed that privileged store. If its copy step fails, a document’s error handler can catch the error and recover the operator. With it, the attacker gets a global object to keep a pointer into local memory, which a later restore frees. That dangling reference becomes native memory control, and from there the researchers changed the renderer’s sandbox state in memory, effectively switching -dSAFER off. I’m not going further than that; the mechanism is enough to understand the fix.

If this sounds familiar, it should. CVE-2018-16509 (Ghostscript before 9.24) abused failed restore handling to run commands. CVE-2019-14811 (before 9.50) was a privileged call left unprotected in .pdf_hook_DSC_Creator. iTnews notes that Tavis Ormandy found a related bug in the same font file in 2018. This is the same bug class coming back: privileged PostScript procedures that leak to user code via error handling. According to iTnews, Artifex is trying to remove the privileged internal operation that enables this class, which is the right answer.

The delivery chain is the real story

Ghostscript doesn’t listen on a port, which is why the CVE says “local.” The remote part comes from libraries that pick a decoder by file content, not file name. ImageMagick and Pillow both look at the magic bytes, so a file called invoice.jpg that actually contains PostScript gets routed to Ghostscript. Patchstack’s write-up of the WordPress fix shows exactly this: WP_Image_Editor_Imagick::load() trusted the extension, ImageMagick trusted the content, and a “.png” full of PostScript reached the interpreter.

Four-step chain: disguised PostScript file arrives, ImageMagick or Pillow route it to Ghostscript by content (print jobs via the gstopdf filter), font loader use-after-free disables -dSAFER, command runs as www-data or lp
How an ordinary upload, email or print job reaches Ghostscript. Based on the pwn.ai write-up and Patchstack.

The pwn.ai write-up lists the paths it confirmed:

  • CUPS on Debian 13: an unauthenticated IPP Print-Job to a shared network queue reached Ghostscript through the gstopdf filter, running as uid=7(lp).
  • Roundcube (1.7.2 per CyberSecurityNews): viewing an email with a disguised attachment triggered an ImageMagick thumbnail. The sender needed no account. This one depended on a permissive ImageMagick delegate policy.
  • WordPress core: Author-level users with upload_files. Forminator and Essential Addons for Elementor exposed the same path to signed-out visitors through public upload fields in the tested configurations.
  • MediaWiki with PdfHandler and anonymous uploads, DokuWiki with ImageMagick, Mayan EDMS email import, ResourceSpace, Plesk’s Roundcube and Paperless-ngx, which calls Ghostscript directly for PDF/A conversion.
  • Libraries that reached Ghostscript: Pillow’s EPS decoder, ImageMagick’s PostScript delegate, libvips via magickload, Qt KImageFormats and Matplotlib’s EPS path. PHP GD, OpenCV, Sharp, Jimp, Java ImageIO and Go’s decoders did not in their tests.

pwn.ai also named Google (closed November 10) and Dropbox, but says those were separate findings with different root causes, so don’t count them as CVE-2026-125396 victims.

Who is affected and how badly

The CVSS vector understates network exposure and overstates the blast radius at the same time. Understates, because “local” here means “any file that reaches the renderer,” and plenty of renderers sit behind anonymous upload fields. Overstates, because code runs as the service account (www-data, lp), not root, and many paths need a specific config: a shared CUPS queue, a permissive ImageMagick policy, a plugin with a public upload field.

The part that worries me is patch visibility. Distros backport without bumping the version: Debian 13’s fixed build is still 10.05.1 (10.05.1~dfsg-1+deb13u2). As of pwn.ai’s November 12 snapshot, Debian 12, Amazon Linux 2/2023, SUSE Linux Enterprise and openSUSE Leap 16.x were still open, and RHEL-family status was not established. Debian’s tracker now lists a bookworm fix in 10.0.0~dfsg-11+deb12u9 via DLA-4914-1, so check again before you decide. And none of that helps the old Ghostscript baked into a container image built in August. As CyberSecurityNews put it, “Updating the host does not replace Ghostscript inside an existing container or application bundle.”

What to do now

  1. Find every Ghostscript, not just the system package. Check dpkg -l 'ghostscript*' 'libgs*' or rpm -q ghostscript on hosts, then scan container images and app bundles with your SBOM tool for gs binaries and libgs.so. Compare against the distro advisory, not the upstream version string.
  2. Patch to Ghostscript 10.08.0 or the backport: Debian trixie 10.05.1~dfsg-1+deb13u2 or later, Ubuntu per USN-8949-1 (for example 10.02.1~dfsg1-0ubuntu7.10 on 24.04 and 9.55.0~dfsg1-0ubuntu5.15 on 22.04). Rebuild images; don’t just patch the host.
  3. Update WordPress to 7.0.4 or the branch fix (6.9.7 and backports to every branch down to 4.7.35). Then audit plugins with public upload fields that feed the Media Library.
  4. Require authentication on shared CUPS queues and restrict who can reach port 631. An anonymous print queue on a routable network is an anonymous code execution queue today.
  5. Turn off PostScript in image pipelines that never need it. In ImageMagick’s policy.xml, deny the PostScript-family coders and the gs delegate (example below). The pwn.ai write-up doesn’t name policy.xml; this is my own standard hardening. In Pillow, pass an explicit allow-list via Image.open(fp, formats=[...]) so EPS is never tried.
  6. Check real file types before generating previews, and if patching has to wait, disable automatic previews of untrusted files. Run renderers in a sandbox (seccomp, AppArmor, a separate container with no egress) so a compromised interpreter cannot start a shell, which is what pwn.ai recommends.
<!-- ImageMagick policy.xml: block PostScript-family input -->
<policy domain="coder" rights="none" pattern="{PS,PS2,PS3,EPS,EPSI,EPSF,PDF,XPS}" />
<policy domain="delegate" rights="none" pattern="gs" />

Drop PDF from that list only if you really need PDF thumbnails, and then patch first. Verify with magick -list policy (or convert -list policy on ImageMagick 6), since distros ship their policy files in different places.

Detection and monitoring

No IOCs have been published, and pwn.ai offers no signatures. Its only artefacts are what its own proofs left behind: a marker file under /var/tmp on the print server and a PHP file on the WordPress test (no path given). So this is behaviour detection, best done on the host, where Ghostscript starts doing things a renderer never does. That needs process telemetry (Sysmon for Linux, auditd execve or an EDR), usually off by default on web and print servers. A network sensor that sees uploads in cleartext can flag delivery too.

RuleCategoryLog sourceATT&CKLevel
Ghostscript spawning shell, interpreter or download toolLinux, generic TTPprocess_creationT1059.004, T1190High
Image converter, PHP or CUPS filter spawning suspicious child as service accountLinux, generic TTPprocess_creationT1059.004, T1105Medium
Outbound network connection initiated by GhostscriptLinux, generic TTPnetwork_connectionT1105High
Ghostscript or service account writing to temp directoriesLinux, huntingfile_eventT1105Low
PostScript upload disguised as an image or PDFNetwork, emerging threatZeek httpT1190, T1036.008Medium

The rule I’d turn on first is the simplest: alert when gs, gsc or ghostscript starts a shell, a script interpreter or a download tool. Callers starting gs is routine (ImageMagick runs it as a delegate command line); gs starting a shell is not. The one legitimate exception I know of is a print setup that puts a %pipe% output on the gs command line, which the optional filter covers. Splunk’s ESCU “Linux Ghostscript Exploitation” analytic uses the same idea.

title: Ghostscript Spawning Shell, Interpreter or Download Tool - Potential -dSAFER Escape
id: 9a8d85d9-4f81-45f2-906b-1bf101ade773
status: experimental
description: |
    Detects a Ghostscript process (gs, gsc, ghostscript) starting a shell, script interpreter or network/download tool.
    A -dSAFER escape such as CVE-2026-125396 (Upload2Shell) ends with the interpreter running commands as the service
    account that called it (www-data, lp). Direction matters: callers starting gs is normal (ImageMagick runs it as a delegate command line), gs starting a shell is not.
references:
    - https://pwn.ai/upload2shell/research.html
    - https://www.cve.org/CVERecord?id=CVE-2026-125396
    - https://research.splunk.com/endpoint/580f99d8-a4c8-4ef1-9c84-f355867bca41/
    - https://github.com/ImageMagick/ImageMagick/blob/main/config/delegates.xml.in
    - https://netsec101.com/?p=476
author: netsec101.com
date: 2026-11-23
tags:
    - attack.execution
    - attack.t1059.004
    - attack.initial-access
    - attack.t1190
    - cve.2026-125396
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent:
        ParentImage|endswith:
            - '/gs'
            - '/gsc'
            - '/ghostscript'
    selection_child_name:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
            - '/zsh'
            - '/ksh'
            - '/busybox'
            - '/perl'
            - '/ruby'
            - '/php'
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/telnet'
            - '/openssl'
    selection_child_python:
        Image|re: '/python[0-9.]*$'
    filter_optional_pipe_output:
        # Print setups that put an output pipe on the gs command line itself (for example -sOutputFile=%pipe%lpr)
        ParentCommandLine|contains:
            - '-sOutputFile=%pipe%'
            - '-sOutputFile=|'
    condition: selection_parent and 1 of selection_child_* and not 1 of filter_optional_*
falsepositives:
    - Print or conversion setups that pipe Ghostscript output to another command (the %pipe% device runs it through sh); keep the optional filter only where the pipe is on the gs command line, not in the document
    - Desktop or batch workflows that script Ghostscript with %pipe% output
level: high

After you patch, keep these rules running. The next -dSAFER escape will produce the same process tree, and old Ghostscript copies inside container images will outlive the host patches. Retro-hunt your process data back to at least September 8, 2026, when the fix and its diff became public. With no IOCs, there is nothing to age out; the PoC marker file only flags someone’s lab test.

I wrote up all five rules, with tuning notes, lab tests and ATT&CK coverage, in a separate detection post. The YAML lives in my Detection Rules repo, under Linux and Network.

My take

I think the memory bug is the least interesting thing here. Ghostscript -dSAFER escapes are a recurring genre, and this one follows the same pattern as 2018 and 2019. What Upload2Shell shows well is that “we validate uploads” usually means “we check the extension and MIME type,” and then the file goes to a library that ignores both. Yibelo told iTnews that “Almost every application we tested with file uploads could be tricked” into that hand-off. I believe it, and it means your upload-security review needs to follow the file past storage into every thumbnailer, indexer and converter.

I’m also unhappy with the disclosure. A fix in September, a CVE in November, a teaser in between and a PoC that landed alongside the press coverage gives attackers a clean diff and defenders no CVE to scan for during the window that mattered. Scanners keyed on CVE IDs couldn’t flag this until November 9.

What I’d do first: inventory Ghostscript inside containers, lock down any anonymous CUPS queue, and push the policy.xml change everywhere ImageMagick runs, patched or not. The next .forceput bug is probably already sitting in someone’s fuzzing corpus, and that policy line keeps working when it shows up.

Sources