Skip to content

Commit 2994310

Browse files
Merge pull request #7 from devopselvis/copilot/fix-7beab259-13ec-43e5-9002-b4ff7db69c58
Add transitive dependencies with vulnerabilities to demonstrate GitHub dependency graph ellipsis menu
2 parents f0f8ebc + a7fecbb commit 2994310

File tree

3 files changed

+68
-7
lines changed

3 files changed

+68
-7
lines changed

DEPENDENCY_ANALYSIS.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Vulnerable Dependency in Multiple Paths
44

5-
This project demonstrates a vulnerable dependency (`commons-collections:3.2.1`) appearing in multiple paths in the dependency graph.
5+
This project demonstrates vulnerable dependencies that appear in multiple dependency graph paths, along with additional vulnerable packages that have their own transitive dependencies.
66

7-
### The Vulnerable Package
7+
### Primary Vulnerable Package: commons-collections
88

99
**Package**: `commons-collections:3.2.1`
1010

@@ -37,6 +37,32 @@ The `commons-collections:3.2.1` package appears in the following paths in the de
3737
└── commons-collections:3.2.1
3838
```
3939

40+
### Additional Vulnerable Packages
41+
42+
This project also includes other vulnerable packages to demonstrate a more complex dependency graph:
43+
44+
4. **commons-fileupload:1.3.1**
45+
- **Known Vulnerabilities**: CVE-2016-1000031 (File upload vulnerability)
46+
- **Transitive Dependencies**: Brings in `commons-io:2.2`
47+
```
48+
vulnerable-app
49+
└── commons-fileupload:1.3.1
50+
└── commons-io:2.2
51+
```
52+
53+
5. **commons-codec:1.6**
54+
- Older version that may have security issues
55+
- Direct dependency
56+
57+
6. **commons-dbcp:1.4**
58+
- Database connection pooling library
59+
- **Transitive Dependencies**: Brings in `commons-pool:1.5.4`
60+
```
61+
vulnerable-app
62+
└── commons-dbcp:1.4
63+
└── commons-pool:1.5.4
64+
```
65+
4066
### Verification
4167

4268
To verify that the package appears in multiple paths, run:
@@ -55,6 +81,11 @@ Example output:
5581
[INFO] +- commons-digester:commons-digester:jar:2.1:compile
5682
[INFO] | +- (commons-beanutils:commons-beanutils:jar:1.8.3:compile - omitted for conflict with 1.9.2)
5783
[INFO] | \- (commons-collections:commons-collections:jar:3.2.1:compile - would be included)
84+
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
85+
[INFO] | \- commons-io:commons-io:jar:2.2:compile
86+
[INFO] +- commons-codec:commons-codec:jar:1.6:compile
87+
[INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
88+
[INFO] | \- commons-pool:commons-pool:jar:1.5.4:compile
5889
```
5990

6091
The key indicators are:
@@ -69,7 +100,11 @@ In real-world scenarios, vulnerable dependencies often appear in multiple paths
69100
- Harder to remediate (requires updating multiple parent dependencies)
70101
- More likely to be overlooked by basic security scanning
71102

72-
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.
103+
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. By including multiple vulnerable packages with their own transitive dependencies, the repository also demonstrates:
104+
- How vulnerabilities cascade through dependency chains
105+
- The importance of Software Composition Analysis (SCA)
106+
- How GitHub's dependency graph visualizes these complex relationships
107+
- The "..." ellipsis menu that appears in GitHub's UI when packages have additional information, vulnerabilities, or multiple dependency paths. This menu provides access to vulnerability details, remediation suggestions, and dependency path information.
73108

74109
## Viewing the Full Dependency Graph
75110

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ 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-7501). 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`
27+
7. **Vulnerable Dependencies** - Multiple packages with known vulnerabilities:
28+
- `commons-collections:3.2.1` - Deserialization vulnerabilities (CVE-2015-7501), appears in multiple paths:
29+
- As a direct dependency
30+
- As a transitive dependency through `commons-beanutils:1.9.2`
31+
- As a transitive dependency through `commons-digester:2.1``commons-beanutils:1.8.3`
32+
- `commons-fileupload:1.3.1` - Arbitrary file upload vulnerabilities (CVE-2016-1000031)
33+
- `commons-codec:1.6` - Older version with potential vulnerabilities
34+
- `commons-dbcp:1.4` - Database connection pool with transitive dependencies
35+
- Additional transitive vulnerabilities through `commons-io:2.2` and `commons-pool:1.5.4`
3136

3237
## CodeQL Analysis
3338

pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,27 @@
6969
<artifactId>commons-digester</artifactId>
7070
<version>2.1</version>
7171
</dependency>
72+
73+
<!-- commons-fileupload has known vulnerabilities (CVE-2016-1000031) - adds another vulnerable package -->
74+
<dependency>
75+
<groupId>commons-fileupload</groupId>
76+
<artifactId>commons-fileupload</artifactId>
77+
<version>1.3.1</version>
78+
</dependency>
79+
80+
<!-- commons-codec older version - adds another transitive dependency path -->
81+
<dependency>
82+
<groupId>commons-codec</groupId>
83+
<artifactId>commons-codec</artifactId>
84+
<version>1.6</version>
85+
</dependency>
86+
87+
<!-- commons-dbcp with commons-pool - adds more transitive dependencies -->
88+
<dependency>
89+
<groupId>commons-dbcp</groupId>
90+
<artifactId>commons-dbcp</artifactId>
91+
<version>1.4</version>
92+
</dependency>
7293

7394
<!-- Database connectivity for SQL injection demos -->
7495
<dependency>

0 commit comments

Comments
 (0)