Skip to content

Commit cb5733d

Browse files
Apply suggestions from code review
Update to documentation. Co-authored-by: Tony Torralba <[email protected]>
1 parent 7162540 commit cb5733d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

java/ql/src/experimental/Security/CWE/CWE-470/LoadClassNoSignatureCheck.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
<overview>
55
<p>
6-
If a vulnerable loads classes or code of any app based solely on the package name of the app without
7-
first checking the package signature of the app, this could malicious app with the same package name
6+
If an application loads classes or code from another app based solely on its package name without
7+
first checking its package signature, this could allow a malicious app with the same package name
88
to be loaded through "package namespace squatting".
99
If the victim user install such malicious app in the same device as the vulnerable app, the vulnerable app would load
1010
classes or code from the malicious app, potentially leading to arbitrary code execution.
@@ -13,17 +13,17 @@ classes or code from the malicious app, potentially leading to arbitrary code ex
1313

1414
<recommendation>
1515
<p>
16-
Verify that the signature of an app in addition to the package name before loading the classes or code.
16+
Verify the package signature in addition to the package name before loading any classes or code from another application.
1717
</p>
1818
</recommendation>
1919

2020
<example>
2121
<p>
22-
The <code>BadClassLoader</code> class illustrate class loading with <code>android.content.pm.PackageInfo.packageName.startsWith()</code> method without any check on the package signature.
22+
The <code>BadClassLoader</code> class illustrates class loading with the <code>android.content.pm.PackageInfo.packageName.startsWith()</code> method without any check on the package signature.
2323
</p>
2424
<sample src="BadClassLoader.java" />
2525
<p>
26-
The <code>GoodClassLoader</code> class illustrate class loading with package signature check using <code>android.content.pm.PackageManager.checkSignatures()</code> method.
26+
The <code>GoodClassLoader</code> class illustrates class loading with correct package signature check using the <code>android.content.pm.PackageManager.checkSignatures()</code> method.
2727
</p>
2828
<sample src="GoodClassLoader.java" />
2929
</example>

java/ql/src/experimental/Security/CWE/CWE-470/LoadClassNoSignatureCheck.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @name Load 3rd party classes or code ('unsafe reflection') without signature check
3-
* @description Load classes or code from 3rd party package without checking the
4-
* package signature but only rely on package name.
5-
* This makes it susceptible to package namespace squatting
3+
* @description Loading classes or code from third-party packages without checking the
4+
* package signature could make the application
5+
* susceptible to package namespace squatting attacks,
66
* potentially leading to arbitrary code execution.
77
* @problem.severity error
88
* @precision high

0 commit comments

Comments
 (0)