diff --git a/app/src/main/java/com/rockmusic/app/data/local/LocalMusicRepository.kt b/app/src/main/java/com/rockmusic/app/data/local/LocalMusicRepository.kt index 968814c..a10622f 100644 --- a/app/src/main/java/com/rockmusic/app/data/local/LocalMusicRepository.kt +++ b/app/src/main/java/com/rockmusic/app/data/local/LocalMusicRepository.kt @@ -172,7 +172,7 @@ class MediaStoreLocalMusicRepository @Inject constructor( if (!hasPersistedReadAccess) { Log.w( TAG, - "Persistent read access was not granted for $uri; the file may need to be selected again after restart.", + "Persistent read access was not granted for the file; it may need to be selected again after restart.", ) } @@ -251,7 +251,7 @@ class MediaStoreLocalMusicRepository @Inject constructor( } catch (error: CancellationException) { throw error } catch (error: Throwable) { - Log.w(TAG, "Skipping unreadable audio URI: $uri", error) + Log.w(TAG, "Skipping unreadable audio URI", error) null } } diff --git a/pr_description.md b/pr_description.md index 11bc1b5..296afa2 100644 --- a/pr_description.md +++ b/pr_description.md @@ -1,3 +1,3 @@ -🎯 What: Added tests for `EncryptedSpotifyPkceRequestStore` to address the untested timing edge case in `consume` and ensure proper behavior when the request is expired, valid, or has a mismatched state. -📊 Coverage: Added coverage for `consume` (valid request, expired request, incorrect state) and `clearExpired` (valid request, expired request). -✨ Result: Improved reliability of the Spotify PKCE request handling by explicitly validating the `System.currentTimeMillis()` based expiration logic. +🎯 **What:** Removed sensitive URI information from error and warning logs in `LocalMusicRepository.kt`. +⚠️ **Risk:** If an attacker gains access to the application logs (e.g., through logcat on a compromised device or via another vulnerability), they could potentially obtain sensitive file paths or document URIs that point to user data. +🛡️ **Solution:** Replaced the `$uri` string interpolation in `Log.w` statements with generic placeholders ("the file" and "audio URI") to prevent the exact path from being leaked into the system logs while retaining the diagnostic value of the warning.