You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could see someone blindly copy-pasting this without checking the issuer.
(AFAICT fetching the JWKS from the domain supplied by the client in the iss field of the JWT payload without validating is unsafe. An attacker could craft a JWT with a fake iss pointing to a domain they control? They could set up a JWKS endpoint that provides a public key of their choosing. This would allow the attacker to generate and sign a token that the server would then consider valid.)
I think the issuersWhitelist property should explicitly be added in the example to emphasise its importance and avoid this pitfall.
In the README there is this
@fastify/jwt
integration example:I could see someone blindly copy-pasting this without checking the issuer.
(AFAICT fetching the JWKS from the domain supplied by the client in the
iss
field of the JWT payload without validating is unsafe. An attacker could craft a JWT with a fakeiss
pointing to a domain they control? They could set up a JWKS endpoint that provides a public key of their choosing. This would allow the attacker to generate and sign a token that the server would then consider valid.)I think the
issuersWhitelist
property should explicitly be added in the example to emphasise its importance and avoid this pitfall.The text was updated successfully, but these errors were encountered: