[🐸 Frogbot] Update version of jsonwebtoken to 9.0.0 #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📦 Vulnerable Dependencies
✍️ Summary
High
🔬 Research Details
Description:
jsonwebtoken is a JSON Web Token (JWT) implementation for Node.js.
It allows verifying/signing JWTs, which are mainly used for authorization and authentication purposes.
JSON Web Token is an open industry standard used to share information between two entities, usually a client (like your app’s frontend) and a server (your app’s backend).
Each JWT is also signed using cryptography (hashing) to ensure that the JSON contents (also known as JWT claims) cannot be altered by the client or a malicious party.
It was discovered that the
jwt.sign()andjwt.verify()functions in jsonwebtoken didn't check the key type and algorithm, which might lead to the usage of insecure key algorithms and could result in a signature brute force and bypass.For example, a legacy
DSAkey could be used in practice, while passing any other algorithm in thealgargument forjwt.sign()orjwt.verify().The issue requires an old legacy key type to be used with an algorithm that doesn't match it, weakening the verification process's security, which is rare.
A malicious attacker could try to break a JWT signature that uses this weak key type and algorithm combination, and by doing so change its payload without the verifier noticing.
When using the JWT for authentication purposes - this may lead to an authentication bypass.
A new option named
allowInvalidAsymmetricKeyTypescould be passed after updating to the fixed version in order to allow backward compatibility and essentially bypass the fix.Refer to the advisory for the list of allowed and supported key types and algorithm combinations.
🐸 JFrog Frogbot