# CVE-2026-139934: Azure API Management Classic tiers, incorrect authorization (detection pack 1.0.0)

Slot: `azure-apim-classic-cve-2026-139934-pack-v1`. Built 4 Dec 2026 by CybaVerse threat hunt. Sources were read on
4 Dec 2026 between about 20:29 and 21:10 GMT (Europe/London).

Research is credited to security researchers only. The CVE record and the Microsoft entry name no finder.

## Summary

| CVE | Product | Score (vendor) | Weakness | Status |
|---|---|---|---|---|
| CVE-2026-139934 | Azure API Management (APIM), Classic Developer, Basic, Standard and Premium tiers | Microsoft CVSS 3.1 base 9.8 Critical, temporal 9.1 | CWE-863 Incorrect Authorization | Exploited, CISA KEV 4 Dec 2026 |

- Title (Microsoft and CVE.org): Azure API Management Elevation of Privilege Vulnerability. CISA KEV name: Microsoft
  Azure API Management Incorrect Authorization Vulnerability.
- Vector (Microsoft): `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C`.
- Exploitation: Microsoft Security Update Guide: Exploited Yes, Exploitation Detected. CISA KEV: added 4 Dec 2026
  (catalogue 2026.12.04, released 18:49 GMT, 1814 entries), due 7 Dec 2026. Known ransomware campaign use: Unknown.
  KEV forensic triage: Yes. CISA SSVC (CVE.org ADP): Exploitation active, Automatable yes, Technical Impact total.
- Affected: Microsoft says customers using Classic Developer, Basic, Standard or Premium should act, and that
  "Azure API Management v2 and Consumption tiers are not affected."
- Fix: Microsoft remediated the platform issue on 19 Nov 2026. There is no downloadable update. Microsoft's platform
  fix does not invalidate exposed credentials: Microsoft says "that remediation does not invalidate previously exposed credentials".
- Action: read the Azure Service Health notifications for Tracking ID MZK9-GH0 (21 Nov 2026, and the 24 Nov 2026
  update) for exposure criteria. For exposed instances, rotate credentials and secrets stored in APIM, rotate Key
  Vault secrets that APIM references, and investigate activity on the systems those secrets reach. Secrets already
  rotated after the first or second notification do not need rotating again.
- KEV due dates bind US federal agencies only (BOD 26-04). Act now regardless.
- The KQL in this pack has NOT been run against a live tenant.

## What is in the pack

| Path | What it is |
|---|---|
| `scripts/check-azure-apim-classic-cve-2026-139934.sh` | Offline checker (bash, needs jq, iconv and awk) |
| `scripts/Check-AzureApimClassicCve2026139934.ps1` | Offline checker (PowerShell 7), byte-for-byte same output and exit codes |
| `kql/azure-apim-classic-cve-2026-139934-hunting.kql` | 16 hunts (Sentinel or Log Analytics), all OUR PATTERN |
| `sigma/*.yml` | 5 Sigma rules for `product: azure, service: activitylogs`, all OUR PATTERN |
| `sigma/converted/` | Kusto conversions for five pySigma pipelines (failures recorded) |
| `tests/` | Cases, fixtures (FIXTURE_ONLY), Pester parity, gates, negative gates, schemas from Microsoft Learn |

## Offline checker

The checkers read only JSON files that you export yourself. They make no network calls, run no az or Az commands and
write nothing. They print instance names, SKUs and named value names only. They never print named value values, keys,
connection strings or Key Vault secret identifiers, and they hide any name that is not plain letters, digits, dot,
underscore or hyphen. File names that look like secrets or key files are refused, so do not put `secret` or
`password` in the export file name.

```
bash scripts/check-azure-apim-classic-cve-2026-139934.sh --apim apim.json --named-values apim-named-values.json
pwsh -File scripts/Check-AzureApimClassicCve2026139934.ps1 --apim apim.json --named-values apim-named-values.json
```

Tier verdicts:

| SKU in the export | Verdict |
|---|---|
| Developer, Basic, Standard, Premium (Classic) | IN_SCOPE |
| BasicV2, StandardV2, PremiumV2, Consumption | NOT_AFFECTED |
| Isolated, unknown, missing or numeric | REVIEW |

