Datasets:
language large_stringclasses 1
value | page_id int64 87.2M 87.2M | page_url large_stringlengths 73 73 | chapter int64 2 2 | section int64 0 7 | rule_id large_stringlengths 7 7 | title large_stringlengths 32 81 | intro large_stringlengths 506 3.71k | noncompliant_code large_stringlengths 123 8.67k | compliant_solution large_stringlengths 63 1.81k ⌀ | risk_assessment large_stringlengths 116 318 ⌀ | breadcrumb large_stringclasses 8
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
android | 87,150,611 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150611 | 2 | 3 | DRD02-J | Do not allow WebView to access sensitive local resource through file scheme | The
WebView
class displays web pages as part of an activity layout. The behavior of a
WebView
object can be customized using the
WebSettings
object, which can be obtained from
WebView.getSettings()
.
Major security concerns for
WebView
are about the
setJavaScriptEnabled()
,
setPluginState()
, and
setAllowFileAccess()
m... | public class MyBrowser extends Activity {
@override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webView = (WebView) findViewById(R.id.webview);
// turn on javascript
WebSettings settings = webView.getSettings();
... | public class MyBrowser extends Activity {
@override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webView = (WebView) findViewById(R.id.webview);
String url = getIntent().getStringExtra("url");
if (!url.startsWith(... | null | Android Secure Coding Standard > 2 Rules > Rule 03. WebView (WBV) |
android | 87,150,605 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150605 | 2 | 2 | DRD03-J | Do not broadcast sensitive information using an implicit intent | Android applications' core components such as activities, services, and broadcast receivers are activated through messages, called
intents
. Applications can use broadcast to send messages to multiple applications (i.e., notification of events to an indefinite number of apps). Also, an application can receive a broadca... | public class ServerService extends Service {
// ...
private void d() {
// ...
Intent v1 = new Intent();
v1.setAction("com.sample.action.server_running");
v1.putExtra("local_ip", v0.h);
v1.putExtra("port", v0.i);
v1.putExtra("code", v0.g);
v1.putExtra("connected", v0.s);
v1.putExtra("... | Intent intent = new Intent("my-sensitive-event");
intent.putExtra("event", "this is a test event");
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
## Compliant Solution
If the intent is only broadcast/received in the same application,
LocalBroadcastManager
can be used so that, by design, other apps can... | ## Risk Assessment
Using an implicit intent can leak sensitive information to malicious apps or result in denial of service.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD03-J
Medium
Probable
No
No
P4
L3 | Android Secure Coding Standard > 2 Rules > Rule 02. Intent (ITT) |
android | 87,150,665 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150665 | 2 | 1 | DRD04-J | Do not log sensitive information | Android provides capabilities for an app to output logging information and obtain log output. Applications can send information to log output using the
android.util.Log
class. To obtain log output, applications can execute the
logcat
command.
## To log output
The
android.util.Log
class allows a number of possibilities:... | Log.d("Facebook-authorize", "Login Success! access_token="
+ getAccessToken() + " expires="
+ getAccessExpires());
final StringBuilder slog = new StringBuilder();
try {
Process mLogcatProc;
mLogcatProc = Runtime.getRuntime().exec(new String[]
{"logcat", "-d", "LoginAsyncTask:I APIClient:I method... | null | ## Risk Assessment
Logging sensitive information can leak sensitive information to malicious apps.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD04-J
Medium
Probable
No
No
P4
L3 | Android Secure Coding Standard > 2 Rules > Rule 01. File I/O and Logging (FIO) |
android | 87,150,608 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150608 | 2 | 5 | DRD05-J | Do not grant URI permissions on implicit intents | (THIS CODING RULE OR GUIDELINE IS UNDER CONSTRUCTION)
Data stored in an application's service provider can be referenced by URIs that are included in intents. If the recipient of the intent does not have the required privileges to access the URI, the sender of the intent can set either of the flags
FLAG_GRANT_READ_URI_... | TBD
## Noncompliant Code Example
## This noncompliant code example shows an application that grantsFLAG_GRANT_READ_URI_PERMISSIONon an implicit intent.
#FFCCCC
TBD
An application could intercept the implicit intent and access the data at the URI. | TBD
## Compliant Solution
## In this compliant solution the intent is made explicit so that it cannot be intercepted:
#CCCCFF
TBD | ## Risk Assessment
Granting URI permissions in implicit intents can leak sensitive information.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD05-J
High
Probable
Yes
No
P12
L1 | Android Secure Coding Standard > 2 Rules > Rule 05. Permission (PER) |
android | 87,150,610 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150610 | 2 | 0 | DRD08-J | Always canonicalize a URL received by a content provider | By using the
ContentProvider.openFile()
method, you can provide a facility for another application to access your application data (file). Depending on the implementation of
ContentProvider
, use of the method can lead to a directory traversal vulnerability. Therefore, when exchanging a file through a content provider,... | private static String IMAGE_DIRECTORY = localFile.getAbsolutePath();
public ParcelFileDescriptor openFile(Uri paramUri, String paramString)
throws FileNotFoundException {
File file = new File(IMAGE_DIRECTORY, paramUri.getLastPathSegment());
return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_O... | private static String IMAGE_DIRECTORY = localFile.getAbsolutePath();
public ParcelFileDescriptor openFile(Uri paramUri, String paramString)
throws FileNotFoundException {
String decodedUriString = Uri.decode(paramUri.toString());
File file = new File(IMAGE_DIRECTORY, Uri.parse(decodedUriString).getLastP... | ## Risk Assessment
Failing to canonicalize a path received by a content provider may lead to a directory traversal vulnerability which could result in the release of sensitive data or in the malicious corruption of data.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD08-J
High
Probable
Yes
No
P12
L1 | Android Secure Coding Standard > 2 Rules > Rule 00. Component Security (CPS) |
android | 87,150,718 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150718 | 2 | 5 | DRD14-J | Check that a calling app has appropriate permissions before responding | (THIS CODING RULE OR GUIDELINE IS UNDER CONSTRUCTION)
If an app is using a granted permission to respond to a calling app then it must check that the calling app has that permission as well. Otherwise, the responding app may be granting privileges to the calling app that it should not have. (This is sometimes called t... | TBD
## Noncompliant Code Example
This noncompliant code example shows an app responding to a calling app without first checking the permissions of the calling app.
#FFCCCC
TBD | TBD
## Compliant Solution
## In this compliant solution the permissions of the calling app are checked before the response is sent:
#CCCCFF
TBD | ## Risk Assessment
Responding to a calling app without checking that it has the appropriate permissions can leak sensitive information.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD14-J
High
Probable
No
No
P6
L2 | Android Secure Coding Standard > 2 Rules > Rule 05. Permission (PER) |
android | 87,150,714 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150714 | 2 | 7 | DRD15-J | Consider privacy concerns when using Geolocation API | The
Geolocation API
, which is specified by W3C, enables web browsers to access geographical location information of a user's device.
In the specification, it is prohibited that user agents send location information to web sites without obtaining permission from the user:
4.1 Privacy considerations for implementers of ... | public void onGeolocationPermissionsShowPrompt(String origin, Callback callback){
super.onGeolocationPermissionsShowPrompt(origin, callback);
callback.invoke(origin, true, false);
}
## Noncompliant Code Example
This noncompliant code example sends the user's geolocation information without obtaining th... | public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
super.onGeolocationPermissionsShowPrompt(origin, callback);
// Ask for user's permission
// When the user disallows, do not send the geolocation information
}
public void onGeolocationPermissionsShowPrompt(String... | ## Risk Assessment
Sending a user's geolocation information without asking the user's permission violates the security and privacy considerations of the Geolocation API and leaks the user's sensitive information.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD15-J
Low
Probable
No
No
P2
L3 | Android Secure Coding Standard > 2 Rules > Rule 07. Miscellaneous (MSC) |
android | 87,150,713 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150713 | 2 | 6 | DRD17-J | Do not use the Android cryptographic security provider encryption default for AES | (THIS CODING RULE OR GUIDELINE IS UNDER CONSTRUCTION)
The predominant Android cryptographic security provider API defaults to using an insecure AES encryption method: ECB block cipher mode for AES encryption. Android's default cryptographic security provider (since version 2.1) is BouncyCastle.
NOTE: Java also chose EC... | ## Noncompliant Code Example
## This noncompliant code example shows an application that ..., and hence not secure.
#FFCCCC | ## Compliant Solution
## In this compliant solution ...
#CCCCFF | ## Risk Assessment
If an insecure encryption method is used, then the encryption does not assure privacy, integrity, and authentication of the data.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD17-J
High
Likely
Yes
No
P18
L1 | Android Secure Coding Standard > 2 Rules > Rule 06. Cryptography (CRP) |
android | 87,150,609 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150609 | 2 | 2 | DRD21-J | Always pass explicit intents to a PendingIntent | (THIS CODING RULE OR GUIDELINE IS UNDER CONSTRUCTION)
A
Pending Intent
is an intent that can be given to another application for it to use later, see: [
Android API 2013
]
class
PendingIntent
. The application receiving the pending intent can perform the operation(s) specified in the pending intent with the same permis... | TBD
## Noncompliant Code Example
## This noncompliant code example shows an application that creates a pending intent containing an implicit intent.
#FFCCCC
TBD
An application could intercept the implicit intent and pass it on to an inappropriate location, while both the intent originator and the intent recipient woul... | TBD
## Compliant Solution
## In this compliant solution the pending intent contains an explicit intent that cannot be misdirected.
#CCCCFF
TBD | ## Risk Assessment
Failing to pass an explicit intent to a pending intent could allow the intent to be misdirected, thereby leaking sensitive information and/or altering the data flow within an app.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD21-J
Medium
Probable
Yes
No
P4
L3 | Android Secure Coding Standard > 2 Rules > Rule 02. Intent (ITT) |
android | 87,150,699 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150699 | 2 | 4 | DRD23-J | Do not use loopback when handling sensitive data | Under Construction
This guideline is under construction.
Loopback, that is, connecting network communications to
localhost
ports, should not be used when handling sensitive data. The
localhost
ports are accessible by other applications on the device, so their use may result in sensitive data being revealed. Instead, a ... | TBD
## Noncompliant Code Example
## This noncompliant code example shows an application that binds to alocalhostnetwork port to send sensitive data.
#FFCCCC
TBD
Another application could intercept the communication and access the sensitive data | TBD
## Compliant Solution
## In this compliant solution the application uses a secure network connection.
#CCCCFF
TBD | ## Risk Assessment
Using
localhost
or the
INADDR_ANY
port when handling sensitive data could result in the data being revealed.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD23-J
Medium
Probable
No
No
P4
L3 | Android Secure Coding Standard > 2 Rules > Rule 04. Network - SSL/TLS (NET) |
android | 87,150,663 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150663 | 2 | 7 | DRD26-J | For OAuth, use a secure Android method to deliver access tokens | This rule was developed in part by Rachel Xu and Zifei (FeiFei) Han at the October 20-22, 2017
OurCS Workshop
(
http://www.cs.cmu.edu/ourcs/register.html
).
For more information about this statement, see the
About the OurCS Workshop
page.
For OAuth, use a secure Android method to deliver access tokens. The method to do... | TBD
## Noncompliant Code Example
## This noncompliant code example shows an application that
#FFCCCC
TBD
An Intent can securely send an access token to its intended mobile relying party app, using an explicit intent, because the relying party can be uniquely identified through its developer key hash. | TBD
## Compliant Solution
## In this compliant solution the application
#CCCCFF
TBD | ## Risk Assessment
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD26-J
Medium
Probable
No
No
P4
L3 | Android Secure Coding Standard > 2 Rules > Rule 07. Miscellaneous (MSC) |
android | 87,150,654 | https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87150654 | 2 | 7 | DRD27-J | For OAuth, use an explicit intent method to deliver access tokens | Start copying here:
This rule was developed in part by Zifei (FeiFei) Han and Rachel Xu at the October 20-22, 2017
OurCS Workshop
(
http://www.cs.cmu.edu/ourcs/register.html
).
For more information about this statement, see the
About the OurCS Workshop
page.
End copying here.
Under Construction
This guideline is under ... | protected void OnTokenAcquired(Bundle savedInstanceState) {
//[Code to construct an OAuth client request goes here]
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(request.getlocationUri() + "&response_type=code"));
startActivity(intent);
}
## Noncompliant Code Example
## This noncompliant code example sho... | protected void OnTokenAcquired(Bundle savedInstanceState) {
//[Code to construct an OAuth client request goes here]
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(request.getlocationUri() + "&response_type=code"), this, [YOUR OAUTH ACTIVITY CLASS]);
startActivity(intent);
}
## Compliant Solution
## In thi... | ## Risk Assessment
## Summary of risk assessment.
Rule
Severity
Likelihood
Detectable
Repairable
Priority
Level
DRD27-J
No
No | Android Secure Coding Standard > 2 Rules > Rule 07. Miscellaneous (MSC) |
Dataset Card for SEI CERT Android Secure Coding Standard (Wiki rules)
Structured export of the SEI CERT Android Secure Coding Standard from the SEI wiki.
Dataset Details
Dataset Description
Android-focused secure coding rules (Java / Android APIs) with descriptive text and examples as published by SEI CERT.
- Curated by: Derived from public SEI CERT wiki pages; packaged as CSV by the dataset maintainer.
- Funded by [optional]: [More Information Needed]
- Shared by [optional]: [More Information Needed]
- Language(s) (NLP): English (rule text and embedded code).
- License: Compilation distributed as
other; verify with CMU SEI for your use case.
Dataset Sources [optional]
- Repository: https://wiki.sei.cmu.edu/confluence/display/seccode/SEI+CERT+Coding+Standards
- Paper [optional]: SEI CERT Android Secure Coding Standard
- Demo [optional]: [More Information Needed]
Uses
Direct Use
Mobile security training, AppSec checklists, and ML datasets for Android guidance.
Out-of-Scope Use
Does not guarantee coverage of the latest Android platform changes.
Dataset Structure
All rows share the same columns (scraped from the SEI CERT Confluence wiki):
| Column | Description |
|---|---|
language |
Language identifier for the rule set |
page_id |
Confluence page id |
page_url |
Canonical wiki URL for the rule page |
chapter |
Chapter label when present |
section |
Section label when present |
rule_id |
Rule identifier (e.g. API00-C, CON50-J) |
title |
Short rule title |
intro |
Normative / explanatory text |
noncompliant_code |
Noncompliant example(s) when present |
compliant_solution |
Compliant example(s) when present |
risk_assessment |
Risk / severity notes when present |
breadcrumb |
Wiki breadcrumb trail when present |
Dataset Creation
Curation Rationale
Compact machine-readable export of Android CERT guidance.
Source Data
Data Collection and Processing
Scraped from the Android section of the SEI wiki using the shared CSV schema.
Who are the source data producers?
[More Information Needed]
Annotations [optional]
Annotation process
[More Information Needed]
Who are the annotators?
[More Information Needed]
Personal and Sensitive Information
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users should be made aware of the risks, biases and limitations of the dataset. More information needed for further recommendations.
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Dataset Card Authors [optional]
[More Information Needed]
Dataset Card Contact
[More Information Needed]
- Downloads last month
- 28