Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade jwt library due to security vuln #395

Open
sc-zenokerr opened this issue Nov 5, 2024 · 1 comment
Open

Upgrade jwt library due to security vuln #395

sc-zenokerr opened this issue Nov 5, 2024 · 1 comment

Comments

@sc-zenokerr
Copy link
Contributor

sc-zenokerr commented Nov 5, 2024

There is a vulnerability in the github.com/golang-jwt/jwt/v4 v4.5.0 dependency

https://osv.dev/vulnerability/GHSA-29wx-vh33-7x7r

The vulnerability is fixed in the next patch version 4.5.1

This library is used in a few other projects, so after this is updated, the relevant projects should be updated too,

github.com/golang-jwt/jwt/v4 v4.5.0

@EtienneM EtienneM assigned EtienneM and unassigned EtienneM Nov 5, 2024
@EtienneM
Copy link
Member

EtienneM commented Nov 5, 2024

A good way to fix this issue would be to update to v5 of this package.

IMO we should change how we treat errors when calling jwt.ParseWithClaims:

token, err := jwt.ParseWithClaims(jwtToken, &apiJWTClaims{}, nil)
// If token is nil, nothing has been parsed, if it's not, err will be a
// ValidatingError we want to ignore
if token == nil {
return "", errgo.Notef(err, "fail to parse jwt token")
}

The error is ignored, we only check for nil token. But from what I can see a token may be returned in case there is a jwt.ErrTokenSignatureInvalid error, hence accepting an invalid token.

golang-jwt/jwt@v4.5.0...v4.5.1#diff-83eb8e32639d01cf443d6d8bde24c1c8be78766090d8c5f8586c36250cfedca6R90-R94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants