Skip to content

fix(github): sign App JWTs with aws-lc-rs, dropping rsa 0.9 (RUSTSEC-2023-0071) - #323

Merged
sweepies merged 1 commit into
mainfrom
fix/jwt-without-rsa
Nov 14, 2026
Merged

sweepies merged 1 commit into
mainfrom
fix/jwt-without-rsa

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

The Count's run on his own repository proposed rsa 0.9 → 0.10 for RUSTSEC-2023-0071 (Marvin: timing side channels in RSA private-key operations, possible key recovery). Cargo refused that bump, because 0.10 dropped the pem feature our test code used. And rsa 0.9 wasn't only a test dependency: jsonwebtoken's rust_crypto backend used it to sign the GitHub App's RS256 JWTs in production, which is exactly the private-key operation the advisory covers.

Change

  • Signing backend: jsonwebtoken now uses its aws_lc_rs backend, which is already linked through rustls, so no new crypto library comes in. App::new accepts the same PKCS#1 and PKCS#8 PEM keys, and the JWT header, claims and RS256 algorithm are unchanged.
  • Test keys: throwaway App keys come from a new testkit helper built on aws-lc-rs. No Cargo.toml in the workspace mentions rsa now.
  • Cargo.lock: rsa 0.9.10, crypto-bigint 0.5.5 (RUSTSEC-2026-0387) and the rest of the RustCrypto chain only jsonwebtoken's old backend pulled in are gone: about 30 crates, 381 lines.

Proof

  • Offline: a JWT signed with a PKCS#1 key and one signed with a PKCS#8 key both verify with the public key through aws-lc-rs directly, with the exact header and claims checked.
  • Real installation: the ignored test a_real_installation_mints_a_metadata_read_token_for_one_repository passes against the sweepies-ops App. GitHub accepted the new signature, minted a repository-scoped metadata: read token, gave a 404 on another private repository and refused a write.
  • Builds: mise run build:cli and mise run release:package x86_64-unknown-linux-musl both pass on the VM. The aarch64-musl and darwin targets weren't run locally; CI and the release workflow build them.

User-visible effect: none, apart from the advisories clearing.

View guided diff Turn on auto-fix

…2023-0071)

RUSTSEC-2023-0071 (Marvin) covers timing side channels in the rsa crate's
private-key operations. jsonwebtoken's rust_crypto backend used rsa 0.9 to
sign the GitHub App's RS256 JWTs, which is exactly that operation. The rsa
0.10 bump the Count proposed could not resolve, because the github and
server crates' dev-dependencies asked for rsa's removed `pem` feature.

jsonwebtoken now signs with its aws_lc_rs backend. aws-lc-rs was already
linked through rustls, so no new crypto library is added. App::new accepts
the same keys as before, because PEM decoding (PKCS#1 and PKCS#8) is
jsonwebtoken's own code and does not depend on the backend. The header,
claims and algorithm are unchanged.

Tests generate App keys through a new patchula_testkit::app_key helper on
aws-lc-rs, which replaces the rsa dev-dependency in crates/github and
crates/server. A new test checks that a JWT from a PKCS#1 or PKCS#8 key has
the same RS256 header and claims, and verifies its signature with aws-lc-rs
directly.

User-visible effect: none, apart from the advisory clearing.

Cargo.lock drops rsa 0.9.10 and crypto-bigint 0.5.5 (RUSTSEC-2026-0387),
plus the rest of the RustCrypto chain that only rust_crypto pulled in:
base16ct, base64ct, const-oid, curve25519-dalek(-derive), der, ecdsa,
ed25519, ed25519-dalek, elliptic-curve, ff, fiat-crypto, group, hkdf, one
hmac version, num-bigint-dig, num-iter, p256, p384, pem-rfc7468, pkcs1,
pkcs8, ppv-lite86, primeorder, rand_chacha, rfc6979, sec1, spin, spki,
zerocopy and zerocopy-derive.

The source-head, tag-catalog, tag-object and release-notes state rows are
rehashed, because their crates/github/src/ tree changed. The stored bytes
did not change, so the versions stay the same.
@sweepies
sweepies force-pushed the fix/jwt-without-rsa branch from 3536386 to 1f97b9b Compare November 14, 2026 08:18
@sweepies
sweepies merged commit badd72b into main Nov 14, 2026
12 checks passed
@sweepies
sweepies deleted the fix/jwt-without-rsa branch November 14, 2026 08:26
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
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