Skip to content

chore(dep): bump jsonwebtoken v10.3.0 fix cve#3754

Open
duyquang6 wants to merge 5 commits intoalloy-rs:mainfrom
duyquang6:push-pxoqupuxrzvw
Open

chore(dep): bump jsonwebtoken v10.3.0 fix cve#3754
duyquang6 wants to merge 5 commits intoalloy-rs:mainfrom
duyquang6:push-pxoqupuxrzvw

Conversation

@duyquang6
Copy link

Motivation

fix cve: https://avd.aquasec.com/nvd/cve-2026-25537

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Feb 27, 2026
Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the tests :)

@github-project-automation github-project-automation bot moved this from Reviewed to In Progress in Alloy Feb 27, 2026
@duyquang6
Copy link
Author

duyquang6 commented Feb 27, 2026

please fix the tests :)

could you check again, ran local and pass

// Create a new validation object with the required signature algorithm
// and ensure that the `iat` claim is present. The `exp` claim is validated if defined.
let mut validation = Validation::new(JWT_SIGNATURE_ALGO);
validation.set_required_spec_claims(&["iat"]);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_required_spec_claims is not accept iat field anyway, so that why i nuked here

let mut validation = Validation::new(JWT_SIGNATURE_ALGO);
validation.set_required_spec_claims(&["iat"]);
validation.required_spec_claims.clear();
validation.validate_exp = false;
Copy link
Author

@duyquang6 duyquang6 Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default jsonwebtoken will validate exp field.
as engine api doesn't validate if exp not exist, so needed this to bypass

if !token.claims.is_within_time_window() {
Err(JwtError::InvalidIssuanceTimestamp)?
}
if !token.claims.is_exp_valid() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need manually verify because we bypass the check above

@Vui-Chee
Copy link

Vui-Chee commented Mar 2, 2026

@onbjerg pls review and merge :)

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, is this now a dep bump or a fix,

dont understand why this needs validation changes

@duyquang6
Copy link
Author

duyquang6 commented Mar 3, 2026

sorry, is this now a dep bump or a fix,

dont understand why this needs validation changes

Hi sir,
Since jsonwebtoken v10 changed behavior, so we need adopt this change if want to bump to v10, to compare with jsonwebtoken v9, one that i found from this

if not explicitly set validate exp field false, we cannot parse the token, and failed the test

@duyquang6 duyquang6 force-pushed the push-pxoqupuxrzvw branch from 209b039 to 05906dd Compare March 3, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants