All problems

Archive Root Prefix Check Exposes Sibling Directory Files

Level 2 · node · Security · Directory boundary missing from path prefix authorization

Scenario

A fictional field archive service stores absolute document paths by site and only permits access to files beneath an operator-approved archive root. The current implementation checks a plain string prefix, so a root of /vault/team also permits files in /vault/team-backup. Inspect the repository, service, and controller authorization flow.

Requirements

Allow only the archive root itself and paths within its directory boundary. Preserve trailing-slash handling, legitimate nested file access, site isolation, unknown document responses, and invalid registration rejection.

Acceptance criteria

  • A sibling directory sharing the root's name prefix is denied.
  • A nested file inside the root is allowed.
  • A file directly beneath the root is allowed regardless of a trailing slash.
  • Documents remain isolated by site.
  • Invalid registration input is rejected.
  • An unknown document returns HTTP 404.