Skip to content

bundle: harden the pull's destination paths, Ctrl-C window and region filter #2439

Closed

Description

@thiras

Problem

Review of #2436 found four gaps in the bundle pull. All four exist on main today (crates/cli/src/commands/bundle_pull.rs); #2436 only moves the code into decdn_client::bundle. They matter more now that the engine is a public SDK API that embedders call directly.

  1. Destination containment is lexical. safe_join rejects .., absolute and prefix components, but writes follow an existing symlinked ancestor. If out/link -> /outside exists, the accepted entry link/file lands under /outside (create_dir_all, the temp file and the rename all follow the link). A manifest cannot create a symlink, so the link has to exist locally first. The containment should still hold against it: walk the destination with no-follow or openat-style resolution, and handle races.
  2. Ctrl-C is not watched during the manifest fetch. Interrupt::watch starts after the --hash manifest is obtained, so a Ctrl-C during that paid fetch takes the default exit. The fetch's queued watermark writes never settle, and the next run resyncs the lane. The watch should start before the manifest fetch, and the fetch should be cancellable.
  3. Engine-owned paths are not reserved. plan_slots reserves only .decdn-partial/. A manifest entry may name .decdn-manifest.json (the skip-cache) or a path under .decdn-bundles/ (the manifest cache). The pull then writes an entry where its own state lives: the skip-cache flush can overwrite the landed file, or the entry can corrupt the cache. Reject every engine-owned path, as for the staging dir.
  4. The bundle path ignores [client] region_allowlist. decdn fetch filters discovery candidates by the allowlist and widens back when too few remain (select_with_widening). A bundle pull samples the run's registry list region-first (entry_candidates) and never applies the allowlist. feat(client): add a public bundle pull, decdn_client::bundle #2436 documents this on PullSite::region_allowlist. Apply it with the same widening rule.

Found in review of #2436 (part of #2429).

Activity

  1. self-assigned this
    on Oct 12, 2026
  2. added
    kind:feature
    rust
    on Oct 12, 2026
  3. assigned and unassigned on Oct 12, 2026
  4. moved this from Backlog to In progress in deCDNon Oct 19, 2026
  5. added a commit that references this issue on Oct 19, 2026
    0f7de48
  6. moved this from In progress to Done in deCDNon Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featurerust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions