CVE-2024-26132: Insufficient Information (NVD-CWE-noinfo)
value: Element Android is an Android Matrix Client. A third-party malicious application installed on the same phone can force Element Android, version 0.91.0 through 1.6.12, to share files stored under the `files` directory in the application's private data directory to an arbitrary room. The impact of the attack is reduced by the fact that the databases stored in this folder are encrypted. However, it contains some other potentially sensitive information, such as the FCM token. Forks of Element Android which have set `android:exported="false"` in the `AndroidManifest.xml` file for the `IncomingShareActivity` activity are not impacted. This issue is fixed in Element Android 1.6.12. There is no known workaround to mitigate the issue.
CWE description: There is insufficient information about the issue to classify it; details are unkown or unspecified.
Published: 2024-02-29T01:44Z
Repository: https://github.com/element-hq/element-android
Language: Other
Files changed: changelog.d/+picker.bugfix, library/multipicker/src/main/java/im/vector/lib/multipicker/utils/MediaFileUtils.kt, library/multipicker/src/main/res/xml/multipicker_provider_paths.xml
Commit date: 2024-02-16 11:51:56 +0100
Commit message: Store temporary files created for Camera in the media folder.

Diff: diff --git a/changelog.d/+picker.bugfix b/changelog.d/+picker.bugfix
new file mode 100644
index 0000000000..724d9a7355
--- /dev/null
+++ b/changelog.d/+picker.bugfix
@@ -0,0 +1 @@
+Store temporary files created for Camera in the media folder.
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/utils/MediaFileUtils.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/utils/MediaFileUtils.kt
index a029d5e6b1..5b40c4a789 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/utils/MediaFileUtils.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/utils/MediaFileUtils.kt
@@ -22,11 +22,11 @@ import java.text.SimpleDateFormat
 import java.util.Date
 import java.util.Locale
 
 internal fun createTemporaryMediaFile(context: Context, mediaType: MediaType): File {
     val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(Date())
-    val storageDir: File = context.filesDir.also { it.mkdirs() }
+    val storageDir: File = File(context.filesDir, "media").also { it.mkdirs() }
     val fileSuffix = when (mediaType) {
         MediaType.IMAGE -> ".jpg"
         MediaType.VIDEO -> ".mp4"
     }
 
diff --git a/library/multipicker/src/main/res/xml/multipicker_provider_paths.xml b/library/multipicker/src/main/res/xml/multipicker_provider_paths.xml
index ff9b81ce98..fd5f866c2b 100644
--- a/library/multipicker/src/main/res/xml/multipicker_provider_paths.xml
+++ b/library/multipicker/src/main/res/xml/multipicker_provider_paths.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <paths>
     <files-path
         name="external_files"
-        path="." />
-</paths>
\ No newline at end of file
+        path="media" />
+</paths>

Vulnerable code:     val storageDir: File = context.filesDir.also { it.mkdirs() }
        path="." />
</paths>
Fixed code: Store temporary files created for Camera in the media folder.
    val storageDir: File = File(context.filesDir, "media").also { it.mkdirs() }
        path="media" />
</paths>