Cryptographic session continuity, delegation chains, and offline revocation proofs
JavaScript
0
12 commits
updated Oct 5, 2026
Cryptographic proof that an accepted application session is the legitimate continuation of the authenticated session that created it.
Modern applications authenticate users once, then hand them long-lived session tokens. Between authentication and the last request, nothing cryptographically proves that session #N is the same user as session #1.
Attackers exploit this gap:
Existing tools (JWT, PASETO, Macaroons) prove authorization, not continuity. This engine fills that gap.
Given a verified OIDC/JWT claim, session-continuity produces a signed, append-only proof that:
npm install
node bin/session-continuity.mjs authority-init --output ./authority
node bin/demo.mjs
Output: a verified provenance certificate under ./receipt/.
OIDC/JWT --> session-continuity --> Receipt
(external) Engine (portable)
|
v
Trust Authority
(external, immutable)
Key design: The trust authority is external to the receipt. Verification does not require calling home.
See SECURITY.md for the full model.
OIDC/JWT validation is outside this engine. Caller supplies claims only after independent verification.
v0.2.0 — specification-stable, test-covered, not yet audited by a third party. See CHANGELOG.md.
Apache 2.0 — see LICENSE.
See CONTRIBUTING.md.
Fork protection is implemented but disabled by default for backward compatibility.
Enable via environment variable:
SC_FORK_PROTECTION=enabled node your-app.js
When enabled, the engine uses fork-registry to block a second continuation from the same (anchor_fingerprint, parent_sequence). The verifier returns REAUTH_REQUIRED / FORK_DETECTED.
Isolated registry (useful in tests):
SC_FORK_REGISTRY_ROOT=/tmp/my-app node your-app.js
Note: the default registry uses os.tmpdir(). Deployments on the same machine share it, which is what you want. For isolated per-instance registries, set SC_FORK_REGISTRY_ROOT.
See test/continuity-fork-attack.js for a verified scenario.
This is an early-stage library. The following limitations are documented explicitly.
No strict sequence enforcement. The engine accepts sequence jumps (e.g., 1 to 3) without verifying 2 exists.
No third-party security audit. The code has not been reviewed by an independent security team.
No BBS+ or ZK-SNARK privacy layer. Session identifiers and subjects are visible in the evidence bundle.
No hardware binding. Sessions are not bound to TPM, Secure Enclave, or any hardware root of trust.
Performance testing is limited. Revocation reachability was measured at 100 edges (11 ms). Larger graphs have not been benchmarked.
Fork protection is opt-in and shares state via the filesystem. Works within one machine or a shared mount, but is not distributed. A centralized service is planned for v0.4.0.
Beyond the core engine, three standalone cryptographic modules are implemented and tested independently.
src/delegation/ — signed chain of delegated authority. Verifier needs only the public key. Depth limit: 5.
Run tests: npm run test:delegation
src/transparency/ — append-only Merkle log for session events. Compatible with Certificate Transparency tooling.
Run tests: npm run test:transparency
src/revocation/ — given a revoked delegation edge, proves offline which agents lose authority and which survive via an independent path.
Run tests: npm run test:revocation
src/core/parent-binding.mjs and src/core/binding-store.mjs provide signed single-use commitments and a hash-chained consumed list. Tested in isolation but not yet wired into the core engine. Integration planned for v0.3.0.
src/core/fork-guard.mjs provides an exclusive lock per (session_id, parent_sequence). Tested in isolation. Integration deferred to v0.3.0.
OIDC/JWT validation is outside this engine. Caller supplies claims only after independent verification.
The test test/continuity-fork-attack.js demonstrates that the current
engine (v0.2.0) accepts two valid continuations from the same parent with
the same sequence.
This is documented and intentional for v0.2.0. It is NOT a bug.
Fork prevention requires a centralized coordination service (shared state across instances). Building this would change the project from a library into a stateful system. That decision is deferred to v0.3.0 and beyond.
The engine itself remains useful for:
It does not prevent an attacker who controls the same state from forking.
Cryptographic session continuity, delegation chains, and offline revocation proofs
JavaScript
0
12 commits
updated Oct 5, 2026
Cryptographic proof that an accepted application session is the legitimate continuation of the authenticated session that created it.
Modern applications authenticate users once, then hand them long-lived session tokens. Between authentication and the last request, nothing cryptographically proves that session #N is the same user as session #1.
Attackers exploit this gap:
Existing tools (JWT, PASETO, Macaroons) prove authorization, not continuity. This engine fills that gap.
Given a verified OIDC/JWT claim, session-continuity produces a signed, append-only proof that:
npm install
node bin/session-continuity.mjs authority-init --output ./authority
node bin/demo.mjs
Output: a verified provenance certificate under ./receipt/.
OIDC/JWT --> session-continuity --> Receipt
(external) Engine (portable)
|
v
Trust Authority
(external, immutable)
Key design: The trust authority is external to the receipt. Verification does not require calling home.
See SECURITY.md for the full model.
OIDC/JWT validation is outside this engine. Caller supplies claims only after independent verification.
v0.2.0 — specification-stable, test-covered, not yet audited by a third party. See CHANGELOG.md.
Apache 2.0 — see LICENSE.
See CONTRIBUTING.md.
Fork protection is implemented but disabled by default for backward compatibility.
Enable via environment variable:
SC_FORK_PROTECTION=enabled node your-app.js
When enabled, the engine uses fork-registry to block a second continuation from the same (anchor_fingerprint, parent_sequence). The verifier returns REAUTH_REQUIRED / FORK_DETECTED.
Isolated registry (useful in tests):
SC_FORK_REGISTRY_ROOT=/tmp/my-app node your-app.js
Note: the default registry uses os.tmpdir(). Deployments on the same machine share it, which is what you want. For isolated per-instance registries, set SC_FORK_REGISTRY_ROOT.
See test/continuity-fork-attack.js for a verified scenario.
This is an early-stage library. The following limitations are documented explicitly.
No strict sequence enforcement. The engine accepts sequence jumps (e.g., 1 to 3) without verifying 2 exists.
No third-party security audit. The code has not been reviewed by an independent security team.
No BBS+ or ZK-SNARK privacy layer. Session identifiers and subjects are visible in the evidence bundle.
No hardware binding. Sessions are not bound to TPM, Secure Enclave, or any hardware root of trust.
Performance testing is limited. Revocation reachability was measured at 100 edges (11 ms). Larger graphs have not been benchmarked.
Fork protection is opt-in and shares state via the filesystem. Works within one machine or a shared mount, but is not distributed. A centralized service is planned for v0.4.0.
Beyond the core engine, three standalone cryptographic modules are implemented and tested independently.
src/delegation/ — signed chain of delegated authority. Verifier needs only the public key. Depth limit: 5.
Run tests: npm run test:delegation
src/transparency/ — append-only Merkle log for session events. Compatible with Certificate Transparency tooling.
Run tests: npm run test:transparency
src/revocation/ — given a revoked delegation edge, proves offline which agents lose authority and which survive via an independent path.
Run tests: npm run test:revocation
src/core/parent-binding.mjs and src/core/binding-store.mjs provide signed single-use commitments and a hash-chained consumed list. Tested in isolation but not yet wired into the core engine. Integration planned for v0.3.0.
src/core/fork-guard.mjs provides an exclusive lock per (session_id, parent_sequence). Tested in isolation. Integration deferred to v0.3.0.
OIDC/JWT validation is outside this engine. Caller supplies claims only after independent verification.
The test test/continuity-fork-attack.js demonstrates that the current
engine (v0.2.0) accepts two valid continuations from the same parent with
the same sequence.
This is documented and intentional for v0.2.0. It is NOT a bug.
Fork prevention requires a centralized coordination service (shared state across instances). Building this would change the project from a library into a stateful system. That decision is deferred to v0.3.0 and beyond.
The engine itself remains useful for:
It does not prevent an attacker who controls the same state from forking.