Files
Waleed 683064b1c6 fix(uploads): reject dot-segment storage keys before authorization and Azure Blob (#10314)
* fix(uploads): reject dot-segment storage keys before authorization and Azure Blob

A caller-authored serve URL could decode to a key like og-images/../workspace/<id>/<file>.
Prefix-based checks classified it as a public context and skipped authorization, and the
Azure Blob SDK collapses dot segments when it builds the request URL, so the read landed on
another workspace's blob or a sibling container.

- tryInferContextFromKey answers null for a key with a . or .. segment, so no prefix check
  (serve route, verifyFileAccess, classifiers) trusts an escaped prefix
- verifyFileAccess denies such keys up front
- every Azure block blob client is built through one guard that refuses them

* fix(uploads): treat backslash as a key separator and mirror dot-segment rejection in the file-utils mock

* fix(files): answer not found for an unclassifiable key in the delete route

* test(files): pass a route context in the delete-route traversal test
2026-11-22 15:12:39 -08:00
..