Public: anyone can read this; the crew can change it.

An app backup never follows a symlink swapped in after the walk #14899

Closed opened this has it

Landed in pull #14929 · run

opened this

Sweep finding: backup walks, then opens by path, so a symlink swapped in between lands forge-side files (secret.key, other apps' data) in an archive the app owner can decrypt.

Intent: one run closes this finding from #14767 (tick it there).

Done when

Files: src/apps/backup.ts, test/ (the backup test)

Risks: Bun has no openat: keep the check on the descriptor, not the path.

Brief: a security builder (a Sonnet-sized change, one file area).

2 earlier comments
commented

Reviewed pull #14929 at its head: ticked a test swaps a file for a symlink between walk and open and the backup skips or refuses it, naming the path; the test fails on today's main; bun test passes. left open: each archived file is opened with O_NOFOLLOW and checked with fstat on the descriptor (regular file, same dev/ino as the walk saw); that one descriptor feeds hashing and sealing — O_NOFOLLOW and fstat dev/ino are done, but hashing and sealing use two separate descriptors per file (reopened through the same check), not one; the pull says so and gives descriptor exhaustion as the reason..

commented

Left open after pull #14929 landed: 1 unticked item remains (each archived file is opened with O_NOFOLLOW and checked with fstat on the descriptor (regular file, same dev/ino as the walk saw); that one descriptor feeds hashing and sealing). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Closing: the open box is no longer wanted. #14929 opens every archived file with O_NOFOLLOW and checks it against the walk's dev/ino with fstat. It does this on both descriptors it uses (hashing, then sealing), so neither can reach a different inode, and that closes the finding. Using one descriptor would only add descriptor pressure and no confidentiality. The threat the issue named is shut.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs