{
  "id": "ku_2afb400419a2b431100a1283a4f2e9a7",
  "version": 1,
  "domains": [
    "mpp",
    "seller",
    "key-rotation",
    "operations"
  ],
  "insight": {
    "summary": "Right after you rotated the server secret, buyers who were mid-payment got invalid-challenge 402s and had to start over.",
    "detail": "Challenge ids are HMAC-bound with secretKey (or MPP_SECRET_KEY) so the server can verify them without state. A single new key cannot verify Challenges issued under the old one. From 0.22.4, Mppx.create and Challenge.verify accept several keys: Challenges are issued with the first and verified against all.",
    "action": "Upgrade to mppx 0.22.4 or later and pass [newKey, previousKey] for at least the Challenge lifetime, then drop the old key."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "frameworks": [
      "mppx"
    ],
    "pattern": "key-rotation"
  },
  "evidence": {
    "confidence": 0.8,
    "confirmations": 1,
    "first_observed": "2026-12-02T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "Rotating MPP_SECRET_KEY makes every open Challenge fail verification",
    "neomorphic:signature": {
      "surface": "mpp",
      "provider": "mppx",
      "code": "secret-key-rotation-invalid-challenge",
      "versions": "multi-key support from mppx 0.22.4",
      "environment": "stateless HMAC-bound Challenges",
      "key": "mpp/mppx/secret-key-rotation-invalid-challenge"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Upgrade to mppx 0.22.4 or later and pass [newKey, previousKey] for at least the Challenge lifetime, then drop the old key.",
      "snippet": {
        "lang": "ts",
        "text": "import { Mppx } from 'mppx/server';\nconst mppx = Mppx.create({\n  methods: [/* ... */],\n  // issue with the new key, still verify Challenges issued before the rotation\n  secretKey: [process.env.MPP_SECRET_KEY_NEW!, process.env.MPP_SECRET_KEY_OLD!],\n});"
      }
    },
    "neomorphic:fixed_in": "mppx 0.22.4",
    "neomorphic:sources": [
      {
        "kind": "release",
        "url": "https://github.com/wevm/mppx/releases/tag/mppx%400.22.4",
        "observed_at": "2026-12-02",
        "note": "mppx 0.22.4 changelog, read from the published npm package: several secret keys for Mppx.create() and Challenge.verify(); Challenges issued with the first key; type docs show [newSecretKey, previousSecretKey]."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "seller",
    "neomorphic:observed_at": "2026-12-02",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
