Skip to content

Why Nested session tokens are post-quantum

RSA session signatures fail once a quantum computer can copy a published key. Nested can sign with ML-DSA-65 instead. Here is the rollout.

5 min read

The key is already public#

A quantum computer does not have to steal a Nested session to become a problem. It has to become good enough to copy a key we already give out.

People hear “quantum” and picture someone recording today’s traffic to read it in ten years. That attack is real. Its name is harvest-now, decrypt-later, and it applies to encryption: a sealed message you want to stay secret for a long time. A session token is not that kind of secret. Your browser already holds it. The signature exists so that nobody else can write a new one.

Nested used to sign those tokens with RS256: RSA, with a 2048-bit key. A large quantum computer that runs Shor’s algorithm can recover an RSA private key from the matching public key. We publish the public key on purpose. Every service downloads it and checks tokens on its own, with no extra call back to the signer. A future attacker does not need a stolen backup. They need that published key, and a machine that can run the algorithm. After that they can sign a token for any account.

A short lifetime does not close this hole. An access token lasts 15 minutes. A refresh token lasts 7 days, and each use rotates the pair. A token copied today is a poor prize to crack in a decade, because it will have expired. The prize is the ability to mint a fresh token on the day the machine exists.

The signature we use now#

The replacement is ML-DSA-65. ML-DSA is the module-lattice signature in NIST FIPS 204. The “65” is the parameter set we ship: security category 3, which is the middle of the three sets in the standard. In a JWT the algorithm is written ML-DSA-65. That is the name RFC 9964 assigns it.

Known attacks, including the ones a quantum computer speeds up, do not recover this private key from the public key. Shor’s algorithm does not apply to it.

We did not invent a signature scheme, and we did not take one from an unreviewed library. The math is Go’s crypto/mldsa, in the standard library. The token code around it is small. We also did not staple an RSA signature beside the new one. A combined hybrid signature for JOSE is not a finished standard, and the classical half would become forgeable on its own. One algorithm means one check.

The cost is size. An ML-DSA-65 signature is about 3.3 KB, and a full access token is about 5 KB. One browser cookie holds 4 KB, so the session no longer fits in a single cookie. The edge splits a long value across a few cookies and joins those parts when the request arrives. You should not notice. If you run Nested behind your own ingress, and that ingress rejects large request headers, raise the limit before you change the signer. A signed-in request carries a few kilobytes more cookie data than an RS256 session did.

Three steps, so nobody is locked out#

A live system cannot swap a signature in one move. Browsers still hold old tokens. A service that has not learned the new algorithm would reject every new token, including tokens our own jobs present.

The software therefore ships with the previous behavior, and the change is three steps.

StepWhat changesWhat you see
1. Checkers firstEvery service that verifies a token learns ML-DSA, and still accepts RS256.Nothing. Sign-in looks the same.
2. New signaturesThe signer issues ML-DSA-65 tokens. Tokens already issued keep working until they expire.New sessions use the new signature. Old tabs keep working.
3. Retire RSA for sessionsAfter the last RS256 session token you still honor is gone, verifiers accept only ML-DSA for those tokens.An old session is refused. You sign in again.

A fresh install still signs with RS256. Its verifiers accept RS256 and ML-DSA until an operator walks these steps. Deploy the new code everywhere before step 2. Before step 3, wait out the seven-day refresh token, and reissue any longer-lived credential that is still RS256. Refuse the old algorithm only when nothing you need still presents it.

On the install we operate, sign-in for the app, the console, and the control plane has finished step 3. A new session is ML-DSA-65. An RS256 session token is refused. If a tab from before the cutover asks you to sign in again, the check is doing what it should.

If a step misbehaves, go back one step. Accept RS256 again before you point the signer back at RS256. The other order makes the signer issue tokens the checkers will not take.

What this does not make safe#

A few edges are still classical. Here is the list.

  • HTTPS. TLS still uses classical key agreement and classical certificates. Harvest-now, decrypt-later is about that recorded traffic. It waits on browsers and on certificate authorities. This change does not make a recorded connection safe.
  • Passkeys. WebAuthn credentials are still classical signatures. Replacing them depends on authenticators and on browsers.
  • Credentials that are not your session. A few service credentials still use Ed25519. Ed25519 has the same class of quantum exposure as RSA. The assertion Nested sends as a GitHub App stays RS256, because GitHub requires that algorithm. Where a connected app cannot verify ML-DSA yet, the identity token for that handoff can still be RS256. That token is not the session for the Nested app or the console.
  • The rest of the model. Encryption at rest, team boundaries, and agent isolation are unchanged. Those layers are in The Nested security model.

If you run Nested yourself#

Read the security docs before you change the signer. Do the three steps in order. Confirm that a new sign-in works, and that a session token from before step 2 is refused, before you treat the install as done.

Closing#

A quantum computer that can break RSA is not here. The public key is. We retired the session signature such a machine could copy. The rest of the claim waits until the rest of the stack can match it.

Questions

Are Nested session tokens post-quantum safe?
They can be. On the install we operate, session tokens for the app, the console, and the control plane are ML-DSA-65, and an RS256 session token is refused. A fresh install still signs with RS256 until an operator completes the same three steps.
What is ML-DSA-65?
ML-DSA is the module-lattice digital signature in NIST FIPS 204. ML-DSA-65 is its category-3 parameter set. Nested uses the JWT algorithm name ML-DSA-65 from RFC 9964.
Why did a short token lifetime not solve this?
A short lifetime stops a stolen token from working later. It does not stop someone who can forge a new token from the published public key. That is the RS256 risk on a large quantum computer.
Do I have to sign in again?
Once, if the browser still holds a session signed with RS256. After that, refresh works as before. Access tokens still last 15 minutes, and refresh tokens still last 7 days.
Does this make HTTPS post-quantum?
No. TLS and passkeys still use classical cryptography. This change covers session signatures, not the connection and not the passkey.

4 min read

One git layer for GitHub, GitLab, and Gitea

How Nested clones, pushes, and starts tasks on GitHub, GitLab, and Gitea, including a team’s own server, without putting the token in the checkout.