CVE-2023-5321 (published 2023-09-30T14:15Z)

Missing Authorization in GitHub repository hamza417/inure prior to build94.

CVSS v3 base score: 5.5, MEDIUM (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N)

Weakness information:
cwe_id: CWE-862
cwe_name: Missing Authorization
description: The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
extended_description: 
            Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
            When access control checks are not applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.
         
         

Fix information:
repo_url: https://github.com/hamza417/inure
commit_details: repo_url: https://github.com/hamza417/inure
author: Hamza417
author_date: 2023-09-30 19:08:53+05:30
msg: Patched improper input validation vulnerability

FLAGS:
   - skip build apk
repository: repo_url: https://github.com/hamza417/inure
repo_name: Hamza417/Inure
description: An elegant and beautiful premium Android app manager for rooted and non-rooted devices with a built-in terminal, analytics, debloat, stats and various other panels with an independent custom theme engine, developed with purely custom APIs created for this app.
repo_language: Kotlin
owner: hamza417
file_changes: filename: changelogs.html
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,10 @@
     <li>Fixed audio player position skipping playback issue.</li>
     <li>Fixed WebView losing scroll state on rotation.</li>
 </ul>
+<h4>Security</h4>
+<ul>
+    <li>Patched <i>Improper Input Validation</i>.</li>
+</ul>
 <h4>Improvements</h4>
 <ul>
     <li>Optimized text loader frameworks for better text rendering.</li>

programming_language: HTML
filename: TextViewerActivity.kt
change_type: ModificationType.MODIFY
diff: @@ -1,11 +1,13 @@
 package app.simple.inure.activities.association
 
+import android.annotation.SuppressLint
 import android.os.Bundle
 import android.util.Log
 import app.simple.inure.R
 import app.simple.inure.extensions.activities.BaseActivity
 import app.simple.inure.ui.association.Text
 import app.simple.inure.util.ConditionUtils.invert
+import app.simple.inure.util.NullSafety.isNotNull
 import app.simple.inure.util.NullSafety.isNull
 
 class TextViewerActivity : BaseActivity() {
@@ -14,8 +16,6 @@ class TextViewerActivity : BaseActivity() {
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_main)
 
-        Log.d("TextViewerActivity", "onCreate: ${intent.data?.path}")
-
         if (savedInstanceState.isNull()) {
             if (hasAppPath().invert()) {
                 supportFragmentManager.beginTransaction()
@@ -27,7 +27,16 @@ class TextViewerActivity : BaseActivity() {
         }
     }
 
+    @SuppressLint("SdCardPath")
     private fun hasAppPath(): Boolean {
-        return intent.data?.path?.contains("data/data/$packageName")!!
+        if (intent.data.isNotNull()) {
+            val appDataPath = "/data/data/$packageName/"
+            val normalizedIntentPath = intent.data?.path?.replace("//+".toRegex(), "/") // Normalize multiple slashes
+            Log.d("TAG", "hasAppPath: $appDataPath")
+            Log.d("TAG", "hasAppPath: $normalizedIntentPath")
+            return normalizedIntentPath?.contains(appDataPath) == true
+        }
+
+        return false
     }
 }

programming_language: Scala