Skip to content

fix(rest,ui): unbreak main — drop rsa from JWKS derivation, fix the stale keys test - #560

Merged
smunini merged 1 commit into
mainfrom
fix/539-jwks-rsa-audit
Aug 18, 2026
Merged

fix(rest,ui): unbreak main — drop rsa from JWKS derivation, fix the stale keys test#560
smunini merged 1 commit into
mainfrom
fix/539-jwks-rsa-audit

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Main is red for every open PR since #539 merged — two independent breakages, both fixed here:

1. Security Audit fails on rsa (RUSTSEC-2023-0071). #539 added the pure-Rust rsa crate in two places (rest's derive_public_jwk, ui's signing_kid) for RS384 public-JWK derivation. The Marvin Attack advisory has no fixed release, and this repo already refuses the crate on principle — jwe.rs rejects RSA-OAEP citing exactly this advisory, and the JWKS handler's own doc comment promises "an empty keys array when … the configured algorithm is not ES384". The code now honors that contract: RS384 → None with the rationale inline, ES384 derivation (via the existing p384) untouched, rsa gone from both manifests and the lockfile. An RS384 deployment registers its key out-of-band and its assertions go out without a kid — consistent with the endpoint serving no RSA key either.

2. Test Rust fails on the stale keys test. #539 turned /ui/bulk-import/keys into a Redirect::permanent to /.well-known/bulk-submit-jwks.json but left the old test asserting the 404/200 env-var contract — so the_keys_endpoint_serves_the_configured_jwks fails (308 ≠ 404) on every merge ref. Replaced with a test of the actual contract: 308 + the Location header.

Verified: cargo tree -i rsa empty, both crates' suites green, fmt clean. Once this merges, re-running the checks on the open PRs (#538, #558) should clear them.

…keys test

The bulk-submit JWKS work brought in the pure-Rust rsa crate for RS384
public-JWK derivation, tripping the Security Audit on every PR:
RUSTSEC-2023-0071 (Marvin Attack timing sidechannel) has no fixed
release, and jwe.rs already rejects RSA-OAEP for exactly this reason.
The JWKS handler's own doc promises an empty key set for non-ES384
algorithms -- the code now honors it. Both copies of the derivation
(rest's derive_public_jwk, ui's signing_kid) return None for RS384
with the rationale in place; an RS384 deployment registers its key
out-of-band, the assertion goes out without a kid, and the rsa crate
leaves the lockfile.

Also updates the UI keys test the redirect change left behind: the
route permanently redirects to /.well-known/bulk-submit-jwks.json now,
and the old 404/200 assertions were failing Test Rust on every PR's
merge ref.
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@smunini
smunini merged commit 1519678 into main Aug 18, 2026
21 checks passed
@smunini
smunini deleted the fix/539-jwks-rsa-audit branch August 18, 2026 12:53
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.

2 participants