fix: fail closed without vss auth - #665
Conversation
Greptile SummaryThe PR removes unauthenticated VSS fallback behavior so backup and Lightning-node initialization fail closed when LNURL-auth is unavailable.
Confidence Score: 5/5The PR appears safe to merge and consistently enforces fail-closed VSS authentication across the changed setup paths. The backup client and Lightning builder now reject missing LNURL-auth rather than selecting unauthenticated construction, while preserving authenticated setup and stale-monitor recovery behavior.
|
| Filename | Overview |
|---|---|
| Bitkit/Services/LightningService.swift | Removes fixed-header VSS node construction and rejects empty LNURL-auth configuration before either normal or stale-monitor-recovery builds. |
| Bitkit/Services/VssBackupClient.swift | Removes unauthenticated backup-client fallback and consistently reports the shared authentication-required error. |
| Bitkit/Utilities/Errors.swift | Adds localized handling for the new vssAuthRequired service error. |
| changelog.d/next/fail-closed.security.md | Accurately records that wallet backups no longer fall back to unauthenticated VSS. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[VSS or Lightning setup] --> B{LNURL-auth configured?}
B -- No --> C[Throw vssAuthRequired]
B -- Yes --> D[Build authenticated VSS client or node]
D --> E{Build succeeds?}
E -- Yes --> F[Setup complete]
E -- DangerousValue --> G[Enable stale monitor recovery]
G --> H[Retry authenticated node build]
E -- Other error --> I[Propagate setup failure]
Reviews (1): Last reviewed commit: "fix: fail closed without vss auth" | Re-trigger Greptile
jvsena42
left a comment
There was a problem hiding this comment.
Self-contained PR, no issues found
|
@ben-kaufman conflict |
43a0272 to
4a19901
Compare
|
#673 bumps vss-rust-client-ffi to |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
638c058 to
8b05ef6
Compare
ovitrif
left a comment
There was a problem hiding this comment.
Fail-closed LNURL-auth is enforced on backup and Lightning setup, and pending channel-migration data is retained if setup fails.
This PR fails closed when LNURL-auth is missing so wallet backups cannot fall back to unauthenticated VSS.
Description
Removes the unauthenticated VSS client fallback. If LNURL-auth is not configured, backup setup and Lightning node build now error instead of using a public encryption key or fixed-header VSS.
Env currently always sets an LNURL-auth URL, so this is a footgun fix rather than a user-visible change on production configs.
Related: synonymdev/audit#55 (BITKIT-SEC-003). Library-side rejection is in synonymdev/vss-rust-client-ffi.
Linked Issues/Tasks
Screenshot / Video
N/A
QA Notes
Manual Tests
regression:empty LNURL-auth URL → VSS setup and node build fail instead of using unauthenticated VSS.Automated Checks
ChannelMigrationPersistenceTestscoverage for retaining migration data on setup failure, clearing it after success, and preserving a newer pending migration.Made with Cursor