-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added DefaultHttpClient pathfinder rule * added RC4 usage rule * added math.random rule * added Blowfish rule * added RC2 or RC4 usage * added SHA1 usage rule * added meta description
- Loading branch information
1 parent
5d65868
commit e86c354
Showing
8 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @name BlowfishUsage | ||
* @description Use of Blowfish was detected. Blowfish uses a 64-bit block size | ||
* @kind problem | ||
* @id java/BlowfishUsage | ||
* @problem.severity warning | ||
* @security-severity 3.1 | ||
* @precision medium | ||
* @tags security | ||
* external/cwe/cwe-327 | ||
*/ | ||
|
||
FROM method_invocation AS mi | ||
WHERE mi.getName() == "Cipher.getInstance" | ||
&& "Blowfish" in mi.getArgumentName() | ||
SELECT mi.getName(), "Use of Blowfish was detected. Blowfish uses a 64-bit block size | ||
that makes it vulnerable to birthday attacks, and is therefore considered | ||
non-compliant." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @name DefaultHttpClient | ||
* @description The DefaultHttpClient is deprecated. Use HttpClientBuilder instead. | ||
* @kind problem | ||
* @id java/DefaultHttpClient | ||
* @problem.severity warning | ||
* @security-severity 3.1 | ||
* @precision medium | ||
* @tags security | ||
* external/cwe/cwe-326 | ||
*/ | ||
|
||
FROM ClassInstanceExpr AS cie | ||
WHERE cie.getClassInstanceExpr().GetClassName() == "DefaultHttpClient" | ||
SELECT cie.getName(), "The DefaultHttpClient is deprecated. Use HttpClientBuilder instead." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @name InsecureRandom | ||
* @description Math.random() is not cryptographically secure. Use SecureRandom instead. | ||
* @kind problem | ||
* @id java/InsecureRandom | ||
* @problem.severity warning | ||
* @security-severity 3.1 | ||
* @precision medium | ||
* @tags security | ||
* external/cwe/cwe-330 | ||
*/ | ||
|
||
FROM method_invocation AS mi | ||
WHERE mi.getName() == "Math.random" | ||
SELECT mi.getName(), "Math.random() is not cryptographically secure. Use SecureRandom instead." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @name RC4Usage | ||
* @description RC4/RC2 is insecure. Use an alternative cipher suite. | ||
* @kind problem | ||
* @id java/RC4Usage | ||
* @problem.severity warning | ||
* @security-severity 3.1 | ||
* @precision medium | ||
* @tags security | ||
* external/cwe/cwe-327 | ||
*/ | ||
|
||
FROM method_invocation AS mi | ||
WHERE mi.getName() == "Cipher.getInstance" | ||
&& ("RC4" in mi.getArgumentName() || "RC2" in mi.getArgumentName()) | ||
SELECT mi.getName(), "RC4/RC2 is insecure. Use an alternative cipher suite." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @name SHA1Usage | ||
* @description SHA1 is not collision resistant and is therefore not suitable as a cryptographic signature | ||
* @kind problem | ||
* @id java/SHA1Usage | ||
* @problem.severity warning | ||
* @security-severity 3.1 | ||
* @precision medium | ||
* @tags security | ||
* external/cwe/cwe-328 | ||
*/ | ||
|
||
FROM method_invocation AS mi | ||
WHERE mi.getName() == "MessageDigest.getInstance" | ||
&& ("SHA1" in mi.getArgumentName() || "SHA-1" in mi.getArgumentName()) | ||
SELECT mi.getName(), "SHA1 is not collision resistant and is therefore not suitable as a cryptographic signature" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters