CVE-2022-31692 detected on spring-security-core but should be spring-security-web only #5122
Closed
mischa-n
started this conversation in
False Detection
Replies: 2 comments 5 replies
-
Hi @mischa-n I created the following pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<name>test</name>
<dependencies>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.7.0</version>
</dependency>
</dependencies>
</project> And Trivy correctly detected vulnerabilities: trivy fs . -f json | jq '.Results[].Vulnerabilities[] | { VulnerabilityID, PkgID }'
2023-09-05T15:24:56.480+0700 INFO Vulnerability scanning is enabled
2023-09-05T15:24:56.480+0700 INFO Secret scanning is enabled
2023-09-05T15:24:56.480+0700 INFO If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2023-09-05T15:24:56.480+0700 INFO Please see also https://aquasecurity.github.io/trivy/v0.45/docs/scanner/secret/#recommendation for faster secret detection
2023-09-05T15:24:57.698+0700 INFO Number of language-specific files: 1
2023-09-05T15:24:57.698+0700 INFO Detecting pom vulnerabilities...
{
"VulnerabilityID": "CVE-2023-34034",
"PkgID": "org.springframework.security:spring-security-core:5.7.0"
}
{
"VulnerabilityID": "CVE-2022-31690",
"PkgID": "org.springframework.security:spring-security-core:5.7.0"
}
{
"VulnerabilityID": "CVE-2023-20862",
"PkgID": "org.springframework.security:spring-security-core:5.7.0"
}
{
"VulnerabilityID": "CVE-2022-31692",
"PkgID": "org.springframework.security:spring-security-web:5.7.0"
}
{
"VulnerabilityID": "CVE-2023-20861",
"PkgID": "org.springframework:spring-core:5.3.20"
}
{
"VulnerabilityID": "CVE-2023-20863",
"PkgID": "org.springframework:spring-core:5.3.20"
}
{
"VulnerabilityID": "CVE-2016-1000027",
"PkgID": "org.springframework:spring-web:5.3.20"
} I also built a docker image with an artifact based on the following pom.xml with spring security version 5.7.10: <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.15</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
But Trivy does not find vulnerability: cat report.json | jq '.Results[].Vulnerabilities[] | select(.VulnerabilityID == "CVE-2022-31692") | {PkgName,InstalledVersion}' |
Beta Was this translation helpful? Give feedback.
5 replies
-
Track #5169 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IDs
CVE-2022-31692
Description
This is a follow-up ticket for https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/issues/245
In an image with Spring Security 5.7.9 or 5.7.10, Trivy incorrectly finds CVE-2022-31692 in spring-security-core (and correctly does not find it in spring-security-web).
The cause could be an incorrect interpretation of https://gitlab.com/gitlab-org/advisories-community/-/blob/main/maven/org.springframework.security/spring-security-core/CVE-2022-31692.yml?ref_type=heads#L11 affected_range: "(0)": this is supposed to signal that no version is affected.
On the other hand, Trivy does not seem to find the CVE when using Spring Security 6.x.x, so the situation or cause is not entirely clear.
Reproduction Steps
Target
Container Image
Scanner
Vulnerability
Target OS
ubuntu: os version: 18.04
Debug Output
Version
Checklist
-f json
that shows data sources and confirmed that the security advisory in data sources was correctBeta Was this translation helpful? Give feedback.
All reactions