)]}'
{
  "commit": "39932880fcbad0405565686e62f2e1a2c7cfdf7d",
  "tree": "2f78682ffcd6f2d00f46d5ddf4c42e3fa3b68078",
  "parents": [
    "469e25827bab39af0b70394cb949c8bb91211b10"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 12:41:09 2026 -0500"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 16:11:21 2026 -0500"
  },
  "message": "json-c: reject raw control characters and other non-JSON\n\nThe json-c backend created its tokener with no flags, so json-c parsed in\nits lenient default mode. That mode accepts a raw control character\n(U+0000 to U+001F) inside a string, which RFC 8259 forbids, as well as\nsingle-quoted strings and /-comments; Jansson\u0027s parser rejects them all.\nA token, claim or key that one backend took as valid and the other\nrefused is a json-c/Jansson disagreement about what a valid JWT, value or\nkey is.\n\nReplace the escaped-NUL-only pre-parse check (has_nul_escape) with a\nstring-aware scan (scan_json) that rejects, as Jansson\u0027s parser would, a\nraw control character inside a string, a \"\\u0000\" escape, and the\nsingle-quoted strings and /-comments json-c would otherwise honour (which\nmust be rejected to keep the double-quote tracking in step). Valid\nnon-ASCII UTF-8 and a raw DEL (0x7F), which RFC 8259 allows, still pass.\nThe forms deliberately left to json-c (trailing commas, NaN/Infinity,\ncase-insensitive literals, leading zeros, lone surrogate escapes and\ninvalid UTF-8) are documented at the scanner.\n\njwt_json_parse_fp() NUL-terminated the file buffer and parsed it as a C\nstring, so a NUL embedded in a JWKS file truncated the input and whatever\nfollowed it escaped the trailing-data check. Parse the file by its\nlength, as the buffer parser already does, so the trailing bytes are\nrefused.\n\nTested under both JSON backends (control characters in a Compact token\u0027s\npayload and the outer object of a JWS JSON token; in a JWK/JWKS from a\nstring, buffer, FILE and file; a NUL-and-junk JWKS file; the lenient\nextensions; and that valid UTF-8, a DEL and an escape still load), plus\nthe CLI repro from the issue.\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": "b6403fe3d333c5b7c5ebecb2fe9fdc31fefa67ad",
      "old_mode": 33188,
      "old_path": "libjwt/json-c/jwt-json-c.c",
      "new_id": "aa6402c29961de62fdb7a335bac9844d48dc50b4",
      "new_mode": 33188,
      "new_path": "libjwt/json-c/jwt-json-c.c"
    },
    {
      "type": "modify",
      "old_id": "2a4393a06062042eae966c6eeb910c7664dbb591",
      "old_mode": 33261,
      "old_path": "tests/jwt-cli.bats",
      "new_id": "2ffede71d2ceed4e7739d2b343102e5e136d1771",
      "new_mode": 33261,
      "new_path": "tests/jwt-cli.bats"
    },
    {
      "type": "modify",
      "old_id": "5d7ed3fd6c0508e8bbf456dd1d278791f98e2788",
      "old_mode": 33188,
      "old_path": "tests/jwt_jwks_errors.c",
      "new_id": "34f07762d129ebe813dc96cb8590bd9c13b25480",
      "new_mode": 33188,
      "new_path": "tests/jwt_jwks_errors.c"
    },
    {
      "type": "modify",
      "old_id": "d03b548d911c930608d68a37b30f3f51ac34f165",
      "old_mode": 33188,
      "old_path": "tests/jwt_security.c",
      "new_id": "dd6f2d0d85c7868bcb5ba775b0afc264c7122d3b",
      "new_mode": 33188,
      "new_path": "tests/jwt_security.c"
    }
  ]
}
