Sign sessions with a key that verifiers cannot forge #1

Merged
paulhitt merged 3 commits from feat/asymmetric-session-tokens into main 2026-09-07 01:30:16 +00:00
paulhitt commented 2026-08-23 16:49:44 +00:00 (Migrated from gitlab.com)

Sessions are signed with a shared HMAC secret. That is fine while every verifier
is a service we run, and it permanently excludes everyone else: HMAC cannot
separate verifying from minting, so a relay given the secret in order to CHECK a
FlameNet session could equally FORGE one for any account here. There is no
configuration of a shared secret that makes it safe to hand out — which is why
somebody else's relay has never been able to accept FlameNet identities.

Ed25519 separates the two. The private half stays in this service; the public
half is published at /.well-known/jwks.json in the standard shape, so a relay
operator points ordinary JWT tooling at it rather than writing something bespoke
against a format only this project uses. Anyone can verify. Nobody else can
sign.

Both algorithms are registered during the changeover, and signing only moves to
EdDSA once a key is configured. Existing verifiers hold the shared secret and
nothing else, so they would reject every token the moment this service started
signing with a key they have never seen. Retiring HMAC is a separate step that
has to follow the verifiers, not lead them.

Additive: with ENCLAVE_JWT_PRIVATE_KEY unset nothing changes, and the service
logs why third-party relays cannot be added in that state rather than leaving it
to be discovered.

kid is present from the first key even though there is only one. Without it a
second key later forces every verifier to try each key against every token, and
a rotation becomes indistinguishable from a forgery attempt in the logs.

Existing suites pass unchanged (52 tests). What this does NOT do: the relay
still verifies with the shared secret, so nothing can use this yet — that side
is the next change, and until it lands this is capability without a consumer.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Sessions are signed with a shared HMAC secret. That is fine while every verifier is a service we run, and it permanently excludes everyone else: HMAC cannot separate verifying from minting, so a relay given the secret in order to CHECK a FlameNet session could equally FORGE one for any account here. There is no configuration of a shared secret that makes it safe to hand out — which is why somebody else's relay has never been able to accept FlameNet identities. Ed25519 separates the two. The private half stays in this service; the public half is published at `/.well-known/jwks.json` in the standard shape, so a relay operator points ordinary JWT tooling at it rather than writing something bespoke against a format only this project uses. Anyone can verify. Nobody else can sign. Both algorithms are registered during the changeover, and signing only moves to EdDSA once a key is configured. Existing verifiers hold the shared secret and nothing else, so they would reject every token the moment this service started signing with a key they have never seen. Retiring HMAC is a separate step that has to follow the verifiers, not lead them. Additive: with ENCLAVE_JWT_PRIVATE_KEY unset nothing changes, and the service logs why third-party relays cannot be added in that state rather than leaving it to be discovered. `kid` is present from the first key even though there is only one. Without it a second key later forces every verifier to try each key against every token, and a rotation becomes indistinguishable from a forgery attempt in the logs. Existing suites pass unchanged (52 tests). What this does NOT do: the relay still verifies with the shared secret, so nothing can use this yet — that side is the next change, and until it lands this is capability without a consumer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
paulhitt commented 2026-08-23 16:49:44 +00:00 (Migrated from gitlab.com)

assigned to @paulhitt

assigned to @paulhitt
paulhitt commented 2026-08-23 17:35:54 +00:00 (Migrated from gitlab.com)

added 1 commit

  • b89d5ac8 - Actually sign with the key that was registered

Compare with previous version

added 1 commit <ul><li>b89d5ac8 - Actually sign with the key that was registered</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/1/diffs?diff_id=1978306753&start_sha=a905f0286f54fd882107233a74eb41eece65f185)
paulhitt commented 2026-09-07 00:13:32 +00:00 (Migrated from gitlab.com)

mentioned in commit a95a64cde9

mentioned in commit a95a64cde9b0ce53bdf081e94ba4c3480699d5d1
paulhitt commented 2026-09-07 00:13:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !8

mentioned in merge request !8
paulhitt commented 2026-09-07 01:22:55 +00:00 (Migrated from gitlab.com)

added 26 commits

  • b89d5ac8...3c635735 - 23 commits from branch main
  • a8271cfa - Sign sessions with a key that verifiers cannot forge
  • 09d14b13 - Actually sign with the key that was registered
  • b64c4640 - Test the encoding the published key is written in

Compare with previous version

added 26 commits <ul><li>b89d5ac8...3c635735 - 23 commits from branch <code>main</code></li><li>a8271cfa - Sign sessions with a key that verifiers cannot forge</li><li>09d14b13 - Actually sign with the key that was registered</li><li>b64c4640 - Test the encoding the published key is written in</li></ul> [Compare with previous version](/paulhitt/flamenet-files/-/merge_requests/1/diffs?diff_id=2007872030&start_sha=b89d5ac82bbe626d98829f960a6ff2c40f5ef186)
paulhitt commented 2026-09-07 01:30:16 +00:00 (Migrated from gitlab.com)

mentioned in commit c6e75e0c01

mentioned in commit c6e75e0c018fc50151f7628fa6ff4b5cdee7aac3
paulhitt (Migrated from gitlab.com) merged commit c6e75e0c01 into main 2026-09-07 01:30:16 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: extant2000/flamenet-files#1