Repository navigation
fix(security): Restrict authenticated media loader to its source URL - #2093
Conversation
843dff2 to
ba3ea5f
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Helper tests cover the exact-URL gate, but authenticated online audio/video playback still requires device validation of AVFoundation loading-request and redirect behavior that this review environment cannot provide.
No open issues 🎉
What changed in this PR
Restricts authenticated media loading to each asset’s original source URL, rejecting unexpected URLs before sending an authenticated request.
Changes:
- Binds the loader to its source URL and checks the scheme, host, port, path, and query.
- Adds tests for matching URLs, rejected alternatives, and custom-scheme wrapping.
No concrete security issue found in the reviewed kDrive trust boundaries.
Online audio and video playback still needs device verification.
| File | Description |
|---|---|
kDriveTests/kDriveCore/VideoPlayer/UTAuthenticatedMediaResourceLoader.swift |
Tests source matching and rejection of unexpected URLs. |
kDriveCore/VideoPlayer/AuthenticatedMediaAsset.swift |
Binds authenticated requests to the asset’s source URL. |
Review effort: Balanced
|
I did test on device both streamed content and offline content. |
ba3ea5f to
6852d8f
Compare
|



Summary
Tests
UTAuthenticatedMediaResourceLoader.kDriveTestsscheme passes locally (83 tests).To check