)]}'
{
  "commit": "14ad1de711585f5a3a849d7b00cce694e3761fbb",
  "tree": "b805d440e9d69ed8aa3d639d3e558838a05045e5",
  "parents": [
    "0081a8dbac62663087b5b9979c23f4b04175721c"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:13:12 2026 -0500"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:13:12 2026 -0500"
  },
  "message": "jwt: enforce a callback\u0027s JWT_ALG_NONE alg pin on the JWS JSON path\n\nA verify callback may set config-\u003ealg to pin the algorithm a signature\nmust use. Setting it to JWT_ALG_NONE means \"the key\u0027s own alg\": the\nCompact path resolves that in __setkey_check() (jwt-common.c), so a key\nthat declares an \"alg\" pins it and a key without one verifies nothing.\n\nThe JWS JSON Serialization path in verify_entry() did not. It applied\nthe exact-alg pin only when config.alg !\u003d JWT_ALG_NONE, and otherwise\nleft only the key-type gate (for an alg-less explicit key) or the\nper-key declared-alg check in the ring scan (for an alg-less ring key).\nSo a callback that reset the pin to JWT_ALG_NONE on a checker keyed with\nan alg-less key let any algorithm of the key\u0027s type verify (for example\nRS512 or PS256 after jwt_checker_setkey(c, JWT_ALG_RS256, key)), while\nthe Compact path rejected the same token. Compact tokens checked against\na keyring take the JSON path, so they inherited the bypass too. This is\nan algorithm-pinning (RFC 8725 section 3.1) conformance bug, not a\nforgery: the signature still had to verify and the key-type gate still\nheld.\n\nResolve a JWT_ALG_NONE pin on the JSON path exactly as the Compact path\ndoes:\n\n  - For an explicit key (a single key, a kid-named ring key, or one the\n    callback supplied), resolve config.alg to the key\u0027s own \"alg\" before\n    the exact-alg pin; a key with no \"alg\" of its own verifies nothing.\n\n  - In the kid-less ring scan, skip an alg-less candidate when the pin\n    is JWT_ALG_NONE, matching the explicit-key rule. A candidate that\n    declares an \"alg\" is still pinned to it by the existing check.\n\nThe seed for config.alg is never JWT_ALG_NONE (a JSON signature cannot\ncarry \"alg\":\"none\"), so only a callback reaches this; no callback, or\none that sets a concrete alg, is unaffected. The change is contained in\nthe static verify_entry(); no API or ABI change.\n\nAdd test_json_alg_none_cb to tests/jws_json.c, covering the single-key,\nkeyring-scan and kid-named cases across Compact, Flattened and General,\nunder both JSON backends and every crypto backend, and clarify the\njwt_checker_setkey/setkeyring/setcb docs to state that a JWT_ALG_NONE\npin verifies nothing with a key that has no \"alg\" of its own.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\nSigned-off-by: Ben Collins \u003cbcollins@libjwt.io\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "014b9b467ae3dc4d7a68bd7ef129a2cbed5d372f",
      "old_mode": 33188,
      "old_path": "include/jwt.h",
      "new_id": "3a5d07c08d5839a2d8ae66cae886ea9f66336376",
      "new_mode": 33188,
      "new_path": "include/jwt.h"
    },
    {
      "type": "modify",
      "old_id": "8f3fd09ef8894407585bd668fb56e20b4195da0a",
      "old_mode": 33188,
      "old_path": "libjwt/jwt-verify.c",
      "new_id": "52aa814ec92803b75691a63665f38cb05afde5dd",
      "new_mode": 33188,
      "new_path": "libjwt/jwt-verify.c"
    },
    {
      "type": "modify",
      "old_id": "a059bfa7d32a9bc20cc6bb144ef9008a443f9976",
      "old_mode": 33188,
      "old_path": "tests/jws_json.c",
      "new_id": "4ce15ffcc7614624194b3e5f20f224cca6c0c876",
      "new_mode": 33188,
      "new_path": "tests/jws_json.c"
    }
  ]
}
