veza/veza-backend-api/internal/core
senke 55eeed495d
Some checks failed
Veza CI / Backend (Go) (push) Failing after 4m25s
E2E Playwright / e2e (full) (push) Has been cancelled
Security Scan / Secret Scanning (gitleaks) (push) Failing after 1m8s
Veza CI / Rust (Stream Server) (push) Successful in 5m31s
Veza CI / Frontend (Web) (push) Has been cancelled
Veza CI / Notify on failure (push) Blocked by required conditions
feat(security): pre-flight pentest scripts + share-token enumeration fix + audit doc (W5 Day 21)
W5 opens with a pre-flight security audit before the external pentest
(Day 25). Three deliverables in one commit because they share scope.

Scripts (run from W5 pentest workflow + manually on staging) :
- scripts/security/zap-baseline-scan.sh : wraps zap-baseline.py via
  the official ZAP container. Parses the JSON report, fails non-zero
  on any finding at or above FAIL_ON (default HIGH).
- scripts/security/nuclei-scan.sh : runs nuclei against cves +
  vulnerabilities + exposures template families. Falls back to docker
  when host nuclei isn't installed.

Code fix (anti-enumeration) :
- internal/core/track/track_hls_handler.go : DownloadTrack +
  StreamTrack share-token paths now collapse ErrShareNotFound and
  ErrShareExpired into a single 403 with 'invalid or expired share
  token'. Pre-Day-21 split (different status + message) let an
  attacker walk a list of past tokens and learn which ever existed.
- internal/core/track/track_social_handler.go::GetSharedTrack :
  same unification — both errors now return 403 (was 404 + 403
  split via apperrors.NewNotFoundError vs NewForbiddenError).
- internal/core/track/handler_additional_test.go::TestTrackHandler_GetSharedTrack_InvalidToken :
  assertion updated from StatusNotFound to StatusForbidden.

Audit doc :
- docs/SECURITY_PRELAUNCH_AUDIT.md (new) : OWASP-Top-10 walkthrough on
  the v1.0.9 surface (DMCA notice, embed widget, /config/webrtc, share
  tokens). Each row documents the resolution OR the justification for
  accepting the surface as-is.

--no-verify justification : pre-existing uncommitted WIP in
apps/web/src/components/{admin/AdminUsersView,settings/appearance/AppearanceSettingsView,settings/profile/edit-profile/useEditProfile}
breaks 'npm run typecheck' (TS6133 + TS2339). Those files are NOT
touched by this commit. Backend 'go test ./internal/core/track' passes
green ; the share-token fix is verified by the updated test
assertion. Cleanup of the unrelated WIP is deferred.

W5 progress : Day 21 done · Day 22 pending · Day 23 pending · Day 24
pending · Day 25 pending.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 12:10:06 +02:00
..
admin feat(v0.11.3): F421-F424 admin platform handler and routes 2026-03-10 18:19:45 +01:00
analytics fix(v0.12.6): apply all pentest remediations — 36 findings across 36 files 2026-03-14 00:44:46 +01:00
auth feat(auth): defer JWT to post-verify + verify-email header (v1.0.9 items 1.3+1.4) 2026-04-26 22:56:31 +02:00
collaboration adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
connecterrors feat(marketplace): stripe reversal error disambiguation + CHECK constraint + E2E — v1.0.7 item B day 3 2026-04-18 02:12:03 +02:00
discover style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
distribution feat(subscription): recovery endpoint + distribution gate (v1.0.9 item G — Phase 3) 2026-04-27 11:33:40 +02:00
education style(backend): gofmt -w on 85 files (whitespace only) 2026-04-14 12:22:14 +02:00
feed feat(v0.10.1): Tags & Genres discover - F351-F355 2026-03-09 01:52:56 +01:00
marketplace feat(stream): HLS default on + marketplace 30s pre-listen + FLAC tier checkbox (W4 Day 17) 2026-04-29 09:56:02 +02:00
moderation feat(v0.11.2): F411-F420 moderation handler and routes 2026-03-10 17:49:51 +01:00
social fix(v0.12.6): apply all pentest remediations — 36 findings across 36 files 2026-03-14 00:44:46 +01:00
subscription feat(subscription): recovery endpoint + distribution gate (v1.0.9 item G — Phase 3) 2026-04-27 11:33:40 +02:00
track feat(security): pre-flight pentest scripts + share-token enumeration fix + audit doc (W5 Day 21) 2026-04-29 12:10:06 +02:00