Skip to content

Commit e540521

Browse files
Add comprehensive dependency analysis documentation
Co-authored-by: mickeygousset <20031479+mickeygousset@users.noreply.github.com>
1 parent 1edca81 commit e540521

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

DEPENDENCY_ANALYSIS.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Dependency Analysis
2+
3+
## Vulnerable Dependency in Multiple Paths
4+
5+
This project demonstrates a vulnerable dependency (`commons-collections:3.2.1`) appearing in multiple paths in the dependency graph.
6+
7+
### The Vulnerable Package
8+
9+
**Package**: `commons-collections:3.2.1`
10+
11+
**Known Vulnerabilities**:
12+
- CVE-2015-6420: Serialized-object interfaces in certain Cisco Collaboration and Social Media implementations allow remote attackers to execute arbitrary commands
13+
- CVE-2017-15708: InvokerTransformer code was present in commons-collections4 1.0-4.1 which allowed remote code execution
14+
15+
### Dependency Paths
16+
17+
The `commons-collections:3.2.1` package appears in the following paths in the dependency graph:
18+
19+
1. **Direct Dependency**
20+
```
21+
vulnerable-app
22+
└── commons-collections:3.2.1
23+
```
24+
25+
2. **Transitive Dependency via commons-beanutils**
26+
```
27+
vulnerable-app
28+
└── commons-beanutils:1.9.2
29+
└── commons-collections:3.2.1
30+
```
31+
32+
3. **Transitive Dependency via commons-digester**
33+
```
34+
vulnerable-app
35+
└── commons-digester:2.1
36+
└── commons-beanutils:1.8.3
37+
└── commons-collections:3.2.1
38+
```
39+
40+
### Verification
41+
42+
To verify that the package appears in multiple paths, run:
43+
44+
```bash
45+
mvn dependency:tree -Dverbose
46+
```
47+
48+
Look for lines showing `commons-collections` with annotations like "omitted for duplicate" which indicates it's being pulled in through multiple paths.
49+
50+
Example output:
51+
```
52+
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
53+
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
54+
[INFO] | \- (commons-collections:commons-collections:jar:3.2.1:compile - omitted for duplicate)
55+
[INFO] +- commons-digester:commons-digester:jar:2.1:compile
56+
[INFO] | +- (commons-beanutils:commons-beanutils:jar:1.8.3:compile - omitted for conflict with 1.9.2)
57+
```
58+
59+
### Why This Matters
60+
61+
In real-world scenarios, vulnerable dependencies often appear in multiple paths through the dependency graph. This makes them:
62+
- More challenging to identify
63+
- Harder to remediate (requires updating multiple parent dependencies)
64+
- More likely to be overlooked by basic security scanning
65+
66+
This repository intentionally includes this pattern to demonstrate how dependency scanning tools like GitHub's Dependabot and CodeQL can detect such vulnerabilities across the entire dependency graph.
67+
68+
## Viewing the Full Dependency Graph
69+
70+
To see the complete dependency tree:
71+
72+
```bash
73+
# Standard view (duplicates are omitted)
74+
mvn dependency:tree
75+
76+
# Verbose view (shows all paths including duplicates)
77+
mvn dependency:tree -Dverbose
78+
79+
# Filter to see only commons-related dependencies
80+
mvn dependency:tree -Dverbose | grep commons
81+
```
82+
83+
## Security Recommendations
84+
85+
⚠️ **For educational purposes only**
86+
87+
In a production environment, you would:
88+
1. Upgrade to a patched version of the vulnerable library
89+
2. If no patch exists, find alternative libraries
90+
3. Use dependency scanning tools to continuously monitor for vulnerabilities
91+
4. Implement Software Composition Analysis (SCA) in your CI/CD pipeline

0 commit comments

Comments
 (0)