SPECTER FORGERY

AI agent identity forgery & trust chain attack engine. Forge. Replay. Poison. Transmute. Nine subsystems.
9
Subsystems
7
Identity Types
8
Transmutation Paths
407
Tests Passing
pip install red-specter-specter-forgery
Documentation
Forge OIDC JWT tokens with real RS256 signing / JWKS root-of-trust poisoning via kid path traversal / RS256→HS256 algorithm confusion CVSS 9.3 / SPIFFE SVID forgery with X.509 SAN / A2A agent card skill injection / Cross-vendor identity transmutation across 8 paths / Confused deputy chain via OBO token reuse / Dead-man sentinel detects post-publication identity drift Forge OIDC JWT tokens with real RS256 signing / JWKS root-of-trust poisoning via kid path traversal / RS256→HS256 algorithm confusion CVSS 9.3 / SPIFFE SVID forgery with X.509 SAN / A2A agent card skill injection / Cross-vendor identity transmutation across 8 paths / Confused deputy chain via OBO token reuse / Dead-man sentinel detects post-publication identity drift

AI Agent Identity Is the New Perimeter

AI agents authenticate via OIDC tokens, SPIFFE SVIDs, A2A agent cards, and KYA attestations. These identity mechanisms were designed for human-accessible systems — not for autonomous agents making thousands of API calls per minute. SPECTER FORGERY operationalises every known identity attack against AI agent trust chains: forging credentials, poisoning JWKS roots of trust, exploiting algorithm confusion, and transmuting identities across vendor boundaries.

Algorithm Confusion Attacks

RS256→HS256 confusion exploits JWT libraries that verify using a symmetric HMAC secret equal to the RSA public key PEM. An attacker who obtains the public key can sign arbitrary tokens the server will accept. CVE-2025-68664 (CVSS 9.3) is representative of a class of vulnerabilities affecting dozens of production libraries.

JWKS Root-of-Trust Poisoning

JWKS endpoints determine which keys are trusted for token verification. Kid path traversal (../../etc/passwd), key injection, empty-key-set bypass, and algorithm confusion via the alg field can cause a verifier to accept forged tokens. Every AI platform using OIDC or JWT-based agent authentication is in scope.

SPIFFE SVID Forgery

SPIFFE Verifiable Identity Documents are X.509 certificates with a spiffe:// URI in the Subject Alternative Name extension. Forged SVIDs — with attacker-controlled workload identities and trust domains — allow lateral movement between microservices and AI agent clusters that rely on SPIFFE/SPIRE for mutual TLS authentication.

Confused Deputy via OBO Flows

On-Behalf-Of (OBO) token flows allow service A to act on behalf of a user calling service B. When AI agents chain OBO tokens across service boundaries, a confused deputy attack allows privilege escalation: low-privilege agent A obtains a token scoped for high-privilege service C without ever having been granted that scope directly.

Cross-Vendor Identity Transmutation

AI deployments routinely bridge identity systems: Azure Entra credentials passed to OpenAI, GCP service accounts crossing to Azure, Okta tokens consumed by Dify platforms. Each boundary is a transmutation opportunity. CVE-2026-44843 describes SVID cross-boundary attacks where workload identity from one trust domain is accepted as valid in another.

Post-Publication Identity Drift

A2A agent cards and KYA attestations are published once and assumed static. In practice, vendor updates silently change signing algorithms, key rotation schedules, and capability lists. SPECTER FORGERY's DRIFT subsystem detects these mutations — and the dead-man sentinel fires if the monitoring heartbeat is interrupted, indicating an active drift event.

The SPECTER FORGERY Engine

Nine subsystems cover the complete identity attack lifecycle — from surface enumeration through credential forgery, token replay, JWKS poisoning, confused deputy escalation, post-publication drift detection, and cross-vendor identity transmutation. DESTROY-tier gates enforce authorisation requirements for the most impactful operations.

# Subsystem Command Gate Description
01 SURVEY specter-forgery survey OPEN Enumerate AI identity surfaces: OIDC discovery endpoints, A2A agent cards (/.well-known/agent.json), SPIFFE SVID trust bundles, KYA attestation endpoints, JWKS endpoints. Classifies discovered identities into 7 types across 10 vendors. Prerequisite for all downstream subsystems.
02 MINT specter-forgery mint INJECT Credential forgery factory: OIDC JWT with real RS256/ES256/HS256 PyJWT signing, SPIFFE X.509 SVID with UniformResourceIdentifier SAN, KYA attestation JSON, A2A agent card, Entra service principal token. Generates cryptographically valid forged credentials against target identity types.
03 REPLAY specter-forgery replay INJECT Captured credential replay with six manipulation techniques: expiry bypass (inject future exp), signature strip (alg:none), scope creep (inject elevated scopes), OBO chain construction (On-Behalf-Of privilege escalation), cross-tenant tid injection, and audience confusion. Operates against captured tokens from SURVEY output.
04 CARD specter-forgery card INJECT A2A agent card manipulation: card substitution (replace with attacker-controlled card), skill injection (add malicious capabilities), capability escalation (elevate existing permissions), URL redirection (redirect agent card endpoint to attacker server), registry injection. Targets Google A2A /.well-known/agent.json and agent registries.
05 DEPUTY specter-forgery deputy INJECT Confused deputy attack chain: RS256→HS256 algorithm confusion (CVE-2025-68664, CVSS 9.3 — manual HMAC implementation using RSA public key PEM as secret), OBO flow scope escalation, multi-hop privilege amplification, cross-service token reuse. Maps the complete confused deputy privilege chain across agent service boundaries.
06 JWKS specter-forgery jwks INJECT JWKS root-of-trust poisoning: key injection (insert attacker RSA/EC key into JWKS response), kid confusion (path traversal ../../etc/passwd in kid parameter), alg confusion with injected key, empty keys bypass (zero-key JWKS causes permissive verification in vulnerable libraries), rotation poison (time key rotation to inject during transition window).
07 DRIFT specter-forgery drift OPEN Post-publication identity drift detection: compare current identity attributes against published baseline for A2A agent cards and KYA attestations. Detects attribute mutations (signing algorithm change, key rotation, capability modification, endpoint URL changes). Dead-man sentinel heartbeat thread — fires if monitoring is interrupted, indicating active drift suppression.
08 TRANSMUTE specter-forgery transmute DESTROY Cross-vendor identity transmutation across 8 paths: Entra→OpenAI, Entra→Anthropic, Salesforce→Workday, GCP→Azure, AWS→GCP, OpenAI→Google A2A, KYA→Lyrie ATP, Okta→Dify. Operationalises CVE-2026-44843 (SVID cross-boundary trust domain confusion). Each path maps the claim translation, signing conversion, and trust assertion required to make the transmuted identity accepted by the target system.
09 REPORT specter-forgery report OPEN Ed25519-signed ForgeReport with FORGE-{hex12} report ID, SHA-256 hash-chained EvidenceChain across all subsystems. Includes per-identity-type vulnerability summary, MITRE ATT&CK T1134/T1552/T1078/T1550/T1606/T1111 mapping, MITRE ATLAS AML.T0012/T0051/T0056/T0043/T0048 mapping, SIEM NDJSON export, WARLORD-compatible JSON output.

CVE-2025-68664 — RS256→HS256 Confusion

JWT algorithm confusion attacks exploit the relationship between RS256 (asymmetric RSA) and HS256 (symmetric HMAC). When a server verifies tokens using jwt.decode(token, public_key), an attacker can sign an HS256 token using the RSA public key as the HMAC secret — which the verifier accepts because it uses the same key bytes.

$ specter-forgery deputy https://target.ai/api --technique alg_confusion --override
[SURVEY] Fetching JWKS from https://target.ai/.well-known/jwks.json [SURVEY] RSA public key extracted: 2048-bit, kid=prod-signing-key-2026 [DEPUTY] Technique: RS256→HS256 algorithm confusion (CVE-2025-68664 CVSS 9.3) [DEPUTY] Building forged token with alg=HS256, kid=specter-deputy-confusion [DEPUTY] HMAC secret: RSA public key PEM (4096 bytes) [DEPUTY] Claims: sub=admin, oid=00000000-0000-0000-0000-000000000001, roles=["GlobalAdmin"] [FINDING] Forged HS256 token accepted by https://target.ai/api/admin [FINDING] Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InNwZWN0ZXItZGVwdXR5LWNvbmZ1c2lvbiJ9... [SEVERITY] CRITICAL — authentication bypass via algorithm confusion [EVIDENCE] hash_link: sha256:a3f7c91b2e4d8f0a1b5c6e9f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b

Key Injection

Inject attacker-controlled RSA/EC key into JWKS endpoint. Forged tokens signed with attacker private key are accepted by verifiers that fetch JWKS dynamically.

Kid Path Traversal

Path traversal in the kid header parameter causes servers to load key material from arbitrary filesystem paths: ../../etc/passwd as HMAC secret.

Empty Keys Bypass

Some JWKS libraries return "valid" for any token when the JWKS endpoint returns zero keys, treating an empty key set as "all keys accepted". Production systems have shipped with this flaw.

Rotation Poison

Time key injection to coincide with legitimate JWKS rotation windows. During the transition period, both old and new keys may be accepted — creating an injection window.

9
Subsystems
7
Identity Types
10
Vendor Targets
8
Transmutation Paths
407
Tests Passing

Eight Transmutation Paths

Modern AI deployments bridge multiple identity systems. SPECTER FORGERY maps and operationalises eight cross-vendor identity transmutation paths — converting credentials from one trust domain to another while maintaining cryptographic validity at the destination.

Cloud AI Paths

  • Entra → OpenAI (Azure AD → OpenAI API auth)
  • Entra → Anthropic (Azure AD → Claude API)
  • GCP → Azure (Google service account → Entra)
  • AWS → GCP (Cognito/IAM → Google Cloud)

Agent Protocol Paths

  • OpenAI → Google A2A (GPT identity → A2A agent card)
  • Okta → Dify (OIDC → LLM platform auth)
  • Salesforce → Workday (CRM identity → HRIS)
  • KYA → Lyrie ATP (KYA attestation → ATP protocol)

Identity Types Covered

  • OIDC_TOKEN — Standard OpenID Connect JWT
  • SPIFFE_SVID — X.509 workload identity
  • KYA_ATTESTATION — Know Your Agent attestation
  • AGENT_CARD — Google A2A discovery card
  • SERVICE_PRINCIPAL — Azure/GCP service account
  • OAUTH_TOKEN — OAuth 2.0 access token
  • JWT_GENERIC — Generic JWT (non-OIDC)

CVE Mapping

  • CVE-2025-68664 — Algorithm confusion CVSS 9.3
  • CVE-2026-44843 — SVID cross-boundary trust
  • MITRE ATT&CK T1134 — Token impersonation
  • MITRE ATT&CK T1552 — Credential access
  • MITRE ATT&CK T1606 — Forge web credentials
  • MITRE ATLAS AML.T0012 — Valid accounts

Three-Tier UNLEASHED Gate

Every SPECTER FORGERY subsystem requires explicit authorisation through the UNLEASHED Ed25519 gate. The DESTROY tier — required for cross-vendor identity transmutation — requires both the override flag and confirm-destroy flag, ensuring no accidental cross-boundary identity attacks outside an authorised engagement.

OPEN Gate

  • SURVEY — identity surface enumeration
  • DRIFT — post-publication drift detection
  • REPORT — evidence chain generation
  • No additional flags required

INJECT Gate

  • MINT — credential forgery
  • REPLAY — token manipulation
  • CARD — agent card injection
  • DEPUTY — algorithm confusion
  • JWKS — JWKS poisoning
  • Requires: --override

DESTROY Gate

  • TRANSMUTE — cross-vendor transmutation
  • Full pipeline via full command
  • Requires: --override --confirm-destroy
  • Scope file enforces target boundaries
  • Ed25519-signed audit trail mandatory

Standards & CVE Mapping

SPECTER FORGERY maps all findings to MITRE ATT&CK, MITRE ATLAS, and OWASP LLM Top 10 frameworks. Every signed report includes automatic compliance annotation.

MITRE ATT&CK

Identity & Credential Techniques

  • T1134 — Access Token Manipulation
  • T1552 — Unsecured Credentials
  • T1078 — Valid Accounts
  • T1550 — Use Alternate Authentication Material
  • T1606 — Forge Web Credentials
  • T1111 — Multi-Factor Authentication Interception
MITRE ATLAS

AI-Specific Attack Techniques

  • AML.T0012 — Valid ML Service Accounts
  • AML.T0051 — LLM Prompt Injection
  • AML.T0056 — LLM Meta Prompt Extraction
  • AML.T0043 — Craft Adversarial Data
  • AML.T0048 — Backdoor ML Model
OWASP & CVEs

LLM Top 10 & Disclosed Vulnerabilities

  • OWASP LLM01 — Prompt Injection
  • OWASP LLM02 — Insecure Output Handling
  • OWASP LLM06 — Sensitive Information Disclosure
  • CVE-2025-68664 — Algorithm confusion (CVSS 9.3)
  • CVE-2026-44843 — SVID cross-boundary trust
  • OWASP NHI Top 10 — Non-Human Identity risks

Authorised Use Only

SPECTER FORGERY is a controlled adversarial testing framework. Use is restricted to authorised security testing, red team engagements, and security research with written permission from system owners. Identity forgery operations require explicit INJECT or DESTROY clearance. Cross-vendor identity transmutation requires written engagement authorisation stored in the scope file. Unauthorised use against systems you do not own or have explicit permission to test is illegal under the Computer Misuse Act 1990, CFAA, and equivalent legislation worldwide. Every destructive operation is logged, hash-chained, and Ed25519-signed for auditor review.