Oversecured Sample Report Android
Oversecured Sample Report Android
com
ovaa-debug.apk
App ID oversecured.ovaa Version 1.0
Statistics
44 vulnerabilities found
List of vulnerabilities
Arbitrary code execution gives an attacker unrestricted To avoid arbitrary code execution, the application should
capabilities and the ability to perform any actions in the context sanitize all data received or change its architecture to prevent
of an attacked application. The attacker thus gains access to all unintended access to sensitive components.
the application's functions and to any sensitive information to
which the application has access.
Links
https://blog.oversecured.com/Android-arbitrary-code-execution-via-third-party-package-contexts/
https://cwe.mitre.org/data/definitions/94.html
Arbitrary code execution gives an attacker unrestricted To avoid arbitrary code execution, the application should
capabilities and the ability to perform any actions in the context sanitize all data received or change its architecture to prevent
of an attacked application. The attacker thus gains access to all unintended access to sensitive components.
the application's functions and to any sensitive information to
which the application has access.
Links
https://blog.oversecured.com/Android-arbitrary-code-execution-via-third-party-package-contexts/
https://cwe.mitre.org/data/definitions/94.html
An attacker has the ability to obtain the contents of arbitrary The developer must control the paths by which the app can
files to which a legitimate app has access. Most often, the obtain access to the path to a file it intends to process.
interesting files will be stored in /data/data/<package_name>/*
directories, which may include, for instance, user content or
authentication tokens, but an attacker may also use this
vulnerability to obtain user documents stored on the same
device.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/359.html
https://cwe.mitre.org/data/definitions/20.html
An attacker has the ability to obtain the contents of arbitrary The developer must control the paths by which the app can
files to which a legitimate app has access. Most often, the obtain access to the path to a file it intends to process.
interesting files will be stored in /data/data/<package_name>/*
directories, which may include, for instance, user content or
authentication tokens, but an attacker may also use this
vulnerability to obtain user documents stored on the same
device.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/359.html
https://cwe.mitre.org/data/definitions/20.html
An attacker has the ability to start components in the name of The app must refrain from broadcasting intents to system
the app, which lets them bypass Android's built-in protection methods like startActivity, startService, etc., directly. Instead, it
and gain access to any — even unexported activity or service. should construct an intent independently and explicitly define
The attack may come from any app installed on the same the receiver.
device, or if the Intent.parseUri() method is used by a malware
site, because one of the exported components contains a
nested intent and broadcasts its
startActivity/startActivityForResult/startService method without
the necessary checks.
Links
https://blog.oversecured.com/Android-Access-to-app-protected-components/
https://cwe.mitre.org/data/definitions/926.html
https://cwe.mitre.org/data/definitions/940.html
Cross-site scripting
Found in the file A ndroidManifest.xml
8 <activity android:name="oversecured.ovaa.activities.DeeplinkActivity">
9 <intent-filter>
10 <action android:name="android.intent.action.VIEW"/>
11 <category android:name="android.intent.category.DEFAULT"/>
12 <category android:name="android.intent.category.BROWSABLE"/>
13 <data android:scheme="oversecured" android:host="ovaa"/>
14 </intent-filter>
15 </activity>
XSS or Cross-site scripting is a kind of attack where malicious Before insertion, client data should be correctly sanitized using
scripts are inserted into a WebView page. In most cases the methods like URLDecoder.encode(). In this case, all
inputs received from untrusted sources like public broadcast metacharacters will be escaped. In other cases, XSS is the
receivers, unprotected activities, or world-readable/writable result of insecure application architecture, when it trusts data
directories are not properly filtered and are output directly onto received from unprotected inputs.
the page that is being rendered within WebView. JavaScript will
be executed when the developer has allowed it explicitly via
WebSettings.setJavaScriptEnabled(true) (by default it's
disabled). In other cases, it can still be used for Content
Spoofing (content injections). Execution of malicious scripts
might cause unintended information leakage, modification of
settings on server side via bypassed CSRF protection, and
more. On mobile there is a risk that the script may access
JavaScript interfaces that are intended for communication
between the application and scripts running inside the browser,
thus exposing internal application logic and functionality.
Links
Links
https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
https://arxiv.org/ftp/arxiv/papers/1304/1304.7451.pdf
https://cwe.mitre.org/data/definitions/79.html
The app starts an activity, and an attacker has the ability to The developer should restrict the ability to set an arbitrary Uri
process the call (for example, if it is an unclear intent or if it is in the Intent's data parameter, or else remove the flags
possible to control the processing activity). Flags are also granting read and write access for the Intent in question.
installed for an intent permitting Uri access via the
FLAG_GRANT_READ_URI_PERMISSION,
FLAG_GRANT_WRITE_URI_PERMISSION, etc., parameters, and
the attacker has the ability to control the Uri that is passed. If
all these conditions are met, the app that is started will have
access to an arbitrary content provider where the
android:exported="false" but
android:grantUriPermission="true".
Links
https://blog.oversecured.com/Gaining-access-to-arbitrary-Content-Providers/
https://cwe.mitre.org/data/definitions/926.html
The application uses external storage (SD card) to read/write Stop storing executable files, configuration files, databases, and
data. The data stored in external storages can be read and sensitive user data on an SD card.
modified by any third-party applications installed on the same
mobile device, which can lead to information leaks, data
tampering, or other security breaches. It was determined that
the application stored executable libraries or scripts, application
files (APK), or files with potentially sensitive content. For
instance, if an application stores its third-party .so libraries or
.lua scripts on external media, these libraries can be modified
by a malware application, which in turn may lead to arbitrary
code execution in the context of the running application.
Links
https://cwe.mitre.org/data/definitions/921.html
https://owasp.org/www-project-mobile-top-10/2016-risks/m2-insecure-data-storage
A token or password was found. It might be used by an The developer should not hardcode such sensitive data, to
attacker to access restricted services which will cause prevent leakages.
information leakage, unwanted server setting changes, or other
kinds of unrestricted service accesses or modifications.
Links
https://cwe.mitre.org/data/definitions/312.html
The cryptographic key is hardcoded in the app. It can be used The developer shouldn't hardcode encryption keys. Instead, we
by an attacker to encrypt or decrypt sensitive data, substitute a recommend using secure key creation and storage systems
different digital signature, etc., reducing this level of data such as the Android keystore system.
security to nil.
Links
https://developer.android.com/training/articles/keystore
https://cwe.mitre.org/data/definitions/312.html
Using implicit activity start is dangerous since the component is Always use explicit intents to start activities using the
not set and Android OS asks the user what actually to start. setComponent, setPackage, setClass or setClassName methods
Using a malware application, an attacker can register their own of the Intent class.
activity with action from the intent in AndroidManifest.xml and
specify a 999 priority in intent-filter. When startActivity or its
equivalent is executed, a dialog with a set of all possible
applications will be shown with the malware in the first place. If
the user selects the fake application, the activity start with
intent extras will be hijacked and in most cases it will lead to
disclosure of sensitive information. In case of
startActivityForResult, there is an additional risk related to
resulting data. When the call is hijacked, the attacker's activity
may use a setResult(...) call to transmit arbitrary data to the
onActivityResult() method of the victim activity, which will
cause content spoofing.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/927.html
An attacker has the ability to force the app to connect to an The app should either protect functionality responsible for the
arbitrary internet service (such as a web server). This can be connection to internet services, for instance, by using
used by malware apps on the same device to create internet unexported services, or else restrict the list of servers to which
queries without the corresponding permission a connection can be made. With WebView, there is also the
(android.permission.INTERNET). In some cases this vulnerability possibility of showing the user the domain name or the entire
can help to deceive the application, leading it to think it's URL from which the content originates, helping the user to
communicating with a legitimate server: the results can be the make sure the site address is correct.
leakage of confidential data (such as tokens or passwords), or
display to the user of content controlled by the attacker.
Links
https://cwe.mitre.org/data/definitions/451.html
https://cwe.mitre.org/data/definitions/346.html
https://en.wikipedia.org/wiki/Spoofed_URL
The app stores device logs using a path that is accessible for an It is recommended that you should store logs in the
attacker to read. From Android 4.1, apps' logs are not /data/data/<app package> directory using a static path, to
accessible to third-party apps — but if a legitimate app itself prevent your data falling into the hands of an attacker.
saves them to an insecure path, an attacker can gain access to
them and extract private information.
Links
https://cwe.mitre.org/data/definitions/532.html
The app does not perform sufficiently precise checks of the One reliable URL check is a scheme check, which prohibits
host field in the URL, meaning that an attacker can bypass passing various private data via the insecure HTTP protocol: it
them. Most URL parsers do not count a backslash (/) as a only permits the use of HTTPS. Another option is to check the
delimiter that is equivalent to a forward slash (/), but e.g. authority part by creating a white list of possible hosts or using
WebView automatically replaces all backslashes with forward a reliable regular expression that excludes manipulation with
slashes. This means that checks like backslashes and other control characters.
host.endsWith("legal.com") are not sufficient. The developer
must also remember about the User info part in the URL,
where backslashes can also be added: instead of checking the
host field, check the whole authority.
Links
https://cwe.mitre.org/data/definitions/358.html
https://cwe.mitre.org/data/definitions/693.html
An exported activity returns the results of its operations (which It is recommended that you either make the activity non-
may include private data). A third-party app has the ability to exported, thereby preventing data leakage, or else make sure
start this activity and receive the Intent that is passed to that setResult is not used to pass any important data.
setResult.
Links
https://cwe.mitre.org/data/definitions/359.html
https://cwe.mitre.org/data/definitions/926.html
An attacker controls the path to a file where data that the We recommend validating a file path obtained externally or
attacker does not control will be stored, potentially leading to using a predefined path in an internal directory, so as to avoid
corruption of arbitrary files. In some cases the data may also unauthorized access to the file path and manipulation of it.
include sensitive information, which is thereby leaked to the
attacker.
Links
https://cwe.mitre.org/data/definitions/73.html
The attacker can fake the path to the file that will be It's recommended to add additional checks for file or folder
subsequently deleted. This may become dangerous in paths to prevent path-traversal attacks.
situations in which the application stores sensitive user data
that will be difficult or impossible to restore afterward. This
may also lead to the incorrect operation of the application,
resulting in reputational and business damage.
Links
https://cwe.mitre.org/data/definitions/73.html
Information leakage
Found in the file A ndroidManifest.xml
46 <service android:name="oversecured.ovaa.services.InsecureLoggerService">
47 <intent-filter>
48 <action android:name="oversecured.ovaa.action.DUMP"/>
49 </intent-filter>
50 </service>
The application makes it possible to reveal sensitive user Do not transmit this kind of information in unencrypted form, or
information such as encryption keys or user passwords by store it in more trustworthy storage.
displaying them on the screen, saving them to insecure
storage, or transmitting them via an unsafe channel, any of
which allows an attacker to make use of them.
Links
https://cwe.mitre.org/data/definitions/200.html
https://cwe.mitre.org/data/definitions/359.html
Information leakage
Found in the file oversecured/ovaa/activities/MainA ctivity.java
54
55 public void onClick(View view) {
56 String token = WeakCrypto.encrypt(MainActivity.this.loginUtils.getLoginData().toString());
57 Intent i = new Intent("oversecured.ovaa.action.WEBVIEW");
58 i.putExtra("url", "http://example.com./?token=" + token);
59 IntentUtils.protectActivityIntent(MainActivity.this, i);
60 MainActivity.this.startActivity(i);
61 }
62 }
63
The application makes it possible to reveal sensitive user Do not transmit this kind of information in unencrypted form, or
information such as encryption keys or user passwords by store it in more trustworthy storage.
displaying them on the screen, saving them to insecure
storage, or transmitting them via an unsafe channel, any of
which allows an attacker to make use of them.
Links
https://cwe.mitre.org/data/definitions/200.html
https://cwe.mitre.org/data/definitions/359.html
The app makes it possible to fake a request, or some of its The developer must restrict request data to trusted sources,
fields, sent to HTTP, which can lead to a whole series of and make sure these data are necessary, are in the expected
possible attacks including Cross-Site Request Forgery and HTTP format, and do not contain special characters that would violate
Splitting. This can make it possible to uncover used data, and the structure of an HTTP request.
can also damage the app's business logic by carrying out
actions that benefit the attacker.
Links
https://cwe.mitre.org/data/definitions/352.html
https://owasp.org/www-community/attacks/csrf
https://portswigger.net/web-security/request-smuggling
The app saves the user's password on the device. This is Instead of storing the password, the developer should use a
insecure, because under specific circumstances it could be server-side issued token. This can be securely saved to the
extracted by an attacker — for example, if there are /data/data/<package name> directory. If an attacker obtains
vulnerabilities such as the ability to steal arbitrary files or if the the token, it only needs to be revoked to avert the attack. The
attacker has access rights to the user's root directory. password can be picked up and used for other services used by
the user, and allows an attacker to guess other versions of the
user's passwords.
Links
https://cwe.mitre.org/data/definitions/256.html
The mobile application uses the insecure HTTP protocol to Replace all HTTP links in the application with their HTTPS
communicate with the server. HTTP lacks encryption, so equivalents.
sensitive data like username, password, etc. can be easily
intercepted and replaced by an attacker who is connected to
the same network as the user’s device — for instance, if the
user is using a public WiFi network.
Links
https://cwe.mitre.org/data/definitions/319.html
https://owasp.org/www-project-mobile-top-10/2016-risks/m3-insecure-communication
The application uses external storage (SD card) to read/write Do not store executable files, configuration files, or sensitive
data. Data stored externally can be read and modified by any user data on SD card.
third-party applications installed on the same mobile device,
which can lead to information disclosure, data tampering, or
other malicious behavior. Example: if an application stores its
third-party .so libraries on external media, these libraries can
be modified by a malware application, which in turn may lead
to arbitrary code execution in the context of the running
application.
Links
https://cwe.mitre.org/data/definitions/921.html
https://owasp.org/www-project-mobile-top-10/2016-risks/m2-insecure-data-storage
The application uses external storage (SD card) to read/write Do not store executable files, configuration files, or sensitive
data. Data stored externally can be read and modified by any user data on SD card.
third-party applications installed on the same mobile device,
which can lead to information disclosure, data tampering, or
other malicious behavior. Example: if an application stores its
third-party .so libraries on external media, these libraries can
be modified by a malware application, which in turn may lead
to arbitrary code execution in the context of the running
application.
Links
https://cwe.mitre.org/data/definitions/921.html
https://owasp.org/www-project-mobile-top-10/2016-risks/m2-insecure-data-storage
The application uses external storage (SD card) to read/write Do not store executable files, configuration files, or sensitive
data. Data stored externally can be read and modified by any user data on SD card.
third-party applications installed on the same mobile device,
which can lead to information disclosure, data tampering, or
other malicious behavior. Example: if an application stores its
third-party .so libraries on external media, these libraries can
be modified by a malware application, which in turn may lead
to arbitrary code execution in the context of the running
application.
Links
https://cwe.mitre.org/data/definitions/921.html
https://owasp.org/www-project-mobile-top-10/2016-risks/m2-insecure-data-storage
An attacker has the ability to control the path to a file, which The developer must make sure file paths can only be obtained
can lead to private data being stored in a public directory to from trusted sources. In addition, it's recommended to store
which the attacker has access; data coming from the attacker files with private data in the /data/data/%package_name%/ file
being read as though they were legitimate; modification or (the path may be obtained by calling Context.getFilesDir()), to
deletion of existing files. The developer must remember that which other apps installed on the device do not have access.
even if the attacker has no access to certain protected files, the
legitimate application does — so that the attacker's objective is
to make the application carry out harmful actions on its own.
Links
https://cwe.mitre.org/data/definitions/73.html
https://cwe.mitre.org/data/definitions/22.html
An attacker has the ability to control the path to a file, which The developer must make sure file paths can only be obtained
can lead to private data being stored in a public directory to from trusted sources. In addition, it's recommended to store
which the attacker has access; data coming from the attacker files with private data in the /data/data/%package_name%/ file
being read as though they were legitimate; modification or (the path may be obtained by calling Context.getFilesDir()), to
deletion of existing files. The developer must remember that which other apps installed on the device do not have access.
even if the attacker has no access to certain protected files, the
legitimate application does — so that the attacker's objective is
to make the application carry out harmful actions on its own.
Links
https://cwe.mitre.org/data/definitions/73.html
https://cwe.mitre.org/data/definitions/22.html
An attacker has the ability to control the path to a file, which The developer must make sure file paths can only be obtained
can lead to private data being stored in a public directory to from trusted sources. In addition, it's recommended to store
which the attacker has access; data coming from the attacker files with private data in the /data/data/%package_name%/ file
being read as though they were legitimate; modification or (the path may be obtained by calling Context.getFilesDir()), to
deletion of existing files. The developer must remember that which other apps installed on the device do not have access.
even if the attacker has no access to certain protected files, the
legitimate application does — so that the attacker's objective is
to make the application carry out harmful actions on its own.
Links
https://cwe.mitre.org/data/definitions/73.html
https://cwe.mitre.org/data/definitions/22.html
An attacker has the ability to control the path to a file, which The developer must make sure file paths can only be obtained
can lead to private data being stored in a public directory to from trusted sources. In addition, it's recommended to store
which the attacker has access; data coming from the attacker files with private data in the /data/data/%package_name%/ file
being read as though they were legitimate; modification or (the path may be obtained by calling Context.getFilesDir()), to
deletion of existing files. The developer must remember that which other apps installed on the device do not have access.
even if the attacker has no access to certain protected files, the
legitimate application does — so that the attacker's objective is
to make the application carry out harmful actions on its own.
Links
https://cwe.mitre.org/data/definitions/73.html
https://cwe.mitre.org/data/definitions/22.html
Full file access is permitted in WebView to pages loaded using It's recommended that developers disable this functionality by
the file:// scheme. If JavaScript execution is permitted, and if using a call to
other vulnerabilities are present, an attacker can use a specially myWebView.getSettings().setAllowFileAccessFromFileURLs(false),
created script to gain access to any local files to which the app so as to avoid leaking personal data.
itself has access.
Links
https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccessFromFileURLs(boolean)
https://cwe.mitre.org/data/definitions/200.html
The app uses paths in the declaration which provide access to The developer should determine why they need the particular
too large a set of files; if other vulnerabilities are present, this Android FileProvider and define only the paths they require. An
may lead to unsanctioned access to files that can be processed excessively broad definition of these paths should be avoided.
by these paths.
Links
https://cwe.mitre.org/data/definitions/200.html
https://cwe.mitre.org/data/definitions/1032.html
Access to data using content:// is not disabled in WebView, or is If the app does not use this functionality, developers are
explicitly enabled. The danger is that an attacker may be able recommended to disable access to content using content:// by
to insert a specially-prepared link into the website and use it to calling myWebView.getSettings().setAllowContentAccess(false).
load some protected content (for instance, photos from
/data/data/<package_name>/ directories in a similar way <img
src="content://my.app.authority/photos/1.jpg">) and then
employ specially created JavaScript code to gain access to the
actual data, leading to the theft of user information.
Links
https://developer.android.com/reference/android/webkit/WebSettings#setAllowContentAccess(boolean)
https://cwe.mitre.org/data/definitions/200.html
The application allows the use of the WebSettings Do not use the setAllowFileAccess method unless absolutely
setAllowFileAccess method. The setAllowFileAccess method necessary, and explicitly set this value to false if you are not
allow JavaScript to access local files in the context of the planning to access local files from WebView.
running application. Performing a Man-in-the-Middle attack or
tampering with a server response, an attacker is able to access
the application's files, such as preferences, local databases,
cache, etc. This can lead to the leakage of confidential data,
such as authentication tokens and passwords. It's not
recommended to use setAllowFileAccess method unless
absolutely necessary.
Links
https://developer.android.com/reference/android/webkit/WebSettings#setAllowFileAccess(boolean)
https://cwe.mitre.org/data/definitions/200.html
The "android:allowBackup" attribute is set to "true" in Set "android:allowBackup" to false in the AndroidManifest.xml
AndroidManifest.xml, thus making it possible to backup up all file.
the application’s data including local databases, preferences
and user's personal data to external storage where it can be
accessed by an unauthorized third-party application. It's highly
recommended to explicitly set the "android:allowBackup"
attribute to false to avoid data leakage.
Links
https://developer.android.com/guide/topics/manifest/application-element#allowbackup
https://cwe.mitre.org/data/definitions/1032.html
Using an implicit activity start is dangerous since the Always use explicit intents to start activities using the
component is not defined and the Android OS asks the user setComponent, setPackage, setClass or setClassName methods
what should actually be started. Using a malware application, of the Intent class.
the attacker can register a custom activity in
AndroidManifest.xml containing the action from the intent and
specify priority 999 in the intent-filter. When startActivity or its
equivalent is executed, a dialog window with a list of all
possible application will be shown with the malware being at
the very top. If the user chooses the fake application, the start
of the activity with intent extras will be hijacked, which may
result in the theft of app usage statistics, as well as different
application states. In the case of startActivityForResult, there is
an additional risk related to the resulting data. When the call is
hijacked, the attacker's activity can be sent via a setResult(...)
call and transmit arbitrary data to the onActivityResult(...)
method of the victim's activity, which may become an
additional source of infected data for the app.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/927.html
Using an implicit activity start is dangerous since the Always use explicit intents to start activities using the
component is not defined and the Android OS asks the user setComponent, setPackage, setClass or setClassName methods
what should actually be started. Using a malware application, of the Intent class.
the attacker can register a custom activity in
AndroidManifest.xml containing the action from the intent and
specify priority 999 in the intent-filter. When startActivity or its
equivalent is executed, a dialog window with a list of all
possible application will be shown with the malware being at
the very top. If the user chooses the fake application, the start
of the activity with intent extras will be hijacked, which may
result in the theft of app usage statistics, as well as different
application states. In the case of startActivityForResult, there is
an additional risk related to the resulting data. When the call is
hijacked, the attacker's activity can be sent via a setResult(...)
call and transmit arbitrary data to the onActivityResult(...)
method of the victim's activity, which may become an
additional source of infected data for the app.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/927.html
Using an implicit activity start is dangerous since the Always use explicit intents to start activities using the
component is not defined and the Android OS asks the user setComponent, setPackage, setClass or setClassName methods
what should actually be started. Using a malware application, of the Intent class.
the attacker can register a custom activity in
AndroidManifest.xml containing the action from the intent and
specify priority 999 in the intent-filter. When startActivity or its
equivalent is executed, a dialog window with a list of all
possible application will be shown with the malware being at
the very top. If the user chooses the fake application, the start
of the activity with intent extras will be hijacked, which may
result in the theft of app usage statistics, as well as different
application states. In the case of startActivityForResult, there is
an additional risk related to the resulting data. When the call is
hijacked, the attacker's activity can be sent via a setResult(...)
call and transmit arbitrary data to the onActivityResult(...)
method of the victim's activity, which may become an
additional source of infected data for the app.
Links
https://blog.oversecured.com/Interception-of-Android-implicit-intents/
https://cwe.mitre.org/data/definitions/927.html
One or more of the application’s content providers are not Set exported=false for all broadcast receivers that should not
protected by signature permission in AndroidManifest.xml file be started by third-party applications at all.
and can be exported. For applications that set either
android:minSdkVersion or android:targetSdkVersion to "17" and
higher, all of the providers are non-exported by default unless
the android:exported attribute is set to "true" or an intent-filter
element is defined. For applications that set either
android:minSdkVersion or android:targetSdkVersion to "16" or
lower, a default exported status is true.Using a malware
application, an attacker can read or write the exported content
provider, which can lead to leakage of sensitive information or
unpredictable application behavior. To enable the most
restrictive and therefore secure policy, you should minimize the
number of exported intents by explicitly setting the "exported"
flag to false, or by using signature permissions.
Links
https://cwe.mitre.org/data/definitions/926.html
Exported activity
Found in the file A ndroidManifest.xml
8 <activity android:name="oversecured.ovaa.activities.DeeplinkActivity">
9 <intent-filter>
10 <action android:name="android.intent.action.VIEW"/>
11 <category android:name="android.intent.category.DEFAULT"/>
12 <category android:name="android.intent.category.BROWSABLE"/>
13 <data android:scheme="oversecured" android:host="ovaa"/>
14 </intent-filter>
15 </activity>
One or more of the application’s activities are not protected by Make sure you are exporting only activities that really need the
signature permission in the AndroidManifest.xml file and can be ability to be started by any third-party application; or create
exported. All activities are non-exported by default, unless the permissions using the android:protectionLevel="signature"
android:exported attribute is set to "true" or the intent-filter parameter in the AndroidManifest.xml file for all activities that
element is defined. Using a malware application, an attacker are intended to be started only by your application, and set the
can send arbitrary data to an exported activity, which can lead parameter exported=false for all activities that may not be
to data spoofing or even code execution. For example, such started by third-party applications at all.
activities as WebViews can be vulnerable to JavaScript injection
attacks, content spoofing or clickjacking. Despite the fact that
activities are less exploitable than services, it's still highly
recommended to check all the data passed to them. To secure
the application it is recommended to minimize the number of
exported intents by explicitly setting the "exported" flag to
false, or use signature permissions.
Links
https://cwe.mitre.org/data/definitions/926.html
Exported activity
Found in the file A ndroidManifest.xml
22 <activity android:name="oversecured.ovaa.activities.LoginActivity">
23 <intent-filter>
24 <action android:name="oversecured.ovaa.action.LOGIN"/>
25 <category android:name="android.intent.category.DEFAULT"/>
26 </intent-filter>
27 </activity>
One or more of the application’s activities are not protected by Make sure you are exporting only activities that really need the
signature permission in the AndroidManifest.xml file and can be ability to be started by any third-party application; or create
exported. All activities are non-exported by default, unless the permissions using the android:protectionLevel="signature"
android:exported attribute is set to "true" or the intent-filter parameter in the AndroidManifest.xml file for all activities that
element is defined. Using a malware application, an attacker are intended to be started only by your application, and set the
can send arbitrary data to an exported activity, which can lead parameter exported=false for all activities that may not be
to data spoofing or even code execution. For example, such started by third-party applications at all.
activities as WebViews can be vulnerable to JavaScript injection
attacks, content spoofing or clickjacking. Despite the fact that
activities are less exploitable than services, it's still highly
recommended to check all the data passed to them. To secure
the application it is recommended to minimize the number of
exported intents by explicitly setting the "exported" flag to
false, or use signature permissions.
Links
https://cwe.mitre.org/data/definitions/926.html
Exported activity
Found in the file A ndroidManifest.xml
34 <activity android:name="oversecured.ovaa.activities.MainActivity">
35 <intent-filter>
36 <action android:name="oversecured.ovaa.action.ACTIVITY_MAIN"/>
37 <category android:name="android.intent.category.DEFAULT"/>
38 </intent-filter>
39 </activity>
One or more of the application’s activities are not protected by Make sure you are exporting only activities that really need the
signature permission in the AndroidManifest.xml file and can be ability to be started by any third-party application; or create
exported. All activities are non-exported by default, unless the permissions using the android:protectionLevel="signature"
android:exported attribute is set to "true" or the intent-filter parameter in the AndroidManifest.xml file for all activities that
element is defined. Using a malware application, an attacker are intended to be started only by your application, and set the
can send arbitrary data to an exported activity, which can lead parameter exported=false for all activities that may not be
to data spoofing or even code execution. For example, such started by third-party applications at all.
activities as WebViews can be vulnerable to JavaScript injection
attacks, content spoofing or clickjacking. Despite the fact that
activities are less exploitable than services, it's still highly
recommended to check all the data passed to them. To secure
the application it is recommended to minimize the number of
exported intents by explicitly setting the "exported" flag to
false, or use signature permissions.
Links
Links
https://cwe.mitre.org/data/definitions/926.html
Exported service
Found in the file A ndroidManifest.xml
46 <service android:name="oversecured.ovaa.services.InsecureLoggerService">
47 <intent-filter>
48 <action android:name="oversecured.ovaa.action.DUMP"/>
49 </intent-filter>
50 </service>
One or more of the application’s services are not protected by Make sure you are only exporting services that really need the
signature permission in the AndroidManifest.xml file and can be ability to be started by any third-party applications; or create a
exported. All of the services are non-exported by default, permission with android:protectionLevel="signature" in the
unless the android:exported attribute is set to "true" or an AndroidManifest.xml file and use it for all services that are to
intent-filter element is defined. Using a malware application, an be started only by your applications, setting exported="false"
attacker can send arbitrary data to the exported service, which for all services that should not be started by third-party
can lead to invocation of other components of the application applications at all.
or to code execution. For example, if a service can send files
via email and a file path is passed to the service as a
parameter an attacker can choose any file owned by the
running application and send it to an arbitrary email. Services
are the most exploitable component among other Intents, so
it's highly recommended to check all the data passed to them.
To enable the most restrictive, and therefore secure policy, you
should minimize the number of exported intents by explicitly
setting the "exported" flag to false, or by using signature
permissions.
Links
https://cwe.mitre.org/data/definitions/926.html
Enabled JavaScript
Found in the file oversecured/ovaa/activities/WebV iewA ctivity.java
18 private void setupWebView(WebView webView) {
19 webView.setWebChromeClient(new WebChromeClient());
20 webView.setWebViewClient(new WebViewClient());
21 webView.getSettings().setJavaScriptEnabled(true);
22 webView.getSettings().setAllowFileAccessFromFileURLs(true);
23 }
24 }
The application has the WebSettings setJavaScriptEnabled Set setJavaScriptEnabled to false, or make sure the server uses
method set to true. The "setJavaScriptEnabled" method allows an encrypted channel (using https and correct certificate
the execution of JavaScript in the context of a running verification) and there are no vulnerabilities in the server part
application. Performing a Man-in-the-Middle attack or tampering of the application.
with a server response, an attacker is able to inject and
execute arbitrary JavaScript code. This can lead to information
leakage or remote code execution. It's not recommended to
use setJavaScriptEnabled unless absolutely necessary. Disable
this setting to enforce security.
Links
https://cwe.mitre.org/data/definitions/79.html
The application uses one or more of broken hash functions. Use SHA-256 or better, instead of other hashing algorithms.
Due to several critical flaws, such as collisions, preimages, it's
not recommended to use these functions.
Links
https://owasp.org/www-project-mobile-top-10/2016-risks/m6-insecure-authorization
https://cwe.mitre.org/data/definitions/327.html