shreemaan-abhishek opened a new pull request, #13182: URL: https://github.com/apache/apisix/pull/13182
## Summary - Enforce that the JWT header's `alg` claim matches the consumer's configured algorithm before performing signature verification, per RFC 8725 Section 2.1 - Add nil guard on `jwt.header` before accessing `alg` to handle malformed tokens gracefully - Only log the expected algorithm in mismatch errors, avoiding untrusted values in log output - Add test coverage for algorithm mismatch rejection ## Test plan - [x] New test case (TEST 52 in `t/plugin/jwt-auth.t`): creates an RS256 consumer, submits a token with mismatched algorithm, asserts 401 rejection with correct error log - [x] `prove -I. -Itest-nginx/lib -r t/plugin/jwt-auth.t` passes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
