Readme: Potential Implementation or Design Gap for detecting Weak or improper cryptography use
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.4k
- Forks
- 663
- PR merge metrics
- No merged PRs in 30d
Description
We are reporting this since in your readme you mention that “Weak or improper cryptography use” is attempted to be found.
We believe this may be due to underlying implementation or design gaps.
Here are the details of our analysis and the cryptographic misuses:
Using QARK version 4.0.0
Using Python version 3.5.2
Using OpenJDK version 1.8.0_232 64 bit
Running on Ubuntu: 18.04 Kernel: 4.4.0-174-generic
Each cryptographic vulnerability was generated as a barebones Java project that only contained a single vulnerability in the main function and used up to two java source files. Additionally, all cryptographic API calls were from Java Cryptographic Architecture (JCA).
Replacing a Secure Parameter with an Insecure Parameter:
```java
Cipher c = Cipher.getInstance("AES/GCM/NoPadding".replace("AES/GCM/NoPadding", "DES"));
```
Replacing an Insecure Parameter with an Insecure Parameter:
```java
Cipher.getInstance(“AES”.replace(“A”, “D”));
```
where “AES” by itself is insecure as it defaults to using ECB.
Transforming string case, e.g., from lower to upper case:
```java
Cipher.getInstance(“des”.toUpperCase(Locale.English));
```
Replacing a noisy version of insecure parameters:
```java
Cipher.getInstance(“DE$S”.replace(“$”, “”));
```
Inserting an Insecure Parameter via chaining method calls:
```java
public class CipherExample {
private String cipherName = "AES/GCM/NoPadding";
public CipherExample methodA() {
cipherName = "AES/GCM/NoPadding";
return this;
}
public CipherExample methodB() {
cipherName = "DES";
return this;
}
public String getCipherName(){
return cipherName;
}
public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException {
Cipher c = Cipher.getInstance(new CipherExample().methodA().methodB().getCipherName());
System.out.println(c.getAlgorithm());
}
}
```
where `obj.A().getCipherName()` returns the secure value, but `obj.A().B().getCipherName()`, and `obj.B().getCipherName()` return the insecure value.
Please let me know if you need any additional information (e.g., logs from our side) in fixing these issues.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the listed Java Cryptographic Architecture examples with QARK 4.0.0 using the stated Python, Java, and Ubuntu environment, then trace the weak-cryptography detection entry point. Compare results for each misuse pattern and define regression coverage; done means the reported gaps are either detected or explicitly documented with their expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, python
- Domain
- security, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100