Skip to content

feat(scallion): experimental layered encrypted hop frames with replay/tamper tests - #395

Open
ralyodio wants to merge 6 commits into
masterfrom
feat/scallion-encrypted-hop-frames
Open

ralyodio wants to merge 6 commits into
masterfrom
feat/scallion-encrypted-hop-frames

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

Experimental authenticated hop-frame primitive — not yet a VPN

Deliver a first testable cryptographic data-plane building block after route planner #383 / bootstrap #384 / exit admission #388 / optional client selection #390.

Code

c0mpute_net::scallion_frames provides:

  • Nested three-hop guard→middle→exit encryption using X25519 ECDH, per-circuit HKDF-SHA256 keys and AES-256-GCM, all existing workspace dependencies.
  • Unique random circuit ID and per-hop ephemeral client keys; internal monotonic sender sequence (no caller-chosen nonce).
  • Strict binary frame version/size validation, AEAD AAD binds circuit, role, ephemeral key, sequence and length.
  • Per-relay authentication/decryption of one hop, yielding next-hop identity and opaque remainder; replay/out-of-order rejection for a single ordered stream, rejecting malformed IDs, low-order keys, tampering, duplicate relay identities and keys.
  • Unit tests for three-hop nested decryption, sequential frames, tamper/circuit mismatch, wrong relay secret, duplicates, oversized input.
  • Update Cargo.lock, crate dependencies, public module, and detailed limitations at docs/protocol/scallion-frames.md.

Run

cargo test -p c0mpute-net --locked scallion_frames
cargo test --workspace --locked

IMPORTANT — Not security-audited; no live network yet

This change does not bind relay X25519 keys to authenticated libp2p identities, provide ephemeral-ephemeral authenticated handshake/forward secrecy, deliver frames on P2P streams, expose SOCKS5/TUN or OpenVPN server, protect DNS, operate exit nodes, or provide real anonymity. Long-lived relay keys compromise recorded frames; a single ordered stream cannot tolerate packet reordering or resume counters after crash. It is deliberately not wired to user traffic or public listeners.

Requires a fully reviewed authenticated forward-secret handshake, stream mux, per-connection resource controls, adversarial E2E and independently assessed security design before anything resembling a public VPN can be enabled. Tracks #386 and #389.

Merge only after full required Rust/security CI is green and module remains inaccessible as a live service. No evasion of export controls, sanctions or mandated service-level KYC.

@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

14 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 8 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
HIGH sh-remote-script-execution scripts/install.sh:611
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:109
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:116
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:117
MEDIUM sql-template-interpolation apps/web/src/lib/chat/push.ts:476
MEDIUM js-dynamic-code-execution apps/web/src/lib/router/verify.ts:91
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1171
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

This branch has not been deployed

No deployments
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