Skip to content

🐛 fix(backup): confine member access - #1870

Merged
gaborbernat merged 2 commits into
mainfrom
fix/backup-confinement-1181
Aug 30, 2026
Merged

gaborbernat merged 2 commits into
mainfrom
fix/backup-confinement-1181

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Aug 30, 2026

Copy link
Copy Markdown
Member

Backup manifests could direct verification and restore outside the selected backup directory through absolute paths, parent traversal, or symlinks. Untrusted backup contents could make these operations read external files. 🔒

The backup root now stays open as a directory capability, and descriptor-relative, no-follow operations resolve each manifest member. Verification and restore enforce the same path validation and filesystem boundary, including metadata inspection and the second open before staging.

Closes #1181

@gaborbernat gaborbernat added the bug Something isn't working label Aug 30, 2026
@gaborbernat gaborbernat self-assigned this Aug 30, 2026
@codspeed

codspeed Bot commented Aug 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 23 untouched benchmarks
⏩ 139 skipped benchmarks1


Comparing fix/backup-confinement-1181 (cff1861) with main (bfcf6d5)

Open in CodSpeed

Footnotes

  1. 139 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Hold the backup root as a directory capability and resolve each manifest
member through descriptor-relative, no-follow opens. Verification and restore
reject traversal and symlink swaps through the shared boundary.

Closes #1181
The verifier can report a read error after opening `peryx.redb`. The test suite
did not exercise that path.

Run the verifier in a child process and replace the opened metadata descriptor
with `/dev/null` opened for writes. The parent test harness retains its own
descriptors.
@gaborbernat
gaborbernat force-pushed the fix/backup-confinement-1181 branch from 4b60f3f to cff1861 Compare August 30, 2026 08:28
@gaborbernat
gaborbernat merged commit aec1316 into main Aug 30, 2026
26 checks passed
@gaborbernat
gaborbernat deleted the fix/backup-confinement-1181 branch August 30, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confine backup manifest paths to the backup root

1 participant