mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Add qhelp
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// BAD: Sensitive data is sent to an untrusted result receiver
|
||||
void bad(String password) {
|
||||
Intent intent = getIntent();
|
||||
ResultReceiver rec = intent.getParcelableExtra("Receiver");
|
||||
Bundle b = new Bundle();
|
||||
b.putCharSequence("pass", password);
|
||||
rec.send(0, b);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE qhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd">
|
||||
<qhelp>
|
||||
|
||||
<overview>
|
||||
<p>If a <code>ResultReceiver</code> is obtained from an untrusted source, such as being unparcled from an <code>Intent</code>,
|
||||
sensitive data such as passwords should not be sent to it. Otherwise, this sensitive information may be leaked to a malicious application.</p>
|
||||
</overview>
|
||||
|
||||
<recommendation>
|
||||
<p>
|
||||
Do not send sensitive data to an untrusted <code>ResultReceiver</code>.
|
||||
</p>
|
||||
</recommendation>
|
||||
|
||||
<example>
|
||||
In the following (bad) example, sensitive data is sent to an untrusted <code>ResultReceiver</code>.
|
||||
<sample src="SensitiveResultReceiver.java" />
|
||||
</example>
|
||||
|
||||
<references>
|
||||
<li>Oversecured: <a href=https://oversecured.com/vulnerabilities#Android/Passing_data_to_a_ResultReceiver_under_the_attacker%E2%80%99s_control>Passing data to a ResultReceiver under the attacker's control</a></li>
|
||||
</references>
|
||||
</qhelp>
|
||||
@@ -5,7 +5,7 @@
|
||||
* @kind path-problem
|
||||
* @problem.severity error
|
||||
* @security-severity 8.2
|
||||
* @precision mediums
|
||||
* @precision medium
|
||||
* @id java/android/sensitive-result-receiver
|
||||
* @tags security
|
||||
* external/cwe/cwe-927
|
||||
|
||||
Reference in New Issue
Block a user