Skip to content
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

POM runtime scope ignored #296

Open
ben12 opened this issue Feb 16, 2024 · 0 comments
Open

POM runtime scope ignored #296

ben12 opened this issue Feb 16, 2024 · 0 comments

Comments

@ben12
Copy link

ben12 commented Feb 16, 2024

If I understand, only compile scope dependencies are listed:

if (d.Scope != "" && d.Scope != "compile") || d.Optional {
continue
}
dependencies = append(dependencies, d.ToArtifact(opts))

So when I use Trivy, it seems what vulnerabilities in runtime scope dependencies are not found.
For example, if spring-cloud-starter-netflix-eureka-client is present in the pom.xml :

org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:4.0.3 [compile]
   -> com.netflix.eureka:eureka-client:2.0.1 [compile]
       -> org.codehaus.jettison:jettison:1.4.0 [runtime]

org.codehaus.jettison:jettison:1.4.0 is not analyzed, and these vulnerabilities are not found:

Using CycloneDX sbom:

├────────────────────────────────────────────┼────────────────┼──────────┤        ├───────────────────┼─────────────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ org.codehaus.jettison:jettison             │ CVE-2022-40150 │ HIGH     │        │ 1.4.0             │ 1.5.2                               │ jettison: memory exhaustion via user-supplied XML or JSON    │
│                                            │                │          │        │                   │                                     │ data                                                         │
│                                            │                │          │        │                   │                                     │ https://avd.aquasec.com/nvd/cve-2022-40150                   │
│                                            ├────────────────┤          │        │                   │                                     ├──────────────────────────────────────────────────────────────┤
│                                            │ CVE-2022-45685 │          │        │                   │                                     │ jettison: stack overflow in JSONObject() allows attackers to │
│                                            │                │          │        │                   │                                     │ cause a Denial of...                                         │
│                                            │                │          │        │                   │                                     │ https://avd.aquasec.com/nvd/cve-2022-45685                   │
│                                            ├────────────────┤          │        │                   │                                     ├──────────────────────────────────────────────────────────────┤
│                                            │ CVE-2022-45693 │          │        │                   │                                     │ jettison: If the value in map is the map's self, the...      │
│                                            │                │          │        │                   │                                     │ https://avd.aquasec.com/nvd/cve-2022-45693                   │
│                                            ├────────────────┤          │        │                   ├─────────────────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                            │ CVE-2023-1436  │          │        │                   │ 1.5.4                               │ jettison: Uncontrolled Recursion in JSONArray                │
│                                            │                │          │        │                   │                                     │ https://avd.aquasec.com/nvd/cve-2023-1436                    │
│                                            ├────────────────┼──────────┤        │                   ├─────────────────────────────────────┼──────────────────────────────────────────────────────────────┤
│                                            │ CVE-2022-40149 │ MEDIUM   │        │                   │ 1.5.1                               │ jettison: parser crash by stackoverflow                      │
│                                            │                │          │        │                   │                                     │ https://avd.aquasec.com/nvd/cve-2022-40149                   │
├────────────────────────────────────────────┼────────────────┤          │        ├───────────────────┼─────────────────────────────────────┼──────────────────────────────────────────────────────────────┤

I think runtime dependencies should be included.

@ben12 ben12 changed the title POM scopes POM runtime scope ignored Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant