{
  "id": "security/jwt-issuer-mismatch-allows-token-forgery",
  "signature": "JWT issuer mismatch: token 'iss' claim does not match the expected issuer for this application",
  "signature_zh": "JWT 签发者不匹配：令牌的 'iss' 声明与该应用程序的预期签发者不匹配",
  "regex": "JWT issuer mismatch|iss claim does not match|Invalid issuer",
  "domain": "security",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "JWT validation does not verify the 'iss' (issuer) claim, allowing an attacker to forge a token from a different, trusted issuer (e.g., a compromised internal service) to access resources.",
  "root_cause_type": "generic",
  "root_cause_zh": "JWT 验证未检查 'iss'（签发者）声明，允许攻击者从另一个受信任的签发者（例如受损的内部服务）伪造令牌以访问资源。",
  "versions": [
    {
      "version": "jsonwebtoken 9.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PyJWT 2.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "jjwt 0.12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Keycloak 22.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Auth0 JWT 1.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Audience claim checks the intended recipient, not the issuer; an attacker can still forge a token from a different issuer with a matching audience.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Whitelisting all issuers defeats the purpose; an attacker can use any trusted issuer's signing key to forge tokens.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Completely bypasses the security check, making the application vulnerable to cross-issuer token forgery.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add issuer validation in JWT verification middleware. Example in Node.js using jsonwebtoken library: `jwt.verify(token, secret, { issuer: 'https://auth.myapp.com' })`. Ensure the expected issuer is configured per environment.",
      "success_rate": 0.95,
      "how": "Add issuer validation in JWT verification middleware. Example in Node.js using jsonwebtoken library: `jwt.verify(token, secret, { issuer: 'https://auth.myapp.com' })`. Ensure the expected issuer is configured per environment.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use OpenID Connect Discovery to fetch and validate issuer dynamically: verify `iss` matches the issuer URL of the identity provider.",
      "success_rate": 0.9,
      "how": "Use OpenID Connect Discovery to fetch and validate issuer dynamically: verify `iss` matches the issuer URL of the identity provider.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add issuer validation in JWT verification middleware. Example in Node.js using jsonwebtoken library: `jwt.verify(token, secret, { issuer: 'https://auth.myapp.com' })`. Ensure the expected issuer is configured per environment.",
    "Use OpenID Connect Discovery to fetch and validate issuer dynamically: verify `iss` matches the issuer URL of the identity provider."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1",
  "official_doc_section": null,
  "error_code": "JWT_ISSUER_MISMATCH",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}