fix: replace vulnerable Lightning transport and legacy crypto #19

Merged
thesimplekid merged 1 commit from fix/7-modern-transport into main 2026-10-09 14:21:44 +00:00
Owner

LDK connections no longer pull in the vulnerable h2 0.3 / rustls-webpki 0.101 stack. The replacement uses HTTP/2-only Hyper 1 and rustls 0.23, preserving gRPC trailers, the configured certificate trust root, official LDK types, and method/body/time-bound authentication. Unary responses and streamed messages are bounded; malformed, compressed, truncated, or unterminated responses fail. HTTP/2 keep-alive supports long-running event subscriptions.

L402 now uses a bounded first-party V2 codec, RustCrypto HMAC/SHA-256, constant-time signature comparison, and OS randomness. Existing persisted roots are used directly, so previously issued tokens remain valid. A frozen token produced by macaroon 0.3 verifies both serialization and signing compatibility. Fixture certificates use rcgen. The default dependency graph no longer includes OpenSSL, sodiumoxide, or libsodium; optional cdk-postgres still inherits native TLS/OpenSSL upstream. CDK continues to handle Cashu transport.

deny.toml, just deny, and a CI job enforce advisory, license, and source policy without MPL-2.0. The audit reproduces the original vulnerable graph and passes after the change. Three inherited maintenance notices (instant, paste, nostr-relay-pool) have explicit explanations; no vulnerability advisory is suppressed.

Validation: all-feature Clippy; 32 unit tests, 26 integration tests, and five doc tests; eight real PostgreSQL tests; API documentation; cargo deny check; and nix flake check path:. -L. New cases cover legacy tokens, unsupported caveats, truncation, oversized/compressed frames, fragmented/coalesced messages, ambiguous status, and terminal errors. The real two-node Bitcoin/LDK regtest passes manual capture and offline reconciliation using the replacement transport (and compatible CDK 0.18.1). Independent security patch review found no concrete bypasses or regressions. aarch64 was not checked.

Closes #7.

Stacked on #18; this PR contains the dependency and transport commit only.

Review follow-up: use the explicit GitHub URL for the Nix installation action; Forgejo otherwise resolves it against data.forgejo.org and fails before running checks.

LDK connections no longer pull in the vulnerable h2 0.3 / rustls-webpki 0.101 stack. The replacement uses HTTP/2-only Hyper 1 and rustls 0.23, preserving gRPC trailers, the configured certificate trust root, official LDK types, and method/body/time-bound authentication. Unary responses and streamed messages are bounded; malformed, compressed, truncated, or unterminated responses fail. HTTP/2 keep-alive supports long-running event subscriptions. L402 now uses a bounded first-party V2 codec, RustCrypto HMAC/SHA-256, constant-time signature comparison, and OS randomness. Existing persisted roots are used directly, so previously issued tokens remain valid. A frozen token produced by macaroon 0.3 verifies both serialization and signing compatibility. Fixture certificates use rcgen. The default dependency graph no longer includes OpenSSL, sodiumoxide, or libsodium; optional `cdk-postgres` still inherits native TLS/OpenSSL upstream. CDK continues to handle Cashu transport. `deny.toml`, `just deny`, and a CI job enforce advisory, license, and source policy without MPL-2.0. The audit reproduces the original vulnerable graph and passes after the change. Three inherited maintenance notices (`instant`, `paste`, `nostr-relay-pool`) have explicit explanations; no vulnerability advisory is suppressed. Validation: all-feature Clippy; 32 unit tests, 26 integration tests, and five doc tests; eight real PostgreSQL tests; API documentation; `cargo deny check`; and `nix flake check path:. -L`. New cases cover legacy tokens, unsupported caveats, truncation, oversized/compressed frames, fragmented/coalesced messages, ambiguous status, and terminal errors. The real two-node Bitcoin/LDK regtest passes manual capture and offline reconciliation using the replacement transport (and compatible CDK 0.18.1). Independent security patch review found no concrete bypasses or regressions. aarch64 was not checked. Closes #7. Stacked on #18; this PR contains the dependency and transport commit only. Review follow-up: use the explicit GitHub URL for the Nix installation action; Forgejo otherwise resolves it against data.forgejo.org and fails before running checks.
fix: replace vulnerable Lightning transport and legacy crypto
Some checks failed
Checks / checks (push) Failing after 2s
Checks / cdk-compatible (push) Failing after 3s
Checks / cdk-compatible (pull_request) Failing after 3s
Checks / format (push) Failing after 8s
Checks / postgres (push) Failing after 3s
Checks / dependencies (push) Failing after 2s
Checks / format (pull_request) Failing after 2s
Checks / checks (pull_request) Failing after 3s
Checks / postgres (pull_request) Failing after 2s
Checks / dependencies (pull_request) Failing after 2s
5e66a40469
Use HTTP/2-only Hyper and current rustls with official LDK message types
and request-bound authentication. Bound gRPC messages and validate terminal
status, including fragmented streaming responses and unary trailers.

Replace sodiumoxide-backed L402 macaroons and direct OpenSSL cryptography
with a bounded V2 codec, RustCrypto and the OS RNG. Preserve existing token
bytes, final root-key semantics and settlement identity across restarts.

Check advisories, licenses and sources in CI with cargo-deny. Exclude MPL
and document three inherited maintenance notices without suppressing any
vulnerability advisory. Optional CDK PostgreSQL still uses native TLS.

Closes #7.
thesimplekid force-pushed fix/7-modern-transport from 5e66a40469
Some checks failed
Checks / checks (push) Failing after 2s
Checks / cdk-compatible (push) Failing after 3s
Checks / cdk-compatible (pull_request) Failing after 3s
Checks / format (push) Failing after 8s
Checks / postgres (push) Failing after 3s
Checks / dependencies (push) Failing after 2s
Checks / format (pull_request) Failing after 2s
Checks / checks (pull_request) Failing after 3s
Checks / postgres (pull_request) Failing after 2s
Checks / dependencies (pull_request) Failing after 2s
to bfba5414b0
Some checks failed
Checks / checks (push) Has started running
Checks / format (push) Successful in 1m15s
Checks / cdk-compatible (push) Has started running
Checks / format (pull_request) Has been cancelled
Checks / checks (pull_request) Has been cancelled
Checks / cdk-compatible (pull_request) Has been cancelled
Checks / postgres (pull_request) Has been cancelled
Checks / postgres (push) Has been cancelled
Checks / dependencies (push) Has been cancelled
Checks / dependencies (pull_request) Has been cancelled
2026-10-09 14:16:46 +00:00
Compare
thesimplekid force-pushed fix/7-modern-transport from bfba5414b0
Some checks failed
Checks / checks (push) Has started running
Checks / format (push) Successful in 1m15s
Checks / cdk-compatible (push) Has started running
Checks / format (pull_request) Has been cancelled
Checks / checks (pull_request) Has been cancelled
Checks / cdk-compatible (pull_request) Has been cancelled
Checks / postgres (pull_request) Has been cancelled
Checks / postgres (push) Has been cancelled
Checks / dependencies (push) Has been cancelled
Checks / dependencies (pull_request) Has been cancelled
to 1e9e7230f3
Some checks failed
Checks / checks (push) Failing after 35m15s
Checks / format (push) Successful in 1m4s
Checks / postgres (pull_request) Successful in 16m23s
Checks / format (pull_request) Successful in 1m4s
Checks / cdk-compatible (pull_request) Successful in 11m35s
Checks / dependencies (pull_request) Successful in 1m19s
Checks / checks (pull_request) Failing after 35m6s
Checks / cdk-compatible (push) Failing after 12m14s
Checks / dependencies (push) Successful in 1m9s
Checks / postgres (push) Failing after 15m22s
2026-10-09 14:18:33 +00:00
Compare
thesimplekid changed target branch from fix/6-postgres-leases to main 2026-10-09 14:21:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thesimplekid/satsettle!19
No description provided.