mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 08:39:24 +01:00
patch per issue#642
This commit is contained in:
@@ -474,4 +474,20 @@
|
|||||||
<gav regex="true">com\.fasterxml\.jackson\.dataformat:jackson(?!\-dataformat\-xml).*</gav>
|
<gav regex="true">com\.fasterxml\.jackson\.dataformat:jackson(?!\-dataformat\-xml).*</gav>
|
||||||
<cve>CVE-2016-3720</cve>
|
<cve>CVE-2016-3720</cve>
|
||||||
</suppress>
|
</suppress>
|
||||||
|
<suppress base="true">
|
||||||
|
<notes><![CDATA[
|
||||||
|
False positives per issue #642
|
||||||
|
]]></notes>
|
||||||
|
<gav regex="true">^org\.springframework\.boot:spring-boot.*$</gav>
|
||||||
|
<cpe>cpe:/a:pivotal_software:spring_framework</cpe>
|
||||||
|
<cpe>cpe:/a:pivotal:spring_framework</cpe>
|
||||||
|
<cpe>cpe:/a:vmware:springsource_spring_framework</cpe>
|
||||||
|
</suppress>
|
||||||
|
<suppress>
|
||||||
|
<notes><![CDATA[
|
||||||
|
False positives per issue #642
|
||||||
|
]]></notes>
|
||||||
|
<gav regex="true">^org\.springframework:spring-context:.*$</gav>
|
||||||
|
<cpe>cpe:/a:context_project:context</cpe>
|
||||||
|
</suppress>
|
||||||
</suppressions>
|
</suppressions>
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# This file is part of dependency-check-maven.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||||
|
#
|
||||||
|
|
||||||
|
invoker.goals = install ${project.groupId}:${project.artifactId}:${project.version}:check -e -Dformat=ALL
|
||||||
34
dependency-check-maven/src/it/false-positives/pom.xml
Normal file
34
dependency-check-maven/src/it/false-positives/pom.xml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
This file is part of dependency-check-maven.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
Copyright (c) 2017 Jeremy Long. All Rights Reserved.
|
||||||
|
-->
|
||||||
|
<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/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.owasp.test</groupId>
|
||||||
|
<artifactId>test-dataformat-jackson</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<dependencies>
|
||||||
|
<!-- False Positives from issue #642 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot</artifactId>
|
||||||
|
<version>1.4.3.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- end issue #642 -->
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of dependency-check-maven.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
|
// Save NVD-CVE for next IT (if not already done)
|
||||||
|
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||||
|
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||||
|
if (datasDwl.exists() && !datasSave.exists()){
|
||||||
|
System.out.println("Save NVD-CVE into backup");
|
||||||
|
FileUtils.copyFile(datasDwl, datasSave);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Check to see if jackson-dataformat-xml-2.4.5.jar was identified.
|
||||||
|
//TODO change this to xpath and check for CVE-2016-3720
|
||||||
|
String log = FileUtils.readFileToString(new File(basedir, "target/dependency-check-report.xml"), Charset.defaultCharset().name());
|
||||||
|
int count = StringUtils.countMatches(log, "CVE-2016-9878");
|
||||||
|
if (count > 0){
|
||||||
|
System.out.println(String.format("CVE-2016-9878 was identified and should be suppressed"));
|
||||||
|
return false;
|
||||||
|
//throw new Exception(String.format("The update should be unique, it is %s", count));
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of dependency-check-maven.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014 Jeremy Long. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
|
||||||
|
// Load NVD-CVE if not exist and had been saved in a previous IT
|
||||||
|
File datasDwl = new File("target/local-repo/org/owasp/dependency-check-data/3.0", "dc.h2.db");
|
||||||
|
File datasSave = new File("target/nvd-cve-backup", "dc.h2.db");
|
||||||
|
|
||||||
|
if (!datasDwl.exists() && datasSave.exists()){
|
||||||
|
System.out.println("Load NVD-CVE from backup");
|
||||||
|
FileUtils.copyFile(datasSave, datasDwl);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user