Files
nick-doc/Issues/ISSUE-135-backend-uploads-directory-served-without-authentication.md
Siavash Sameni dceaf82934 audit: 2026-05-30 full-codebase audit — report, issues, docs, runbooks
Full-codebase-audit 2026-05-30 outputs:
- Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md
- 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer).
- Scanner docs from scratch (was zero): architecture, data model, API ref, payment
  flow, operations runbook + repo README.
- Doc-sync updates across API reference, data models, flows, design system.
- Secret Rotation Runbook (08 - Operations) for the exposed credentials.
- Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js.

Issues remain status:open intentionally — the code fixes are uncommitted-then-committed
working-tree changes per repo and aren't "resolved" until merged/deployed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 18:48:04 +04:00

42 lines
1.5 KiB
Markdown

---
issue: 135
title: "Backend: uploads directory served without authentication — documents guessable by filename"
severity: low
domain: File Management
labels: [security, backend, authorization]
status: open
created: 2026-05-30
source: Full Codebase Audit 2026-05-30
---
# Backend: uploads directory served without authentication — documents guessable by filename
**Severity:** low
**Domain:** File Management
**Labels:** security, backend, authorization
## Description
`backend/src/app.ts:465` serves the `uploads/` directory as static files without any authentication middleware. Anyone who knows or guesses a filename can download it directly. This affects sensitive documents (ID uploads, delivery evidence) as well as public assets (avatars).
Additionally, `fileController.ts:146-148` copies files with verbatim original filenames, which are often predictable (e.g. `passport.jpg`).
## Options
1. Serve sensitive docs through an authenticated route with ownership checks; keep avatars public.
2. Require signed/expiring URLs for all uploads.
3. Move uploads to object storage with access policies.
## Recommendation
Route document downloads through an authenticated, ownership-checked handler (keep public assets like avatars open); consider signed URLs for sensitive files.
## Affected Files
- `backend/src/app.ts:465`
- `backend/src/services/file/fileController.ts:146-148`
## References
- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-80