From 2db5022c4bb37a834065f9579ba111668249a76f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 12:36:44 +0000 Subject: [PATCH] Remove sensitive URI information from logs Co-authored-by: SayanthRock <202829406+SayanthRock@users.noreply.github.com> --- .../com/rockmusic/app/data/local/LocalMusicRepository.kt | 4 ++-- pr_description.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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.