Exit codes:

| Exit | Meaning |
|---|---|
| 0 | not affected: only v2 or Consumption tiers in the export |
| 2 | Classic tier in scope: check Service Health MZK9-GH0 for exposure and rotate |
| 3 | review: Isolated, unknown tier, no instances, or only named values given |
| 5 | usage or read error (missing file, refused name, not strict JSON, UTF-16, larger than 10 MB) |

Accepted input: an array (`az apim list`), one object (`az apim show`), a REST list with a `value` array, or an ARM
template export with a `resources` array (only `Microsoft.ApiManagement/service` and
`Microsoft.ApiManagement/service/namedValues` resources are read). Input must be strict UTF-8 JSON with nesting no
deeper than 64 and no characters outside the Basic Multilingual Plane, so both checkers accept exactly the same files.

### Export commands you run yourself (text only, not run by this pack)

Azure CLI (adapted from the Microsoft rotation guide, which uses `--output table`; `--output json` is a global az
option):

```
az login
az apim list --subscription {subscriptionId} --output json > apim.json
az apim show --name {apimName} --resource-group {rg} --output json > apim-one.json
az apim nv list --resource-group {rg} --service-name {apimName} --output json > apim-named-values.json
```

Azure PowerShell (PowerShell 7.4 or later and current Az modules, as the Microsoft guide states). The `Sku` property
is turned into text so the checker can read it (OUR PATTERN):

```
Connect-AzAccount
Get-AzApiManagement | Select-Object Name, ResourceGroupName, @{ Name = 'Sku'; Expression = { [string]$_.Sku } } | ConvertTo-Json -Depth 3 | Set-Content -Path apim.json -Encoding utf8
$apimContext = New-AzApiManagementContext -ResourceId $apimResourceId
Get-AzApiManagementNamedValue -Context $apimContext | Select-Object NamedValueId, Name, Secret, @{ Name = 'KeyVaultBacked'; Expression = { [bool]$_.KeyVault.SecretIdentifier } } | ConvertTo-Json | Set-Content -Path apim-named-values.json -Encoding utf8
```

The PowerShell named value export above leaves out values. `az apim nv list` output can hold the values of plain
named values; the checker counts them, never prints them, and tells you to protect or delete the file.

## Manual checks (no payloads)

1. List every APIM instance and its tier (portal: API Management services, or the export above). Classic Developer,
   Basic, Standard and Premium are in scope.
2. Open Service Health, Security advisories, Tracking ID MZK9-GH0, and the Impacted Resources tab. Viewing impacted
   resources needs a role such as Service Health Security reader, Subscription Owner or Contributor (subscription
   level) or Security Admin (tenant level). Microsoft Learn also documents the
   `https://management.azure.com/subscriptions/{subscriptionId}/providers/microsoft.resourcehealth/events/MZK9-GH0/listSecurityAdvisoryImpactedResources?api-version=2025-05-01`
   endpoint for authorised users.
3. For each exposed instance, rotate in the Microsoft order: create the replacement at the issuer, update API
   Management, test, then revoke the old secret. The Microsoft guide notes that "Updating the value in API Management"
   does not revoke the old credential at its issuer.
4. Rotate: subscription keys, named values holding secrets, Key Vault secrets that named values reference (then
   refresh the named value), backend credentials, OAuth 2.0 and OpenID Connect client secrets, developer portal
   identity provider secrets, Credential Manager providers, logger connection strings (for example Event Hubs),
   credentials written into policies, and the legacy management access keys.
5. Run the KQL below over the period before and after 19 Nov 2026 and review every result.

## Hunting (KQL and Sigma)

All hunts and rules are OUR PATTERN: review lists, not proof of exploitation. Microsoft has published no exploit
request shape, indicators or log strings, and this pack invents none. Table and column names come from the Microsoft
Learn table reference pages; API Management operation names come from the Microsoft Learn permissions list.

