Yoel-qin opened a new pull request, #14234:
URL: https://github.com/apache/apisix/pull/14234

   ### Description
   
   The rockspec pins `api7-lua-resty-jwt = 0.2.6-0` while `lua-resty-openidc` 
pulls in `lua-resty-jwt`, so two rocks install `resty/jwt.lua` and whichever 
lands last wins. This switches the pin to `lua-resty-jwt = 0.4.0-1`, so both 
requirements resolve to a single rock.
   
   0.4.0 is a security release 
([GHSA-v6j5-wh7j-2ggg](https://github.com/cdbattags/lua-resty-jwt/security/advisories/GHSA-v6j5-wh7j-2ggg)
 among others): compact serializations are parsed strictly now, so a padded or 
standard-alphabet variant of a token is rejected at load time instead of 
verifying as the original. New cases in `t/plugin/jwt-auth5.t` cover this, 
`jwt-auth.t` TEST 59 is adjusted for the new rejection path (still 401, 
different reason), and the jwt-auth docs spell out the canonical-serialization 
requirement.
   
   The key-type pre-checks in openid-connect stay - 0.4.0 checks the mismatch 
only when signing, while the pre-check rejects the config up front - only their 
comments changed, they still described the old crash behavior.
   
   **Behavior change**: tokens that are not canonical base64url (padding, 
`+`/`/` alphabet, extra dots) are now rejected with 401. Well-formed tokens 
from compliant encoders are unaffected. `zip: DEF` JWEs now need 
`jwt:register_zlib_compression()`; whether openid-connect should register it is 
being discussed in the issue.
   
   Verified locally on apisix-runtime 1.4.2 with lua-resty-jwt 0.4.0:
   
   - before: `api7-lua-resty-jwt 0.2.6` and `lua-resty-jwt 0.4.0` both ended up 
in the tree, the runtime picked 0.2.3, and an RS256 token rewritten with the 
standard base64 alphabet verified as the original (`verified: true`)
   - after: a single `lua-resty-jwt 0.4.0-1` in the tree; the same rewritten 
token is rejected at load (`invalid jwt string: non-canonical base64url in 
signature`) while the canonical form still verifies
   - `t/plugin/jwt-auth.t` (346 tests), `jwt-auth2.t`, `jwt-auth4.t`, 
`jwt-auth5.t` and `t/plugin/google-cloud-logging.t` (81 tests, covers the 
`google-cloud-oauth` signing path) pass; `jwt-auth3.t` keeps the same 
vault-dependent failures as on master (no vault service locally)
   
   #### Which issue(s) this PR fixes:
   Fixes #14222
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)


-- 
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]

Reply via email to