-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 201 parametric crypto (JCA) misuses #427
base: master
Are you sure you want to change the base?
Changes from 63 commits
a4f3df1
dcdbbbc
e29497d
db611d4
a9e6798
d6ef915
256ee61
6748599
688af87
8af0733
917c26d
6fabda1
119bc97
4a0f75a
228fa65
3c4a759
44290eb
2a65cf5
b6aac7e
04df24c
518f55a
d8812b5
45d1e54
c2dd56d
02734bf
a2bb205
fe5821a
544eacf
61c8644
42d0a71
c9495aa
a96fc02
a87444a
3297ff0
a652989
f548a11
acb7f37
9489847
d26b4a4
9d98173
01c9ac7
c22e33e
e306cf4
12329bf
f826b16
d26e6df
1246bdb
dd04d0c
e81436b
6a65aa6
2ddd34d
3165d8b
215b6f6
a4be32b
97b87b8
9096121
35d1edb
bf82114
ca3e808
a8e2450
b7e53c6
806c3f5
90e0204
285d7db
6441861
ecc62a8
df4d685
94b7b36
e82b7ee
c596f9d
1b6b13d
8c0aac6
eed60ed
24dadc0
b9ba545
7ac8a96
5cc1ee5
8cbfda3
1effe62
1a58711
c042a9d
5055704
347ce9c
43f5c93
5789ef1
db6c7b2
7f30252
2a5971f
d1c2d6e
30704f7
c52cc8c
0803d09
2111154
85316d4
3f565d2
8fcb6ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.spec.IvParameterSpec | ||
violations: | ||
- insecure/condition/randomization | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MUBench currently only supports violations types from the MUC. We can talk about introducing (sub)categories for the crypto case, but simply adding random categories will break at least the statistics computation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which statistics computation do you have in mind? The one provided by the docker container or the review site? The later one shows statistics for the new violation types. |
||
description: > | ||
First parameter while initializing the IvParameterSpec object was not properly randomized. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "not properly randomized" is a fairly vague description of the problem. Can you provide more details, e.g., by explaining how it should be done/could be fixed? Please us backticks to properly format |
||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "decryptPassword(String)" | ||
line: 66 | ||
internal: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out. I have resolved this in commit 347ce9c. |
||
pattern: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This key is obsolete and can be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify: You mean the key |
||
crash: false | ||
source: | ||
name: | ||
akwick marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/key | ||
description: > | ||
Second parameter while initializing the Cipher object was not properly generatedKey. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "not properly generatedKey" is not a proper sentence, please fix. |
||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "decryptPassword(String)" | ||
line: 66 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter in Cipher.getInstance(String) is with value "AES/CBC/PKCS5PADDING" which should be any of AES/CBC/{Empty String, PKCS7Padding, PKCS5Padding, ISO10126Padding}. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the problem here the incorrect casing of the padding? If so, please state explicitly. |
||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "decryptPassword(String)" | ||
line: 65 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/IV | ||
description: > | ||
Third parameter while initializing the Cipher object was not properly preparedIV. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "not properly preparedIV" is not a proper sentence, please fix. |
||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "decryptPassword(String)" | ||
line: 66 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter in Cipher.getInstance(String) is with value "AES/CBC/PKCS5PADDING" which should be any of AES/CBC/{Empty String, PKCS7Padding, PKCS5Padding, ISO10126Padding}. | ||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "encryptPassword(String)" | ||
line: 54 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.spec.IvParameterSpec | ||
violations: | ||
- insecure/condition/randomization | ||
description: > | ||
First parameter while initializing the IvParameterSpec object was not properly randomized. | ||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "encryptPassword(String)" | ||
line: 55 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/key | ||
description: > | ||
Second parameter while initializing the Cipher object was not properly generatedKey. | ||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "encryptPassword(String)" | ||
line: 55 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/IV | ||
description: > | ||
Third parameter while initializing the Cipher object was not properly preparedIV. | ||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "encryptPassword(String)" | ||
line: 55 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.spec.SecretKeySpec | ||
violations: | ||
- insecure/condition/randomization | ||
description: > | ||
First parameter while initializing the SecretKeySpec object was not properly randomized. | ||
location: | ||
file: com/abixen/platform/service/businessintelligence/multivisualisation/domain/model/util/AES128Encoder.java | ||
method: "generateKey(String)" | ||
line: 39 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: abixen-platform | ||
repository: | ||
type: git | ||
url: https://github.com/abixen/abixen-platform | ||
url: https://github.com/abixen/abixen-platform |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
build: | ||
classes: abixen-platform-business-intelligence-service/target/classes | ||
akwick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
commands: | ||
- mvn -pl :abixen-platform-web-content-service -am clean install | ||
src: abixen-platform-business-intelligence-service/src/ | ||
misuses: | ||
- '1' | ||
- '2' | ||
- '3' | ||
- '4' | ||
- '5' | ||
- '6' | ||
- '7' | ||
- '8' | ||
- '9' | ||
revision: 99fe4994a70be92078545add013bb3bcdc089360 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- java.security.MessageDigest | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter in MessageDigest.getInstance(String) is with value "MD5" which should be any of {SHA-256, SHA-384, SHA-512}. | ||
location: | ||
file: com/aliyun/oss/common/utils/BinaryUtil.java | ||
method: "calculateMd5(byte[])" | ||
line: 43 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.spec.SecretKeySpec | ||
violations: | ||
- insecure/condition/randomization | ||
description: > | ||
First parameter while initializing SecretKeySpec object was not properly randomized. | ||
location: | ||
file: com/aliyun/oss/common/utils/BinaryUtil.java | ||
method: "sign(byte[], byte[])" | ||
line: 87 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: aliyun-oss-java-sdk | ||
repository: | ||
type: git | ||
url: https://github.com/aliyun/aliyun-oss-java-sdk | ||
url: https://github.com/aliyun/aliyun-oss-java-sdk |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
build: | ||
classes: target/classes | ||
commands: | ||
- mvn clean compile | ||
src: /src/main/java/ | ||
misuses: | ||
- '1' | ||
- '2' | ||
revision: 196cf711417df73a72e0dc2f84a8f3a03c8371c2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- java.security.MessageDigest | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter (with value "SHA-1") should be any of {SHA-256, SHA-384, SHA-512} | ||
location: | ||
file: main/java/apksigner/ApkSignerTool.java | ||
method: "verify(String[])" | ||
line: 419 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- java.security.MessageDigest | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter (with value "SHA-1") should be any of {SHA-256, SHA-384, SHA-512} | ||
location: | ||
file: main/java/apksigner/ApkSignerTool.java | ||
method: "verify(String[])" | ||
line: 420 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: and-res-guard | ||
repository: | ||
type: git | ||
url: https://github.com/shwenzhang/AndResGuard | ||
url: https://github.com/shwenzhang/AndResGuard |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
build: | ||
classes: AndResGuard/AndResGuard-core/build/classes/java/main | ||
commands: | ||
- gradle build | ||
src: AndResGuard/AndResGuard-core/src | ||
misuses: | ||
- '1' | ||
- '2' | ||
revision: f03c69ad2860b5131c5489ca503843172a8f91e4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter (with value "AES") should be any of AES/{CBC, GCM, PCBC, CTR, CTS, CFB, OFB} | ||
location: | ||
file: com/appengine/common/encrypt/AESEncrypter.java | ||
method: "encrypt(String)" | ||
line: 62 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.Cipher | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter (with value "AES") should be any of AES/{CBC, GCM, PCBC, CTR, CTS, CFB, OFB} | ||
location: | ||
file: com/appengine/common/encrypt/AESEncrypter.java | ||
method: "decrypt(String)" | ||
line: 73 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- javax.crypto.spec.SecretKeySpec | ||
violations: | ||
- insecure/condition/randomization | ||
description: > | ||
First parameter was not properly randomized | ||
location: | ||
file: com/appengine/common/encrypt/AESEncrypter.java | ||
method: "loadAesKey(String)" | ||
line: 98 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
api: | ||
- java.security.MessageDigest | ||
violations: | ||
- insecure/condition/transformation | ||
description: > | ||
First parameter can have values either MD5 or SHA1 but they should be any of AES/{CBC, GCM, PCBC, CTR, CTS, CFB, OFB} | ||
location: | ||
file: com/appengine/common/encrypt/Digests.java | ||
method: "digest(InputStream, String)" | ||
line: 95 | ||
internal: | ||
pattern: | ||
crash: false | ||
source: | ||
name: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: app-engine | ||
repository: | ||
type: git | ||
url: https://github.com/sofn/app-engine | ||
url: https://github.com/sofn/app-engine |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
build: | ||
classes: app-engine/common/build/classes/java/main | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the placeholder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved in commit eed60ed. |
||
commands: | ||
- gradle compileJava | ||
src: app-engine/common/src/main/java | ||
misuses: | ||
- '1' | ||
- '2' | ||
- '3' | ||
- '4' | ||
revision: db6d288c182cbda5b4d535be5c95f196c4e5aa9b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated changes, please revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved in commit 94b7b36.