Skip to content

Update jsonwebtoken and opensaml to drop the RustCrypto advisory exceptions - #105

Open
mzupan wants to merge 1 commit into
mainfrom
chore/jsonwebtoken-12
Open

mzupan wants to merge 1 commit into
mainfrom
chore/jsonwebtoken-12

Conversation

@mzupan

@mzupan mzupan commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Removes the last two RustSec exceptions by updating the crates that pulled in the old RustCrypto stack.

Why both crates

RUSTSEC-2026-0387 (crypto-bigint 0.5) and RUSTSEC-2023-0071 (rsa 0.9) came in through two paths: jsonwebtoken (OIDC and license JWTs) and opensaml → bergshamra (SAML signature checks). Updating only jsonwebtoken leaves both advisories in place through SAML.

Crate From To
jsonwebtoken 10.4 12.0 (Keats/jsonwebtoken#536)
opensaml / saml-rs 0.3 0.8
bergshamra (dev-dependency) 0.7 0.12

After the update, the tree has only crypto-bigint 0.7, elliptic-curve 0.14 and rsa 0.10. deny.toml has ignore = [], and .cargo/audit.toml keeps only the two unmaintained-crate entries (bincode, unsafe-libyaml).

Behavior

  • JWT: the only API change hit is EncodingKey::from_secret returning a Result (12.0 rejects empty HMAC keys). That's in one SSO test. Production code only builds DecodingKeys. 12.0 also rejects tokens with unknown crit header extensions.
  • SAML: query-api calls only opensaml::crypto::verify::verify_signature. In 0.8 that function still verifies under the AllowProviderSupportedForCompatibility profile, not Recommended, so IdPs that sign with older algorithms keep working. saml-rs 0.4 through 0.8 add stricter XML and signature-coverage checks. The existing SAML tests in src/saml.rs pass unchanged: a signed response verifies and a tampered one is rejected, a missing or bogus signature fails closed, and the audience, expiry, issuer and request-correlation checks reject bad assertions.

Checked locally (toolchain 1.89.0)

  • cargo audit: no vulnerabilities.
  • cargo deny check: advisories, bans, licenses and sources ok.
  • cargo fmt --check and cargo clippy --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious: clean.
  • cargo test --all-targets --all-features: 862 passed, 0 failed.

Worth a manual SAML and OIDC login against a real IdP before the next release.

…sory exceptions

jsonwebtoken 12 and opensaml 0.8 / bergshamra 0.12 move the RustCrypto stack to p256/p384 0.14 (crypto-bigint 0.7) and rsa 0.10. That clears RUSTSEC-2026-0387 and RUSTSEC-2023-0071, so both come out of deny.toml and .cargo/audit.toml. EncodingKey::from_secret is fallible in jsonwebtoken 12; the one test that builds an HMAC key unwraps it.
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

Successfully merging this pull request may close these issues.

1 participant