alby-hub/api
Roland edd283cdb2
fix: update encryption scheme for node migration files (#2539)
* fix: update encryption scheme for node migration files

Migration files are now encrypted with AES-CTR using a key derived via
Argon2 with a 32-byte salt, the same derivation used for encrypted
configuration values. Files created by earlier versions can still be
restored: the restore path detects the scheme by trial-decrypting the
archive header and checking for the ZIP file signature, which also
rejects an incorrect unlock password up front instead of extracting
garbage.

The migration screen now also tells users to never share their
migration file with anyone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: reword migration file warning

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: read full migration file header before detecting cipher scheme

io.ReadAtLeast can return once the smallest scheme's header is read,
which truncates the larger current-scheme header when the reader
delivers short reads (e.g. a network request body). Read the full
header and only tolerate a short read that still covers the smallest
scheme.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: extract migration files to a staging directory during restore

If extraction failed partway through, the partially populated restore
directory was left in the working directory, and the next startup would
apply the incomplete restore. Extract to a staging directory and only
move it into place after every entry has been extracted successfully.
Also reject archives that contain no files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: assert traversal-specific error in restore backup test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 22:14:49 +07:00
..
api.go fix: validate LND and CLN credential files during setup (#2528) 2026-08-11 15:05:56 +07:00
api_test.go feat: proposal: custom node commands (#1007) 2025-01-30 18:20:17 +07:00
apps_test.go fix: validate return_to redirect URLs (#2532) 2026-08-11 14:57:51 +07:00
backup.go fix: update encryption scheme for node migration files (#2539) 2026-08-12 22:14:49 +07:00
backup_test.go fix: update encryption scheme for node migration files (#2539) 2026-08-12 22:14:49 +07:00
esplora.go Adding checks for ok status code in responses (#2178) 2026-03-31 23:21:26 +05:30
lsp.go chore: update to use sat/msat suffixes everywhere (#2271) 2026-05-01 15:41:56 +05:30
models.go fix: keep showing migration success page after creating migration file (#2527) 2026-08-10 15:37:26 +07:00
rebalance.go chore: bump rebalance fees to ensure payment succeeds (#2470) 2026-07-29 14:31:18 +07:00
setup_test.go fix: validate LND and CLN credential files during setup (#2528) 2026-08-11 15:05:56 +07:00
transactions.go feat: filter transactions (#2464) 2026-08-07 10:52:14 +07:00
transactions_test.go feat: filter transactions (#2464) 2026-08-07 10:52:14 +07:00