Find Android-specific security smells
Recipe ID
org.openrewrite.kotlin.security.FindAndroidSecuritySmells$KtRecipeArtifact
io.moderne.recipe:recipes-kotlinDeprecated world-readable/writeable file modes, WebView JavaScript enablement and addJavascriptInterface exposure, plaintext SharedPreferences for sensitive data, and implicit Intent broadcasts that any app on the device can intercept.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.kotlin.security.FindAndroidSecuritySmells$KtRecipeIf the recipe isn’t available locally, install it with:
mod config recipes jar install io.moderne.recipe:recipes-kotlin:0.2.0Definition
This recipe runs the following recipes in order.
- Find
MODE_WORLD_READABLEreferencesorg.openrewrite.kotlin.security.FindModeWorldReadable$KtRecipe - Find
WebView.settings.javaScriptEnabled = true/setJavaScriptEnabled(true)org.openrewrite.kotlin.security.FindWebViewJavaScriptEnabled$KtRecipe - Find
WebView.addJavascriptInterface(...)callsorg.openrewrite.kotlin.security.FindWebViewAddJsInterface$KtRecipe - Find
getSharedPreferences(_, MODE_PRIVATE)callersorg.openrewrite.kotlin.security.FindSharedPreferencesForSensitiveData$KtRecipe - Find
Intent("some.implicit.action")constructionsorg.openrewrite.kotlin.security.FindIntentExplicitActionLiteral$KtRecipe - Find
WebView.loadUrl("http://...")callsorg.openrewrite.kotlin.security.FindWebViewLoadUrlHttp$KtRecipe - Find
WebView.settings.mixedContentMode = MIXED_CONTENT_ALWAYS_ALLOWsettingsorg.openrewrite.kotlin.security.FindWebViewSetMixedContentAlwaysAllow$KtRecipe - Find
WebView.settings.setAllowFileAccessFromFileURLs(true)callsorg.openrewrite.kotlin.security.FindWebViewSetAllowFileAccessTrue$KtRecipe - Find
WebView.settings.setSavePassword(true)callsorg.openrewrite.kotlin.security.FindWebViewSavePassword$KtRecipe
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats