Skip to content

Commit f52db7f

Browse files
Add qhelp
1 parent a887592 commit f52db7f

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// BAD: Sensitive data is sent to an untrusted result receiver
2+
void bad(String password) {
3+
Intent intent = getIntent();
4+
ResultReceiver rec = intent.getParcelableExtra("Receiver");
5+
Bundle b = new Bundle();
6+
b.putCharSequence("pass", password);
7+
rec.send(0, b);
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE qhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd">
2+
<qhelp>
3+
4+
<overview>
5+
<p>If a <code>ResultReceiver</code> is obtained from an untrusted source, such as being unparcled from an <code>Intent</code>,
6+
sensitive data such as passwords should not be sent to it. Otherwise, this sensitive information may be leaked to a malicious application.</p>
7+
</overview>
8+
9+
<recommendation>
10+
<p>
11+
Do not send sensitive data to an untrusted <code>ResultReceiver</code>.
12+
</p>
13+
</recommendation>
14+
15+
<example>
16+
In the following (bad) example, sensitive data is sent to an untrusted <code>ResultReceiver</code>.
17+
<sample src="SensitiveResultReceiver.java" />
18+
</example>
19+
20+
<references>
21+
<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>
22+
</references>
23+
</qhelp>

java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @kind path-problem
66
* @problem.severity error
77
* @security-severity 8.2
8-
* @precision mediums
8+
* @precision medium
99
* @id java/android/sensitive-result-receiver
1010
* @tags security
1111
* external/cwe/cwe-927

0 commit comments

Comments
 (0)