You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "shreemaan-abhishek (via GitHub)" <gi...@apache.org> on 2026/04/08 06:51:20 UTC
[PR] fix(jwt-auth): enforce algorithm match before signature verification [apisix]
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(jwt-auth): enforce algorithm match before signature verification [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop merged PR #13182:
URL: https://github.com/apache/apisix/pull/13182
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org