Skip to content

Commit 1edca81

Browse files
Add commons-collections vulnerability in multiple dependency paths
Co-authored-by: mickeygousset <20031479+mickeygousset@users.noreply.github.com>
1 parent 6f5b691 commit 1edca81

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ This application contains the following types of security vulnerabilities:
2424
4. **LDAP Injection** - Unescaped user input in LDAP filters
2525
5. **Weak Cryptography** - Use of MD5 and weak random number generation
2626
6. **Hard-coded Secrets** - Embedded credentials and encryption keys
27+
7. **Vulnerable Dependencies** - Uses `commons-collections:3.2.1` which has known deserialization vulnerabilities (CVE-2015-6420, CVE-2017-15708). This dependency appears in multiple paths in the dependency graph:
28+
- As a direct dependency
29+
- As a transitive dependency through `commons-beanutils:1.9.2`
30+
- As a transitive dependency through `commons-digester:2.1``commons-beanutils:1.8.3`
2731

2832
## CodeQL Analysis
2933

@@ -45,8 +49,24 @@ mvn test
4549

4650
# Run the application (demonstrates vulnerabilities)
4751
mvn exec:java -Dexec.mainClass="com.example.app.VulnerableApplication"
52+
53+
# View dependency tree to see multiple paths to commons-collections
54+
mvn dependency:tree -Dverbose
4855
```
4956

57+
### Viewing Multiple Dependency Paths
58+
59+
To see how `commons-collections:3.2.1` appears in multiple paths in the dependency graph, run:
60+
61+
```bash
62+
mvn dependency:tree -Dverbose | grep -E "commons-collections|commons-beanutils|commons-digester"
63+
```
64+
65+
Expected output shows `commons-collections:3.2.1` appearing as:
66+
- A direct dependency
67+
- A transitive dependency through `commons-beanutils` (marked as "omitted for duplicate")
68+
- A transitive dependency through `commons-digester``commons-beanutils`
69+
5070
## Warning
5171

5272
⚠️ **This application contains intentional security vulnerabilities and should never be deployed in a production environment.** It is designed solely for educational purposes and CodeQL demonstration.

pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,34 @@
4141
<artifactId>commons-lang3</artifactId>
4242
<version>3.12.0</version>
4343
</dependency>
44+
45+
<!-- Vulnerable dependency (commons-collections 3.2.1) - direct dependency -->
46+
<dependency>
47+
<groupId>commons-collections</groupId>
48+
<artifactId>commons-collections</artifactId>
49+
<version>3.2.1</version>
50+
</dependency>
51+
52+
<!-- commons-beanutils also depends on commons-collections 3.2.1 - creates multiple paths -->
53+
<dependency>
54+
<groupId>commons-beanutils</groupId>
55+
<artifactId>commons-beanutils</artifactId>
56+
<version>1.9.2</version>
57+
</dependency>
58+
59+
<!-- commons-configuration also depends on commons-collections - creates another path -->
60+
<dependency>
61+
<groupId>commons-configuration</groupId>
62+
<artifactId>commons-configuration</artifactId>
63+
<version>1.10</version>
64+
</dependency>
65+
66+
<!-- commons-digester also depends on commons-collections - creates another path -->
67+
<dependency>
68+
<groupId>commons-digester</groupId>
69+
<artifactId>commons-digester</artifactId>
70+
<version>2.1</version>
71+
</dependency>
4472

4573
<!-- Database connectivity for SQL injection demos -->
4674
<dependency>

0 commit comments

Comments
 (0)