- Q1, Q2, Q16: AzureActivity secret-listing actions (for example `subscriptions/listSecrets/action`,
  `namedValues/listValue/action`, `tenant/listSecrets/action`) and configuration writes by unexpected callers.
- Q3, Q4: first-seen caller IP and a per-day inventory of APIM management operations.
- Q5: Service Health events in AzureActivity that mention MZK9-GH0.
- Q6, Q7: ApiManagementGatewayLogs, subscription keys used from new or many caller IPs.
- Q8: legacy AzureDiagnostics GatewayLogs volume.
- Q9, Q10, Q11: Key Vault SecretGet (AzureDiagnostics AuditEvent and AZKVAuditLogs) for APIM-referenced secrets by
  other identities, and by the APIM managed identity from new IPs.
- Q12, Q13, Q14, Q15: AADServicePrincipalSignInLogs, AADManagedIdentitySignInLogs and SigninLogs follow-on use of
  rotated secrets.

Activity log limits from Microsoft Learn: the activity log "doesn't typically capture read operations", and
"Requests rejected during authentication or authorization before the operation starts aren't recorded". The Sigma
rules use the Sigma `operationName` field; in AzureActivity this is `OperationNameValue` (Q1, Q2 cover it).
Only the no-pipeline Kusto conversion succeeds. The four Microsoft pySigma pipelines have no table mapping for
`product: azure, service: activitylogs`, so `sigma/converted/` records those as CONVERSION FAILED; use Q1, Q2 and Q16.

## Unverified

- UNVERIFIED: the exposure criteria. They are only in the Service Health notification for MZK9-GH0, which is not public.
- UNVERIFIED: whether exploitation activity appears in AzureActivity, ApiManagementGatewayLogs or AzureDiagnostics.
- UNVERIFIED: the AzureDiagnostics `ResourceProvider` value and `CallerIPAddress` population for API Management
  GatewayLogs (Q8). The Learn API Management monitoring reference lists the GatewayLogs category for both tables.
- UNVERIFIED: the layout of the AZKVAuditLogs `Identity` blob (Q10 matches it as text) and whether
  `identity_claim_appid_g` holds the managed identity client ID (Q9, Q11).
- UNVERIFIED: whether the MZK9-GH0 security advisory is written to AzureActivity as a ServiceHealth event (Q5).
- UNVERIFIED: the tier status of Isolated. The ARM SKU list includes Isolated; Microsoft names neither it as affected
  nor as unaffected, so the checker reports REVIEW.
- UNVERIFIED: how `ConvertTo-Json` writes the `Sku` property of `Get-AzApiManagement` without the text conversion
  above (it may be a number; the checker reports REVIEW for a number).
- UNVERIFIED: whether `az apim nv list` returns the values of secret named values.
- No indicators of compromise, attacker infrastructure or exploit request details have been published by Microsoft.

## Differences from the original flag

1. Everything in the flag checked out against primary sources (see Notes for the web page, item 1).
2. Added: the Microsoft temporal score 9.1 and full vector with `E:F/RL:O/RC:C`.
3. Added: KEV forensic triage Yes, and the KEV required action that points to BOD 26-04 and the CISA Forensics Triage
   Requirements.
4. Added: SSVC Technical Impact total.
5. Added: NVD status Analyzed, with the Microsoft score as a Secondary score.
6. Added: the Isolated tier exists in the ARM SKU list and is not named by Microsoft; the checker treats it as REVIEW.
7. KEV says an unauthenticated remote attacker; Microsoft says an unauthorized attacker. Quote each source as written.

## Notes for the web page

1. Verified, no change needed: CVSS 3.1 9.8 Critical (Microsoft), CWE-863, title Elevation of Privilege; Exploited
   Yes and Exploitation Detected; KEV added 4 Dec 2026, catalogue 2026.12.04 released 18:49 GMT with 1814 entries,
   due 7 Dec 2026; SSVC Exploitation active, Automatable yes; ransomware Unknown; Classic Developer, Basic, Standard
   and Premium affected, v2 and Consumption not affected; platform fix 19 Nov 2026 and no downloadable update;
   Tracking ID MZK9-GH0 on 21 Nov 2026 with the 24 Nov 2026 update; rotate APIM-stored and APIM-referenced Key Vault
   secrets; no re-rotation for secrets rotated after either notification; CVE datePublic 3 Dec 2026 16:00 UTC.
