{
  "attack_id": "invariant-github-mcp-private-repo-2025-05",
  "status": "catalog_recommendations_not_validated_coverage",
  "stages": [
    {
      "node_id": "step-1",
      "profile": "agent-tools",
      "title": "Unexpected agent tool use",
      "hypothesis": "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",
      "telemetry": [
        "Agent tool-call audit records with session / tool / destination",
        "Tool-definition and approval changes",
        "Endpoint process, file-access and network evidence where available"
      ],
      "investigate": [
        "Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.",
        "Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector."
      ],
      "limitation": "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.",
      "queries": {
        "sigma": "title: Hunt - Unexpected agent tool use\nid: c709e384-0e11-479e-ab4d-3a06e2431e4b\nstatus: experimental\ndescription: Untrusted content or a changed tool definition precedes a file\n  read, command, or remote call outside the user's intended task.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - agent.tool.call\n      - agent.tool.definition.change\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"agent.tool.call\", \"agent.tool.definition.change\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"agent.tool.call\", \"agent.tool.definition.change\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "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.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/agent-tools.yaml",
      "query_downloads": {
        "sigma": "/api/detections/agent-tools.sigma.yml",
        "kql": "/api/detections/agent-tools.kql",
        "spl": "/api/detections/agent-tools.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://invariantlabs.ai/blog/mcp-github-vulnerability"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "step-2",
      "profile": "agent-input",
      "title": "Untrusted content enters an agent session",
      "hypothesis": "An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.",
      "visibility": "Application / agent audit records",
      "telemetry": [
        "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"
      ],
      "investigate": [
        "Join the ingested input to later actions by session or request ID; preserve the original content as evidence.",
        "Compare the resulting action with the approved task and baseline. Receiving suspicious text alone is not successful injection."
      ],
      "limitation": "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.",
      "note": "Preserve issue-result provenance and the agent session, then inspect later repository reads and public writes.",
      "queries": {
        "sigma": "title: Hunt - Untrusted content enters an agent session\nid: 2d89d7ae-9d44-4dc6-a95b-f9c8de7b8352\nstatus: experimental\ndescription: An agent ingests external content or an untrusted session\n  identifier before a tool action or configuration change outside the approved\n  task.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-11-04\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - agent.input.ingest\n      - agent.session.resume\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"agent.input.ingest\", \"agent.session.resume\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"agent.input.ingest\", \"agent.session.resume\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "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.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/agent-input.yaml",
      "query_downloads": {
        "sigma": "/api/detections/agent-input.sigma.yml",
        "kql": "/api/detections/agent-input.kql",
        "spl": "/api/detections/agent-input.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://invariantlabs.ai/blog/mcp-github-vulnerability"
      ],
      "reviewed": "2026-11-04",
      "upstream_matches": []
    },
    {
      "node_id": "step-3",
      "profile": "repository",
      "title": "Private access → public repository artifact",
      "hypothesis": "A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Git-provider organization / enterprise audit",
        "Repository and token permission inventory",
        "Agent tool and secret-scanning / DLP records"
      ],
      "investigate": [
        "Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.",
        "Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications."
      ],
      "limitation": "Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.",
      "queries": {
        "sigma": "title: Hunt - Private access → public repository artifact\nid: b7b2d3f0-8170-4225-accb-c20633364ef4\nstatus: experimental\ndescription: A token or agent reads private material and creates a public issue,\n  repository, commit or visibility change inconsistent with the approved task.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - repository.public.write\n      - repository.visibility.change\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"repository.public.write\", \"repository.visibility.change\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"repository.public.write\", \"repository.visibility.change\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "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.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/repository.yaml",
      "query_downloads": {
        "sigma": "/api/detections/repository.sigma.yml",
        "kql": "/api/detections/repository.kql",
        "spl": "/api/detections/repository.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://invariantlabs.ai/blog/mcp-github-vulnerability"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    },
    {
      "node_id": "step-4",
      "profile": "repository",
      "title": "Private access → public repository artifact",
      "hypothesis": "A token or agent reads private material and creates a public issue, repository, commit or visibility change inconsistent with the approved task.",
      "visibility": "Defender-side logs where collected",
      "telemetry": [
        "Git-provider organization / enterprise audit",
        "Repository and token permission inventory",
        "Agent tool and secret-scanning / DLP records"
      ],
      "investigate": [
        "Join access and public-write actions by actor / token and time; inspect visibility changes and newly created repositories.",
        "Verify whether the artifact contains sensitive data using approved scanning, retaining original source qualifications."
      ],
      "limitation": "Git-provider audit completeness depends on product and plan. Not every file read or issue body is present in organization audit logs.",
      "queries": {
        "sigma": "title: Hunt - Private access → public repository artifact\nid: b7b2d3f0-8170-4225-accb-c20633364ef4\nstatus: experimental\ndescription: A token or agent reads private material and creates a public issue,\n  repository, commit or visibility change inconsistent with the approved task.\nauthor: MagicSword OpenAttacks catalog\ndate: 2026-10-23\nfalsepositives:\n  - Authorized activity matching this broad hunt; baseline and investigate\n    before alerting.\nlevel: low\nlogsource:\n  category: application\n  product: openattacks_audit\n  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,\n    Target and CorrelationId from the required source logs first.\ndetection:\n  selection:\n    EventType:\n      - repository.public.write\n      - repository.visibility.change\n  condition: selection\n",
        "kql": "// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.\n// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).\n// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.\nOpenAttacksAudit_CL\n| where TimeGenerated > ago(7d)\n| where EventType in (\"repository.public.write\", \"repository.visibility.change\")\n| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId\n| order by TimeGenerated desc",
        "spl": "sourcetype=\"openattacks:audit\"\nEventType IN (\"repository.public.write\", \"repository.visibility.change\")\n| table _time EventType Actor Asset Action Target CorrelationId\n| sort - _time"
      },
      "query_scope": "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.",
      "query_kind": "custom_schema",
      "origin": "catalog_authored",
      "definition_url": "https://github.com/magicsword-io/openattacks/blob/main/detections/repository.yaml",
      "query_downloads": {
        "sigma": "/api/detections/repository.sigma.yml",
        "kql": "/api/detections/repository.kql",
        "spl": "/api/detections/repository.spl"
      },
      "validation": "draft",
      "evidence": [
        "https://invariantlabs.ai/blog/mcp-github-vulnerability"
      ],
      "reviewed": "2026-10-23",
      "upstream_matches": []
    }
  ],
  "attack_flow": {
    "nodes": [
      {
        "id": "step-1",
        "title": "Agent reads an attacker issue",
        "description": "A user asks an agent with GitHub MCP access to inspect public issues.",
        "kind": "access",
        "source_urls": [
          "https://invariantlabs.ai/blog/mcp-github-vulnerability"
        ]
      },
      {
        "id": "step-2",
        "title": "Issue instructions override the task",
        "description": "Indirect prompt injection redirects the model through untrusted issue content.",
        "kind": "ai",
        "source_urls": [
          "https://invariantlabs.ai/blog/mcp-github-vulnerability"
        ]
      },
      {
        "id": "step-3",
        "title": "Agent accesses private repositories",
        "description": "Broad tool permissions let the agent retrieve private data.",
        "kind": "execution",
        "source_urls": [
          "https://invariantlabs.ai/blog/mcp-github-vulnerability"
        ]
      },
      {
        "id": "step-4",
        "title": "Private content becomes public",
        "description": "The demonstrated chain leaks content through a public pull request or issue.",
        "kind": "impact",
        "source_urls": [
          "https://invariantlabs.ai/blog/mcp-github-vulnerability"
        ]
      }
    ],
    "edges": [
      {
        "source": "step-1",
        "target": "step-2"
      },
      {
        "source": "step-2",
        "target": "step-3"
      },
      {
        "source": "step-3",
        "target": "step-4"
      }
    ]
  }
}