Detection queries Vulnerability reportAgents & MCP

Claude Agent SDK session-ID MCP code execution (CVE-2026-96620)

Untrusted session IDs starting with '-' were parsed as CLI flags, letting attackers load an MCP server that runs outside SDK permission controls. CVSS 9.2.

What happened

SDK passed untrusted resume session ID to Claude CLI. IDs starting with '-' become CLI flags, enabling --mcp-config with a stdio MCP server that launches at startup outside SDK permission controls. CVSS 9.2.

Read the original source

How it happened

Select a stage to explore its defenses
Detect this stage
Detect this stage
Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Application accepts a session ID

    An application passes an untrusted resume identifier into the SDK.

    Hunt: An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.

    Requires application instrumentation and a custom field mapping. Input exposure does not prove that the model followed instructions, executed a tool or bypassed approval. Avoid collecting sensitive prompt bodies unless authorized.

    Source for step 1
  2. 02 · Identifier becomes a CLI flag

    A leading hyphen causes the supplied value to be interpreted as command-line options.

    Hunt: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

    A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

    Source for step 2
  3. 03 · MCP configuration is injected

    The argument selects a stdio MCP server configuration.

    Hunt: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

    A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

    Source for step 3
  4. 04 · Server launches outside controls

    The MCP startup command executes outside the SDK permission boundary.

    Hunt: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.

    Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.

    Source for step 4

Why it matters

Reported entry point: Application must pass untrusted user-controlled session ID into resume. Reported impact: The MCP startup command executes outside the SDK permission boundary; reported targets include Apps that let users pick/restore agent sessions.

Check these source-linked conditions against your setup.

Claude Agent SDK

The reported session-ID parsing flaw affects the Claude Agent SDK.

Conditions to check
  • Confirm that the installed version is affected by the historical report; selecting a product does not establish its version or patch status.
  • The application must pass attacker-influenced session IDs into the affected CLI invocation.

Source-linked applicability guidance. Confirm current scope in the original report.

Read the original report

What you can do

Protection & prevention

Start here

Update the affected SDK and validate session identifiers before forwarding them to a CLI.

Upgrade SDK; validate CLI argv; treat attacker-touchable MCP config as code execution; app control on unexpected MCP-launched binaries

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance LOLSkills
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Application accepts a session IDUntrusted content enters an agent sessionCustom schema · Draft

An application passes an untrusted resume identifier into the SDK.

What to look for

An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.

Capture resume/session identifiers at the application boundary and correlate with later session handling; do not treat every resume request as malicious.

Visibility: Application / agent audit records

Required logs

  • Input provenance, source type and request/session identifier
  • Captured tool responses or retrieved content where collection is approved
  • Subsequent tool calls, configuration changes and approval decisions

Coverage limit. Requires application instrumentation and a custom field mapping. Input exposure does not prove that the model followed instructions, executed a tool or bypassed approval. Avoid collecting sensitive prompt bodies unless authorized.

Custom-schema candidate for input exposure only. Map agent.input.ingest and agent.session.resume to your application request and session logs. CorrelationId must link subsequent actions. EventType values are proposed normalization names, not native vendor events.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Untrusted content enters an agent session
id: 2d89d7ae-9d44-4dc6-a95b-f9c8de7b8352
status: experimental
description: An agent ingests external content or an untrusted session
  identifier before a tool action or configuration change outside the approved
  task.
author: MagicSword OpenAttacks catalog
date: 2026-11-04
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.input.ingest
      - agent.session.resume
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.input.ingest", "agent.session.resume")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.input.ingest", "agent.session.resume")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join the ingested input to later actions by session or request ID; preserve the original content as evidence.
  2. Compare the resulting action with the approved task and baseline. Receiving suspicious text alone is not successful injection.
02Identifier becomes a CLI flagAgent trust / configuration changesCustom schema · Draft

A leading hyphen causes the supplied value to be interpreted as command-line options.

What to look for

A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

Visibility: Defender-side logs where collected

Required logs

  • File changes and before/after content for MCP / IDE configuration
  • Repository audit / pull-request history
  • Agent startup and tool-invocation logs

Coverage limit. A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Agent trust / configuration changes
id: 2dfc8034-d66b-42a7-a699-a76b2ef872ac
status: experimental
description: A repository, dependency or agent changes MCP commands,
  automatic-task settings, tool approval or model-routing configuration before
  new execution.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.config.write
      - agent.approval.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.config.write", "agent.approval.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.config.write", "agent.approval.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
  2. Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
03MCP configuration is injectedAgent trust / configuration changesCustom schema · Draft

The argument selects a stdio MCP server configuration.

What to look for

A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.

Visibility: Defender-side logs where collected

Required logs

  • File changes and before/after content for MCP / IDE configuration
  • Repository audit / pull-request history
  • Agent startup and tool-invocation logs

Coverage limit. A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Agent trust / configuration changes
id: 2dfc8034-d66b-42a7-a699-a76b2ef872ac
status: experimental
description: A repository, dependency or agent changes MCP commands,
  automatic-task settings, tool approval or model-routing configuration before
  new execution.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.config.write
      - agent.approval.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.config.write", "agent.approval.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.config.write", "agent.approval.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
  2. Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
04Server launches outside controlsUnexpected agent tool useCustom schema · Draft

The MCP startup command executes outside the SDK permission boundary.

What to look for

Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.

Visibility: Defender-side logs where collected

Required logs

  • Agent tool-call audit records with session / tool / destination
  • Tool-definition and approval changes
  • Endpoint process, file-access and network evidence where available

Coverage limit. Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Unexpected agent tool use
id: c709e384-0e11-479e-ab4d-3a06e2431e4b
status: experimental
description: Untrusted content or a changed tool definition precedes a file
  read, command, or remote call outside the user's intended task.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - agent.tool.call
      - agent.tool.definition.change
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("agent.tool.call", "agent.tool.definition.change")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("agent.tool.call", "agent.tool.definition.change")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
  2. Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
Agent / MCP as target
Initial access
Application must pass untrusted user-controlled session ID into resume

Tooling as reported

AI products, models and artifacts

Targets and reported impact

Targets / sectors
Apps that let users pick/restore agent sessions
Reported scale / exposure
Fixed in 0.2.121 on 2026-07-17; advisory public 2026-10-16

Reported attribution

Vulnerability (not a named campaign)

Structured attribution

Actor
Vulnerability (not a named campaign)

Detection rules

  • Review attack-specific indicatorsGUIDANCE

    Monitor for the techniques described in Claude Agent SDK session-ID MCP RCE (CVE-2026-96620). Refer to sources for specific IOCs and TTPs.

Source defensive notes

Upgrade SDK; validate CLI argv; treat attacker-touchable MCP config as code execution; app control on unexpected MCP-launched binaries

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0081Modify AI Agent Configuration

Attacker-controlled CLI arguments inject an MCP startup configuration. Source

Sources & research credit

1 source

Research by moamenmahmood (HackerOne) · Anthropic (advisory) / HackerOne reporter

  1. github.com
Record & downloads
Source record name
Claude Agent SDK session-ID MCP RCE (CVE-2026-96620)
Entry ID
claude-agent-sdk-cve-2026-96620
Catalog review
October 20, 2026
Category
attacks-on-ai
AI involvement confidence
confirmed