2. Add the temporal score: base 9.8, temporal 9.1, vector `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:F/RL:O/RC:C`.
3. Keep the two names apart: Microsoft and CVE.org use Azure API Management Elevation of Privilege Vulnerability; KEV
   uses Microsoft Azure API Management Incorrect Authorization Vulnerability.
4. Dates: Microsoft released the entry on 3 Dec 2026 at 08:00 Pacific (16:00 UTC, 16:00 GMT). The CVE.org record was
   published 3 Dec 2026 23:20 UTC; NVD published it 4 Dec 2026 00:19 UTC and marks it Analyzed.
5. Add that KEV marks forensic triage Yes and that KEV notes require rotating affected credentials and investigating
   unexpected activity.
6. Add SSVC Technical Impact total next to Exploitation active and Automatable yes.
7. Do not say every non-Classic tier is safe. Microsoft names v2 and Consumption only; Isolated is not mentioned.
8. Say that exposure criteria are in Service Health (MZK9-GH0) and that Microsoft has not published them elsewhere.
9. Microsoft's FAQ points to the 24 Nov 2026 notification for exposure criteria; the 21 Nov 2026 notification was first.
10. Keep the BOD 26-04 caveat: KEV due dates bind US federal agencies only. Act now regardless.
11. Keep the line that Microsoft's platform fix does not invalidate exposed credentials.
12. Credit security researchers only. Name no reporter, firm, team or programme.
13. Link no exploit code or third-party write-ups; there is no public request shape to show.
14. Say the KQL has not been run against a live tenant.
15. Quote attacker capability from Microsoft only: crafted requests over a network that could allow administrative
    operations, including secrets management, against Azure API Management services.

## Sources

- Microsoft Security Update Guide: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-139934
- Microsoft rotation guide (21 Nov 2026): https://techcommunity.microsoft.com/blog/integrationsonazureblog/rotating-credentials-in-azure-api-management/4575478
- Microsoft Learn, impacted resources for security advisories: https://learn.microsoft.com/en-us/azure/service-health/impacted-resources-security#viewing-impacted-resources-for-security-advisories-on-the-service-health-portal
- CVE.org: https://www.cve.org/CVERecord?id=CVE-2026-139934
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-139934
- CISA KEV: https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- BOD 26-04: https://www.cisa.gov/news-events/directives/bod-26-04-prioritizing-security-updates-based-risk
- CISA Forensics Triage Requirements: https://www.cisa.gov/news-events/directives/bod-26-04-implementation-guidance-prioritizing-security-updates-based-risk
- Microsoft Learn permissions (API Management operations): https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration
- Microsoft Learn ARM template (SKU names): https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/service
- Microsoft Learn v2 tiers: https://learn.microsoft.com/en-us/azure/api-management/v2-service-tiers-overview
- Microsoft Learn activity log: https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log
- Microsoft Learn activity log schema: https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log-schema
- Microsoft Learn API Management monitoring reference: https://learn.microsoft.com/en-us/azure/api-management/monitor-api-management-reference
- Microsoft Learn Key Vault monitoring: https://learn.microsoft.com/en-us/azure/key-vault/general/monitor-key-vault
- Microsoft Learn tables: https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azureactivity, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/apimanagementgatewaylogs, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azurediagnostics, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/azkvauditlogs, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aadserviceprincipalsigninlogs, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aadmanagedidentitysigninlogs, https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs
- Microsoft Learn standard columns: https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-standard-columns

## Tests

`bash tests/run_all.sh` runs shellcheck, PSScriptAnalyzer, the bash cases, Pester parity, static gates, the KQL parse
check, bwrap sandbox runs (no network, read-only filesystem), sigma check and conversions, and the negative gates.
`REGEN=1 bash tests/run_all.sh` rewrites `sigma/converted/` first.
