You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/10/06 11:47:09 UTC

[GitHub] [cordova-android] Binuka97 opened a new issue, #1504: Google Play Console: App rejected due to Intent Redirection vulnerability

Binuka97 opened a new issue, #1504:
URL: https://github.com/apache/cordova-android/issues/1504

   # Bug Report
   
   ## Problem
   Google Play Console: App rejected due to Intent Redirection vulnerability,
   org.apache.cordova.CordovaInterfaceImpl.startActivityForResu
   
   ### What is expected to happen?
   App should approve and publish without any issues
   
   
   ### What does actually happen?
   App rejects during the google play console review process
   
   
   ## Information
   Cordova Android application gets rejected during the play store review process. And their response is this,
   
   We rejected xx with package name xx, for violating our Device and Network Abuse or User Data policy. This app uses software that contains security vulnerabilities for users or allows the collection of user data without proper disclosure.
   
   The issue comes from this: org.apache.cordova.CordovaInterfaceImpl.startActivityForResult
   
   ![image](https://user-images.githubusercontent.com/33131182/194303536-41514ac5-c9f9-4776-9877-ac72d932a3f7.png)
   
   The app .apk file works on Android devices without any issues.  
   
   
   ### Command or Code
   
   AndroidManifest.xml
   ```
   <?xml version='1.0' encoding='utf-8'?>
   <manifest android:hardwareAccelerated="true" android:versionCode="11400" android:versionName="1.14.0" package="com.directfn.mobile.anbi_prod" xmlns:android="http://schemas.android.com/apk/res/android">
       <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
       <uses-permission android:name="android.permission.INTERNET" />
       <application android:allowBackup="false" android:debuggable="false" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:usesCleartextTraffic="true">
           <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize"
               android:exported="true">
               <intent-filter android:label="@string/launcher_name">
                   <action android:name="android.intent.action.MAIN" />
                   <category android:name="android.intent.category.LAUNCHER" />
               </intent-filter>
           </activity>
       </application>
       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
       <uses-permission android:name="android.permission.USE_FINGERPRINT" />
   </manifest>
   ```
   Cordova package_mobile.json
   ```
   {
     "dependencies": {},
     "devDependencies": {
       "com.darktalker.cordova.screenshot": "git+https://github.com/gitawego/cordova-screenshot.git",
       "cordova-android": "^9.1.0",
       "cordova-pdf-generator": "^2.1.1",
       "cordova-plugin-androidx": "^3.0.0",
       "cordova-plugin-app-version": "^0.1.12",
       "cordova-plugin-datepicker": "^0.9.3",
       "cordova-plugin-dialogs": "^2.0.2",
       "cordova-plugin-inappbrowser": "^5.0.0",
       "cordova-plugin-iroot": "^3.1.0",
       "cordova-plugin-listpicker": "file:cordova-plugin-listpicker",
       "cordova-plugin-market": "git+https://github.com/xmartlabs/cordova-plugin-market.git",
       "cordova-plugin-screen-orientation": "^3.0.2",
       "cordova-plugin-android-sms-autoread": "git+https://github.com/hatchyard/cordova-plugin-android-sms-autoread.git",
       "cordova-plugin-splashscreen": "git+https://github.com/apache/cordova-plugin-splashscreen.git",
       "cordova-plugin-whitelist": "^1.3.5",
       "cordova-support-android-plugin": "^1.0.2",
       "es6-promise-plugin": "^4.2.2",
       "cordova-plugin-android-fingerprint-auth": "^1.5.0"
     },
     "cordova": {
       "platforms": [
         "android"
       ],
       "plugins": {
         "com.darktalker.cordova.screenshot": {},
         "cordova-plugin-datepicker": {},
         "cordova-plugin-dialogs": {},
         "cordova-plugin-listpicker": {},
         "cordova-plugin-screen-orientation": {},
         "cordova-plugin-whitelist": {},
         "cordova-plugin-iroot": {
           "ENABLE_BUSYBOX_CHECK": "true"
         },
         "cordova-plugin-android-sms-autoread": {},
         "cordova-plugin-splashscreen": {},
         "cordova-plugin-inappbrowser": {},
         "cordova-plugin-app-version": {},
         "cordova-plugin-market": {},
         "cordova-pdf-generator": {},
         "cordova-plugin-android-fingerprint-auth": {}
       }
     }
   }
   ```
   
   
   
   ### Environment, Platform, Device
   Android
   Google Play Console App Review
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Google Play Console: App rejected due to Intent Redirection vulnerability [cordova-android]

Posted by "dariosalvi78 (via GitHub)" <gi...@apache.org>.
dariosalvi78 commented on issue #1504:
URL: https://github.com/apache/cordova-android/issues/1504#issuecomment-1819745585

   [registerForActivityResult](https://developer.android.com/training/basics/intents/result) can only be called inside onCreate, which is not exposed in plugins, adding support for registerForActivityResult would allow plugin developers to use the newer method


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] veronicatc commented on issue #1504: Google Play Console: App rejected due to Intent Redirection vulnerability

Posted by GitBox <gi...@apache.org>.
veronicatc commented on issue #1504:
URL: https://github.com/apache/cordova-android/issues/1504#issuecomment-1283095524

   I have found this, could it help?
   [https://stackoverflow.com/questions/62671106/onactivityresult-method-is-deprecated-what-is-the-alternative](https://stackoverflow.com/questions/62671106/onactivityresult-method-is-deprecated-what-is-the-alternative)
   
   It says that startActivityForResult has been deprecated and it shows different ways to approach the change. 
   
   Extracted from the link above:
   
   ```
   public void openSomeActivityForResult() {
       Intent intent = new Intent(this, SomeActivity.class);
       someActivityResultLauncher.launch(intent);
   }
   
   // You can do the assignment inside onAttach or onCreate, i.e, before the activity is displayed
   ActivityResultLauncher<Intent> someActivityResultLauncher = registerForActivityResult(
           new ActivityResultContracts.StartActivityForResult(),
           new ActivityResultCallback<ActivityResult>() {
               @Override
               public void onActivityResult(ActivityResult result) {
                   if (result.getResultCode() == Activity.RESULT_OK) {
                       // There are no request codes
                       Intent data = result.getData();
                       doSomeOperations();
                   }
               }
           });
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1504: Google Play Console: App rejected due to Intent Redirection vulnerability

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1504:
URL: https://github.com/apache/cordova-android/issues/1504#issuecomment-1270107940

   This is going to be difficult to find the root but I think the issue might be mixture of Cordova's very generic handling of intents and plugins that may start intents while the app contains sensitive permissions (such as SMS reading).
   
   Google is a bit vague but does document the general issues and remediation for [Intent Redirection](https://support.google.com/faqs/answer/9267555?hl=en). There isn't specific thing that can trigger this issue.
   
   Due to the nature of this issue, I'll recommend forking `cordova-android` so that you can implement some suggestions in documented in the Google link above. If you make a change that Google then accepts, please do post your findings or perhaps even make a PR if the solution is generic enough.
   
   Code in Question:
   https://github.com/apache/cordova-android/blob/954d3e0e7542356e6ea995ddc75dcb1db8bb36cc/framework/src/org/apache/cordova/CordovaInterfaceImpl.java#L66-L74
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org