trails/packages
Ullrich Schäfer 01d4832edb
security: authorize and validate presigned upload requests
POST /api/v1/uploads minted an upload key from caller input with no
ownership check, no content-type allowlist, and the raw filename
interpolated into the S3 key.

- Ownership: a caller may only mint upload URLs for a route/activity
  they own, enforced via the branded loadOwnedRoute/loadOwnedActivity
  (404 on miss, no existence leak). Closes writing into another
  user's resource key-space.
- Content type: the request schema now constrains contentType to an
  image/gpx allowlist, so active content (HTML/SVG/JS) that would
  execute if served inline is rejected at the request boundary.
- Filename: sanitizeUploadFilename() reduces the client filename to a
  safe basename (charset-restricted, no path components, no leading
  dots, length-bounded) before it becomes part of the key.

Tests: schema allow/deny + filename sanitization in @trails-cool/api;
handler tests covering owned-success, not-owner 404, disallowed
content-type, and the route-vs-activity ownership branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 22:23:14 +02:00
..
api security: authorize and validate presigned upload requests 2026-06-10 22:23:14 +02:00
db one source of truth for Route/Activity shapes; enforce api contracts 2026-06-10 07:39:50 +02:00
fit chore(deps): bump the production group across 1 directory with 30 updates 2026-06-07 09:48:14 +00:00
gpx chore(ts): drop the last 2 \eslint-disable\ comments in prod code 2026-05-26 07:34:09 +02:00
i18n feat(journal): Garmin activity import — provider, webhook pipeline, backfill (§1–5) 2026-06-07 17:47:22 +02:00
jobs journal: typed job seam + Komoot credentials through the manager 2026-06-10 02:05:24 +02:00
map-core Add tests to all packages, remove passWithNoTests 2026-04-13 00:48:27 +02:00
sentry-config Fix sentry-config typecheck: explicit types: [node] in tsconfig 2026-04-18 00:43:48 +02:00
types one source of truth for Route/Activity shapes; enforce api contracts 2026-06-10 07:39:50 +02:00