顯示具有 OWASP 標籤的文章。 顯示所有文章
顯示具有 OWASP 標籤的文章。 顯示所有文章

2026年6月5日 星期五

[研究]OWASP Dependency Track (DT) 元件弱點掃描工具結果是否不固定

[研究]OWASP Dependency Track (DT) 元件弱點掃描工具結果是否不固定

2026-06-05

OWASP Dependency Track (DT) 元件弱點掃描工具,掃描時會即時自某些平台抓取元件弱點資訊 ? 或定時自某些平台抓取元件弱點資訊 ? 所以相同 原始碼專案,不同時間掃描結果可能不固定?

*****

是的,OWASP Dependency-Track(DT)對同一套原始碼、同一份 BOM(SBOM),在不同時間掃描,結果可能不同,這是正常現象。

Dependency-Track 本身不會在每次掃描時即時到各弱點平台查詢,而是透過背景工作(Background Tasks)定期同步弱點資料庫,之後再將已同步的弱點資料與您的元件進行比對。

DT 主要弱點來源

常見來源包括:

  • National Vulnerability Database(NVD)
  • GitHub Security Advisories(GHSA)
  • Sonatype OSS Index
  • VulnDB(商業資料庫)
  • 其他生態系專屬 Advisory Database

DT 的運作方式

一般流程:


NVD / GHSA / OSS Index ↓ 定期同步 ↓ Dependency-Track 內部資料庫 ↓ 比對您的 SBOM ↓ 產生弱點報告

因此:

  • 掃描時通常不會逐一連線到 NVD 查詢
  • 而是使用 DT 已同步到本機資料庫的弱點資訊
  • 弱點資料會依設定定期更新(例如每小時、每天等)


為什麼相同專案結果會變化?

即使原始碼完全沒改,也可能出現:

1. 新 CVE 公布

例如:


2026/06/01 log4j 2.20.0 沒有弱點 2026/06/05 新增 CVE-2026-xxxxx 重新分析後 出現 Critical

專案沒變,但弱點資料庫變了。


2. CPE 比對規則修正

NVD 或 DT 的 Matching 規則可能更新。

例如原本:


jackson-databind ↓ 無法對應 CPE ↓ 0 個弱點

後來:


jackson-databind ↓ 成功對應 CPE ↓ 新增 5 個 CVE


3. CVSS 分數變動

某 CVE 可能被重新評分:


High 7.5 ↓ Critical 9.8

掃描結果的風險等級就會改變。


4. GHSA / OSS Index 新增 Advisory

有些弱點先出現在 GHSA:


Day 1 無弱點 Day 7 GHSA 發布公告 DT 更新資料後 出現弱點

甚至 NVD 還沒收錄。


5. BOM 解析器升級

Dependency-Track 或 BOM Parser 升級後:

  • 識別出更多元件
  • Package URL (PURL) 解析更準確
  • CPE Mapping 改善

結果也可能增加或減少弱點。


結論

對於 Dependency-Track:

情況 掃描結果是否可能改變
原始碼相同 是
套件版本相同 是
BOM 相同 是
DT 弱點資料庫更新 會改變
NVD/GHSA 新增 CVE 會改變
CPE Mapping 修正 會改變
DT 升級 可能改變

因此在實務上:

Dependency-Track 的掃描結果代表「目前已知的弱點狀態」,而不是「建立 SBOM 當時的弱點狀態」。

所以同一個專案今天掃描是 10 個弱點,一個月後重新分析可能變成 15 個,也可能因誤判修正而變成 8 個,這都屬於正常現象。

(完)

2026年5月9日 星期六

[研究]OWASP 深度掃描 (OWASP dep-scan)

[研究]OWASP 深度掃描 (OWASP dep-scan)

2026-05-09

介紹

OWASP dep-scan 是一款基於已知漏洞、安全建議和專案相依性授權限制的新一代安全和風險稽核工具。它支援本機程式碼庫和容器鏡像作為輸入,並且非常適合與 ASPM/VM 平台和 CI 環境整合。

特徵

掃描大多數應用程式程式碼(包括本機程式碼庫、Linux 容器映像、Kubernetes 清單和作業系統),以識別已知 CVE 並確定優先順序。

  • 對多種語言執行高階可達性分析(參見可達性分析)
  • 軟體包漏洞掃描在本地執行,速度非常快。無需使用伺服器!
  • 產生包含漏洞揭露報告 (VDR) 資訊的軟體物料清單 (SBOM)
  • 產生通用安全諮詢框架 (CSAF) 2.0 VEX 文件(請查看CSAF 自述文件)
  • 對軟體包進行深度風險審計,以發現依賴關係混淆攻擊和維護風險(請參閱風險審計)。

OWASP 深度掃描 (OWASP dep-scan)
https://owasp.org/www-project-dep-scan/

(待續)

2025年8月18日 星期一

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(四)

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(四)

2025-08-18

第四個系統 ASP.NET WebForm 系統。

OWASP Dependency-Track (DT) 畫面


**********

Mend(原 WhiteSource)畫面


(完)

相關

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(一)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(二)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_18.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(三)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_27.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(四)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_84.html


[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(三)

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(三)

2025-08-18

第三個系統 ASP.NET WebForm 系統。

OWASP Dependency-Track (DT) 畫面



**********

Mend(原 WhiteSource)畫面


(完)

相關

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(一)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(二)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_18.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(三)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_27.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(二)

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(二)

2025-08-18

另一個系統 ASP.NET WebForm 系統。

OWASP Dependency-Track (DT) 畫面


**********

Mend(原 WhiteSource)畫面



(完)

相關

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(一)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend.html

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(二)
https://shaurong.blogspot.com/2025/08/owasp-dependency-track-dt-mend_18.html

2025年8月13日 星期三

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(一)

[研究]OWASP Dependency-Track (DT) 與 Mend(原 WhiteSource)實際掃描結果比較(一)

2025-08-13

這是同一個專案

OWASP Dependency-Track (DT) 畫面

註解:Attributed On 欄位的日期代表的是:該漏洞(Vulnerability)或安全資訊 被正式歸因(attributed)給該元件或套件的日期,是 Dependency-Track 從漏洞資料來源(Vulnerability Source)抓回來的日期。

**********

Mend(原 WhiteSource)畫面


Severity 點下去有詳細資訊
********************************************************************************
某 ASP.NET WebForm 專案,OWASP Dependency-Track (DT) 列出了有弱點的元件資訊

System.Security.Cryptography.X509Certificates 4.3.2 CVE-2024-0057
bootstrap 3.4.1 NVD CVE-2024-6484
bootstrap 3.4.1 NVD CVE-2024-6485
bootstrap 3.4.1 NVD CVE-2024-6531
RestSharp 106.15.0 NVD CVE-2024-45302
vue 2.6.11 NVD CVE-2024-9506
bootstrap 3.4.1 NVD CVE-2025-1647
System.Text.Json 9.0.8 NVD CVE-2024-43485

Mend 列出了有弱點的元件資訊
vue-2.6.11.min.js CVE-2024-9506 CVE-2024-6783
vue-2.5.21.js CVE-2024-9506
vue-2.5.21.min.js CVE-2024-9506
vue-2.6.11.js CVE-2024-9506 CVE-2024-6783
sixlabors.imagesharp.2.1.8.nupkg CVE-2025-27598 CVE-2025-54575 CVE-2024-41131 CVE-2024-41132

為何掃出的套件有差異?

ChatGPT 說:

你看到 OWASP Dependency-Track (DT) 和 Mend 掃描結果不一致,主要是因為兩者的元件識別方式、掃描範圍、資料來源、版本解析邏輯都有差異。
我幫你拆成幾個關鍵原因來看:

1. 識別方式不同
  • DT
主要透過 SBOM(Software Bill of Materials)或套件管理檔案(例如 .csproj、packages.config、package-lock.json)中宣告的套件名稱與版本,依照套件層級(NuGet package、NPM package、JAR、Docker image 等)來比對漏洞資料庫。
  • Mend
除了讀取套件管理檔案,也會直接掃描實際檔案內容(如 .js、.dll、.min.js、.nupkg)並用檔案指紋(hash / signature)去匹配漏洞資料庫。
→ 所以 Mend 才會報 vue-2.6.11.min.js 與 vue-2.5.21.js 這種單獨的檔案名稱,而 DT 則是只看到 vue 2.6.11 這個 package。

2. 掃描範圍不同
  • DT 偏向「專案依賴」層面,通常看你宣告安裝的**直接依賴(direct dependencies)**與已解析出的間接依賴(transitive dependencies)。
  • Mend 除了直接與間接依賴,也會去掃描:
    • 壓縮檔內的第三方資源(如 .nupkg 內嵌的 DLL/JS)
    • wwwroot、Scripts 資料夾中的第三方前端庫
    • 未透過套件管理器安裝的手動引用檔案(vendor code)

3. 漏洞資料來源不同
  • DT 常用的來源:
    • NVD(National Vulnerability Database)
    • GitHub Security Advisories
    • Sonatype OSS Index(視設定而定)
  • Mend 的來源更混合:
    • NVD
    • Mend 自家的漏洞資料庫(從各種 GitHub issue、專案 changelog、研究報告匯入)
    • 其他公開與商業威脅情報
    • 因此可能會掃到 NVD 尚未收錄的 CVE(例如 CVE-2024-6783)

4. 版本與比對演算法不同
  • 有些漏洞是針對特定版本範圍發佈的,但不同掃描工具在版本正則判斷上會有落差
    → 可能 DT 判斷你的版本不在漏洞範圍,但 Mend 的匹配規則比較寬鬆,於是報出來。
  • 反之,也可能 Mend 的 signature 沒對到你的檔案版本,於是沒報。

5. 更新頻率不同
  • 漏洞資料庫更新頻率不同會影響掃描結果。
    有些 CVE 發布初期,NVD 還沒「enrich」(補充詳細描述與受影響版本),DT 可能就暫時沒有資訊,而 Mend 可能已經自行補齊。

💡 簡單比喻
  • DT 比較像「看你說你家買了哪些電器,去查電器型號有沒有瑕疵」;
  • Mend 像是「直接進你家,數你有幾台電器,連朋友送你的、二手的、沒登記的都找出來比對」。

********************************************************************************


(完)

2025年5月8日 星期四

[研究]OWASP WebGoat v2025.3 滲透測試學習平台安裝 (Windows 2025)

[研究]OWASP WebGoat v2025.3 滲透測試學習平台安裝 (Windows 2025)

2025-05-08

https://owasp.org/www-project-webgoat/

https://github.com/WebGoat/WebGoat
https://github.com/WebGoat/WebGoat/releases

WebGoat 是一個由 OWASP 維護的、故意不安全的 Web 應用程式,旨在教授 Web 應用程序安全課程。 

Category:OWASP WebGoat Project
https://www.owasp.org/index.php/Category:OWASP_WebGoat_Project

GitHub - WebGoat/WebGoat: WebGoat is a deliberately insecure application
https://github.com/WebGoat/WebGoat
網頁上說需要Java 23,指令類似如下

export TZ=Europe/Amsterdam # or your timezone
java -Dfile.encoding=UTF-8 -jar webgoat-2025.3.jar

Microsoft Build of OpenJDK
直接下載 (找格式為 .msi 的安裝方便些),此處 Java 只到 21,先試試看

Java 安裝後,隨便啟動個「命令提示字元」視窗,測試一下,確認版本。
C:\>java --version
openjdk 21.0.7 2025-04-15 LTS
OpenJDK Runtime Environment Microsoft-11369940 (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Microsoft-11369940 (build 21.0.7+6-LTS, mixed mode, sharing)
C:\>


啟動 WebGoat 其實只要下面即可,不用 -Dfile.encoding=UTF-8 參數

java   -jar   webgoat-2025.3.jar

WebGoat 預設只允許本機(localhost)連線,這是為了安全性考量,避免其他人未經授權就能存取它。若你想讓其他機器(例如區網內的其他電腦)也能連上 WebGoat,有幾個方式可以設定,以下是最常見的方式:

java   -jar   webgoat-2025.3.jar --server.address=0.0.0.0 --server.port=8080   

或下面(推薦)

java   -jar   webgoat-2025.3.jar --server.address=0.0.0.0 

在Windows Server 2025上測試

在Windows Server 2025上測試

C:\>java --version
openjdk 21.0.7 2025-04-15 LTS
OpenJDK Runtime Environment Microsoft-11369940 (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Microsoft-11369940 (build 21.0.7+6-LTS, mixed mode, sharing)

C:\>cd WebGoat

C:\WebGoat>java -jar webgoat-2025.3.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/owasp/webgoat/server/StartWebGoat has been compiled by a more recent version of the Java Runtime (class file version 67.0), this version of the Java Runtime only recognizes class file versions up to 65.0
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
        at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:107)
        at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:534)
        at java.base/java.lang.Class.forName(Class.java:513)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:99)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40)

C:\WebGoat>

說明了兩件事:

class file version 67.0 表示 WebGoat 2025.3 是使用 Java 23 編譯的。

this version of the Java Runtime only recognizes class file versions up to 65.0 表示你目前的 Java 是 Java 21(對應 class file version 65.0)。

移除Java 21,改安裝 jdk-24_windows-x64_bin.msi

執行

C:\>java --version
java 24.0.1 2025-04-15
Java(TM) SE Runtime Environment (build 24.0.1+9-30)
Java HotSpot(TM) 64-Bit Server VM (build 24.0.1+9-30, mixed mode, sharing)

C:\>cd WebGoat

C:\WebGoat>java -jar webgoat-2025.3.jar
2025-05-08T09:27:00.195+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : Starting StartWebGoat v2025.3 using Java 24.0.1 with PID 4264 (C:\WebGoat\webgoat-2025.3.jar started by Administrator in C:\WebGoat)
2025-05-08T09:27:00.204+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : No active profile set, falling back to 1 default profile: "default"
2025-05-08T09:27:00.807+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : Started StartWebGoat in 1.257 seconds (process running for 2.196)
 __        __   _  __        __    _  __
 \ \      / /__| |_\ \      / /__ | |/ _|
  \ \ /\ / / _ \ '_ \ \ /\ / / _ \| | |_
   \ V  V /  __/ |_) \ V  V / (_) | |  _|
    \_/\_/ \___|_.__/ \_/\_/ \___/|_|_|

2025-05-08T09:27:01.078+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : No active profile set, falling back to 1 default profile: "default"
2025-05-08T09:27:02.044+08:00  INFO 4264 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2025-05-08T09:27:02.122+08:00  INFO 4264 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 61 ms. Found 2 JPA repository interfaces.
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.apache.tomcat.jni.Library in an unnamed module (jar:nested:/C:/WebGoat/webgoat-2025.3.jar/!BOOT-INF/lib/tomcat-embed-core-10.1.36.jar!/)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

2025-05-08T09:27:04.008+08:00  INFO 4264 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 9090 (http)
2025-05-08T09:27:04.040+08:00  INFO 4264 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2025-05-08T09:27:04.040+08:00  INFO 4264 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-05-08T09:27:04.111+08:00  INFO 4264 --- [           main] o.a.c.c.C.[.[localhost].[/WebWolf]       : Initializing Spring embedded WebApplicationContext
2025-05-08T09:27:04.112+08:00  INFO 4264 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2911 ms
2025-05-08T09:27:04.555+08:00  INFO 4264 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2025-05-08T09:27:05.210+08:00  INFO 4264 --- [           main] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Driver does not support get/set network timeout for connections. (feature not supported)
2025-05-08T09:27:05.212+08:00  INFO 4264 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection org.hsqldb.jdbc.JDBCConnection@7bfa1eb5
2025-05-08T09:27:05.215+08:00  INFO 4264 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2025-05-08T09:27:05.424+08:00  INFO 4264 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2025-05-08T09:27:05.578+08:00  INFO 4264 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.6.8.Final
2025-05-08T09:27:05.644+08:00  INFO 4264 --- [           main] o.h.c.internal.RegionFactoryInitiator    : HHH000026: Second-level cache disabled
2025-05-08T09:27:06.138+08:00  INFO 4264 --- [           main] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2025-05-08T09:27:06.226+08:00  WARN 4264 --- [           main] org.hibernate.orm.deprecation            : HHH90000025: HSQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected bydefault)
2025-05-08T09:27:06.244+08:00  INFO 4264 --- [           main] org.hibernate.orm.connections.pooling    : HHH10001005: Database info:
        Database JDBC URL [Connecting through datasource 'HikariDataSource (HikariPool-1)']
        Database driver: undefined/unknown
        Database version: 2.7.3
        Autocommit mode: undefined/unknown
        Isolation level: undefined/unknown
        Minimum pool size: undefined/unknown
        Maximum pool size: undefined/unknown
2025-05-08T09:27:07.471+08:00  INFO 4264 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2025-05-08T09:27:07.476+08:00  INFO 4264 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2025-05-08T09:27:08.556+08:00  WARN 4264 --- [           main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with an AuthenticationProvider bean. UserDetailsService beans will not be used by Spring Security for automatically configuring username/password login. Consider removing the AuthenticationProvider bean. Alternatively, consider using the UserDetailsService in a manually instantiated DaoAuthenticationProvider. If the current configuration is intentional, to turn off this warning, increase the logging level of 'org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer' to ERROR
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::invokeCleaner has been called by nonapi.io.github.classgraph.utils.FileUtils (jar:nested:/C:/WebGoat/webgoat-2025.3.jar/!BOOT-INF/lib/classgraph-4.8.173.jar!/)
WARNING: Please consider reporting this to the maintainers of class nonapi.io.github.classgraph.utils.FileUtils
WARNING: sun.misc.Unsafe::invokeCleaner will be removed in a future release
2025-05-08T09:27:11.169+08:00  INFO 4264 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 9090 (http) with context path '/WebWolf'
2025-05-08T09:27:11.222+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : Started StartWebGoat in 10.217 seconds (process running for 12.61)
 __        __   _      ____             _
 \ \      / /__| |__  / ___| ___   __ _| |_
  \ \ /\ / / _ \ '_ \| |  _ / _ \ / _` | __|
   \ V  V /  __/ |_) | |_| | (_) | (_| | |_
    \_/\_/ \___|_.__/ \____|\___/ \__,_|\__|

2025-05-08T09:27:11.604+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : No active profile set, falling back to 1 default profile: "default"
2025-05-08T09:27:12.289+08:00  INFO 4264 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2025-05-08T09:27:12.303+08:00  INFO 4264 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 12 ms. Found 2 JPA repository interfaces.
2025-05-08T09:27:12.660+08:00  INFO 4264 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2025-05-08T09:27:12.662+08:00  INFO 4264 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2025-05-08T09:27:12.662+08:00  INFO 4264 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.36]
2025-05-08T09:27:12.671+08:00  INFO 4264 --- [           main] o.a.c.c.C.[.[localhost].[/WebGoat]       : Initializing Spring embedded WebApplicationContext
2025-05-08T09:27:12.674+08:00  INFO 4264 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 966 ms
2025-05-08T09:27:13.225+08:00  INFO 4264 --- [           main] org.flywaydb.core.FlywayExecutor         : Database: jdbc:hsqldb:file:C:\Users\Administrator/.webgoat-2025.3//webgoat (HSQL Database Engine 2.7)
2025-05-08T09:27:13.290+08:00  INFO 4264 --- [           main] o.f.core.internal.database.base.Schema   : Creating schema "container" ...
2025-05-08T09:27:13.325+08:00  INFO 4264 --- [           main] o.f.c.i.s.JdbcTableSchemaHistory         : Creating Schema History table "container"."flyway_schema_history" ...
2025-05-08T09:27:13.434+08:00  INFO 4264 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema "container": null
2025-05-08T09:27:13.466+08:00  INFO 4264 --- [           main] o.f.core.internal.command.DbMigrate      : Migrating schema "container" to version "1 - init"
2025-05-08T09:27:13.487+08:00  INFO 4264 --- [           main] o.f.core.internal.command.DbMigrate      : Successfully applied 1 migration to schema "container", now at version v1 (execution time 00:00.012s)
2025-05-08T09:27:13.564+08:00  INFO 4264 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2025-05-08T09:27:13.583+08:00  INFO 4264 --- [           main] o.h.c.internal.RegionFactoryInitiator    : HHH000026: Second-level cache disabled
2025-05-08T09:27:13.628+08:00  INFO 4264 --- [           main] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2025-05-08T09:27:13.634+08:00  WARN 4264 --- [           main] org.hibernate.orm.deprecation            : HHH90000025: HSQLDialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected bydefault)
2025-05-08T09:27:13.636+08:00  INFO 4264 --- [           main] org.hibernate.orm.connections.pooling    : HHH10001005: Database info:
        Database JDBC URL [Connecting through datasource 'org.springframework.jdbc.datasource.DriverManagerDataSource@5b3c2e59']
        Database driver: undefined/unknown
        Database version: 2.7.3
        Autocommit mode: undefined/unknown
        Isolation level: undefined/unknown
        Minimum pool size: undefined/unknown
        Maximum pool size: undefined/unknown
2025-05-08T09:27:13.964+08:00  INFO 4264 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2025-05-08T09:27:13.997+08:00  INFO 4264 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2025-05-08T09:27:14.146+08:00  INFO 4264 --- [           main] o.o.w.lessons.logging.LogBleedingTask    : Password for admin: NWY0YjQ0ZDYtNjUyOC00Y2EyLWIzZWYtNjU5OTZjOTVjZjcx
2025-05-08T09:27:19.228+08:00  WARN 4264 --- [           main] r$InitializeUserDetailsManagerConfigurer : Global AuthenticationManager configured with an AuthenticationProvider bean. UserDetailsService beans will not be used by Spring Security for automatically configuring username/password login. Consider removing the AuthenticationProvider bean. Alternatively, consider using the UserDetailsService in a manually instantiated DaoAuthenticationProvider. If the current configuration is intentional, to turn off this warning, increase the logging level of 'org.springframework.security.config.annotation.authentication.configuration.InitializeUserDetailsBeanManagerConfigurer' to ERROR
2025-05-08T09:27:20.190+08:00  INFO 4264 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 3 endpoints beneath base path '/actuator'
2025-05-08T09:27:20.230+08:00  WARN 4264 --- [           main] thorizationManagerRequestMatcherRegistry : One of the patterns in [/favicon.ico, /css/**, /images/**, /js/**, fonts/**, /plugins/**, /registration, /register.mvc, /actuator/**] is missing a leading slash. This is discouraged; please include the leading slash in all your request matcher patterns. In future versions of Spring Security, leaving out the leading slash will result in an exception.
2025-05-08T09:27:20.545+08:00  WARN 4264 --- [           main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates, check your Thymeleaf configuration, or set spring.thymeleaf.check-template-location=false)
2025-05-08T09:27:20.586+08:00  INFO 4264 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path '/WebGoat'
2025-05-08T09:27:20.596+08:00  INFO 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : Started StartWebGoat in 9.033 seconds (process running for 21.985)
2025-05-08T09:27:20.599+08:00  WARN 4264 --- [           main] org.owasp.webgoat.server.StartWebGoat    : Please browse to http://127.0.0.1:8080/WebGoat to start using WebGoat...

執行結果正常

訊息顯示 Undertow started on port(s) 8080 (http) with context path '/WebGoat'


或
http://127.0.0.1:8080/WebGoat
注意,是 HTTP,還有注意 WebGoat 的大小寫


如果啟動訊息最後出現失敗,port 8080 被占用,可查是誰

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2025-05-08T10:00:10.400+08:00 ERROR 7728 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
       

檢查誰用了 Port 8080

C:\>netstat -nao | find "8080"
  TCP    127.0.0.1:8080         0.0.0.0:0              LISTENING       4264
  TCP    127.0.0.1:61395        127.0.0.1:8080         TIME_WAIT       0
  TCP    127.0.0.1:61396        127.0.0.1:8080         TIME_WAIT       0
  TCP    127.0.0.1:61402        127.0.0.1:8080         TIME_WAIT       0
  TCP    127.0.0.1:61403        127.0.0.1:8080         TIME_WAIT       0

C:\>tasklist /fi "pid eq 4264

映像名稱                       PID 工作階段名稱      工作階段 #    RAM使用量
========================= ======== ================ =========== ============
java.exe                      4264 Console                    1    454,144 K

C:\>

可以用【工作管理員】,把 java.exe 【結束工作】

(下圖) 上圖登入畫面按下 Register New User,建立一個帳號就可以登入 




左邊選單是依照 OWASP Top 10

要結束程式,「命令提示字元」中按下 Ctrl-C 中斷程式即可。
如果再次用 Java 啟動 WebGoat 發現 Port 8080 仍被占用,就用【工作管理員】把 java.exe 結束掉。

(完)

相關

[研究]OWASP WebGoat v2025.3 滲透測試學習平台安裝 (Windows 2025)
https://shaurong.blogspot.com/2025/05/owasp-webgoat-v20253-windows-2025.html

[研究]OWASP WebGoat v2023.8 滲透測試學習平台 (Windows 2022)
https://shaurong.blogspot.com/2023/12/owasp-webgoat-v20238-windows-2022.html

[研究]OWASP WebGoat 8.2.2 滲透測試學習平台 (Windows Server 2019)(二)
https://shaurong.blogspot.com/2022/05/owasp-webgoat-822-windows-server-2019.html

[研究]OWASP WebGoat 8.2.2 滲透測試學習平台 (Windows 10)

[研究]OWASP WebGoat 8.2.2、Webwolf 8.2.2滲透測試學習平台安安裝、啟動 (Windows 2019)
https://shaurong.blogspot.com/2022/05/owasp-webgoat-822webwolf-822.html

[研究] OWASP WebGoat 8.0 安裝
http://shaurong.blogspot.com/2018/06/owasp-webgoat-80.html

[研究] OWASP WebGoatFor.Net 安裝
http://shaurong.blogspot.com/2016/12/owasp-webgoatfornet.html

[研究] OWASP WebGoat 7.1 安裝
http://shaurong.blogspot.com/2016/12/owasp-webgoat-71.html

[研究] OWASP Zed Attack Proxy (ZAP) 2.4.2、2.6.0 滲透測試、弱點掃描工具安裝與試用
http://shaurong.blogspot.com/2015/10/owasp-zed-attack-proxy-zap-242.html

(完)

2025年4月17日 星期四

[研究] OWASP Dependency Check 12.1.0元件依賴關係檢查工具(失敗)

[研究] OWASP Dependency Check 12.1.0元件依賴關係檢查工具(失敗)

2025-04-17

OWASP Dependency Check
https://www.owasp.org/index.php/OWASP_Dependency_Check

官方簡報
http://jeremylong.github.io/DependencyCheck/general/dependency-check.pptx


https://github.com/dependency-check/DependencyCheck/releases/download/v12.1.0/dependency-check-12.1.0-release.zip

Dependency Check 是一種「軟件組成分析工具」 (Software Composition Analysis,SCA) ,它會檢查軟體組成,以及可能漏洞。它使用「通用平台枚舉」(Common Platform Enumeration,CPE)取得軟體組成相關資訊。如果找到,它將產生一個報告,提供「常見漏洞和披露」 Common Vulnerability and Exposure,CVE) 超連結。

注意,結果有可能誤判,此程式對  Java 程式比 .NET 程式合用,對 .NET程式可能誤判。

執行需要 Java JRE,否則不能執行。

下載 OpenJDK Microsoft組建



C:\>C:\dependency-check\bin\dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"
'java' 不是內部或外部命令、可執行的程式或批次檔。

C:\>

敝人安裝 ( JAVA_HOME 可以不用勾選,預設也沒勾)
注意,Java安裝後,要開啟新的「命令提示字元」才能用

C:\>java --version
openjdk 17.0.13 2024-10-15 LTS
OpenJDK Runtime Environment Microsoft-10376486 (build 17.0.13+11-LTS)
OpenJDK 64-Bit Server VM Microsoft-10376486 (build 17.0.13+11-LTS, mixed mode, sharing)

C:\>



C:\dependency-check\bin>dependency-check.bat -v
Dependency-Check Core version 12.1.0

C:\dependency-check\bin>dependency-check.bat
usage: Dependency-Check Core [--advancedHelp] [--disableVersionCheck]
       [--enableExperimental] [--exclude <pattern>] [-f <format>]
       [--failOnCVSS <score>] [-h] [--junitFailOnCVSS <score>] [-l <file>]
       [-n] [--nvdApiKey <apiKey>] [-o <path>] [--prettyPrint] [--project
       <name>] [-s <path>] [--suppression <file>] [-v]

Dependency-Check Core can be used to identify if there are any known CVE
vulnerabilities in libraries utilized by an application. Dependency-Check
Core will automatically update required data from the Internet, such as
the CVE and CPE data files from nvd.nist.gov.

    --advancedHelp              Print the advanced help message.
    --disableVersionCheck       Disables the dependency-check version
                                check
    --enableExperimental        Enables the experimental analyzers.
    --exclude <pattern>         Specify an exclusion pattern. This option
                                can be specified multiple times and it
                                accepts Ant style exclusions.
 -f,--format <format>           The report format (HTML, XML, CSV, JSON,
                                JUNIT, SARIF, JENKINS, GITLAB or ALL). The
                                default is HTML. Multiple format
                                parameters can be specified.
    --failOnCVSS <score>        Specifies if the build should be failed if
                                a CVSS score above a specified level is
                                identified. The default is 11; since the
                                CVSS scores are 0-10, by default the build
                                will never fail.
 -h,--help                      Print this message.
    --junitFailOnCVSS <score>   Specifies the CVSS score that is
                                considered a failure when generating the
                                junit report. The default is 0.
 -l,--log <file>                The file path to write verbose logging
                                information.
 -n,--noupdate                  Disables the automatic updating of the
                                NVD-CVE, hosted-suppressions and RetireJS
                                data.
    --nvdApiKey <apiKey>        The API Key to access the NVD API.
 -o,--out <path>                The folder to write reports to. This
                                defaults to the current directory. It is
                                possible to set this to a specific file
                                name if the format argument is not set to
                                ALL.
    --prettyPrint               When specified the JSON and XML report
                                formats will be pretty printed.
    --project <name>            The name of the project being scanned.
 -s,--scan <path>               The path to scan - this option can be
                                specified multiple times. Ant style paths
                                are supported (e.g. 'path/**/*.jar'); if
                                using Ant style paths it is highly
                                recommended to quote the argument value.
    --suppression <file>        The file path to the suppression XML file.
                                This can be specified more then once to
                                utilize multiple suppression files
 -v,--version                   Print the version information.

C:\dependency-check\bin>

注意 Dependency Check 使用線上資料庫,所以必須連上 Internet 才行。


dependency-check.bat --project "'方案/專案名稱" --scan "bin目錄"  --out  "輸出檔案 or 輸出檔案目錄"


【測試】

WebApplication1 方案是敝人另外用 Visual Studio 2019建立的。


非常慢,隔了一陣子出現 Downloaded 訊息

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan  "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"
[INFO] Checking for updates
[WARN] An NVD API Key was not provided - it is highly recommended to use an NVD API key as the update can take a VERY long time without an API Key
[INFO] NVD API has 289,264 records in this update
[INFO] Downloaded 10,000/289,264 (3%)
[INFO] Downloaded 20,000/289,264 (7%)
[INFO] Downloaded 30,000/289,264 (10%)
[INFO] Downloaded 40,000/289,264 (14%)

...(略)

[ERROR] Failed to process CVE-2011-3380
java.lang.NullPointerException: Cannot invoke "org.apache.commons.dbcp2.BasicDataSource.getConnection()" because "this.connectionPool" is null
        at org.owasp.dependencycheck.data.nvdcve.DatabaseManager.getConnection(DatabaseManager.java:576)
        at org.owasp.dependencycheck.data.nvdcve.CveDB.updateOrInsertVulnerability(CveDB.java:1173)
        at org.owasp.dependencycheck.data.nvdcve.CveDB.updateVulnerability(CveDB.java:1098)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.updateCveDb(NvdApiProcessor.java:119)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.call(NvdApiProcessor.java:96)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.call(NvdApiProcessor.java:40)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
[ERROR] Failed to process CVE-2011-3627
java.lang.NullPointerException: Cannot invoke "org.apache.commons.dbcp2.BasicDataSource.getConnection()" because "this.connectionPool" is null
        at org.owasp.dependencycheck.data.nvdcve.DatabaseManager.getConnection(DatabaseManager.java:576)
        at org.owasp.dependencycheck.data.nvdcve.CveDB.updateOrInsertVulnerability(CveDB.java:1173)
        at org.owasp.dependencycheck.data.nvdcve.CveDB.updateVulnerability(CveDB.java:1098)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.updateCveDb(NvdApiProcessor.java:119)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.call(NvdApiProcessor.java:96)
        at org.owasp.dependencycheck.data.update.nvd.api.NvdApiProcessor.call(NvdApiProcessor.java:40)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

C:\dependency-check\bin>

【加上 NVD API Key 測試】


非常慢,隔了一陣子出現 Downloaded 訊息

C:\>C:\dependency-check\bin\dependency-check.bat --project "WebApplication1" --scan  "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp" --nvdApiKey 申請得到的Key
[INFO] Checking for updates
[INFO] NVD API has 289,459 records in this update
[INFO] Downloaded 10,000/289,459 (3%)
[INFO] Downloaded 20,000/289,459 (7%)
[INFO] Downloaded 30,000/289,459 (10%)
[INFO] Downloaded 40,000/289,459 (14%)
[INFO] Downloaded 50,000/289,459 (17%)
[INFO] Downloaded 60,000/289,459 (21%)
[INFO] Downloaded 70,000/289,459 (24%)
[INFO] Downloaded 80,000/289,459 (28%)
[INFO] Downloaded 90,000/289,459 (31%)
[INFO] Downloaded 100,000/289,459 (35%)
[INFO] Downloaded 110,000/289,459 (38%)
[INFO] Downloaded 120,000/289,459 (41%)
[INFO] Downloaded 130,000/289,459 (45%)
[INFO] Downloaded 140,000/289,459 (48%)
[INFO] Downloaded 150,000/289,459 (52%)
[INFO] Downloaded 160,000/289,459 (55%)
[INFO] Downloaded 170,000/289,459 (59%)
[INFO] Downloaded 180,000/289,459 (62%)
[INFO] Downloaded 190,000/289,459 (66%)
[INFO] Downloaded 200,000/289,459 (69%)
[INFO] Downloaded 210,000/289,459 (73%)
[INFO] Downloaded 220,000/289,459 (76%)
[INFO] Downloaded 230,000/289,459 (79%)
[INFO] Downloaded 240,000/289,459 (83%)
[INFO] Downloaded 250,000/289,459 (86%)


測試2次,隔天看進度卡死停到 Download,暫時放棄、、、

(待續)

相關

[研究] OWASP Dependency-Check 9.0.6 元件依賴關係檢查工具
https://shaurong.blogspot.com/2023/12/owasp-dependency-check-906.html

[研究] OWASP Dependency Check 6.2.2 元件依賴關係檢查工具https://shaurong.blogspot.com/2021/08/owasp-dependency-check-622.html

[研究] OWASP Dependency Check 4.0.0 元件依賴關係檢查http://shaurong.blogspot.com/2018/12/owasp-dependency-check-400.html


2024年3月4日 星期一

[研究]OWASP Dependency-Track 報告 System.Security.Cryptography.X509Certificates 4.3.2 有弱點 CVE-2024-0057

[研究]OWASP Dependency-Track 報告 System.Security.Cryptography.X509Certificates 4.3.2 有弱點

2024-03-04


CVE-2024-0057 10 Jan 2024

CVSS Base Score : 9.8

CVSS Impact Subscore : 5.9

CVSS Exploitability Subscore : 3.9

References


.NET、.NET Framework 和 Visual Studio 安全性功能略過弱點 Recently updated

CVE-2024-0057
安全性弱點
發行日期: 2024年1月9日、上次更新:2024年2月13日
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-0057

CVE-2024-0057 .NET Vulnerability in NetApp Products
https://security.netapp.com/advisory/ntap-20240208-0007/

攻擊者如何利用此漏洞?

攻擊者可以透過建立特製的 X.509 憑證來利用此漏洞,故意引入或故意引發鏈建置失敗。

成功利用此漏洞可以繞過什麼樣的安全功能?

當基於 Microsoft .NET Framework 的應用程式使用 X.509 鏈建立 API 但由於邏輯缺陷而未完全驗證 X.509 憑證時,存在安全功能繞過漏洞。攻擊者可以提供帶有格式錯誤的簽名的任意不受信任的證書,從而觸發框架中的錯誤。該框架將正確報告 X.509 鏈建置失敗,但會傳回錯誤的失敗原因程式碼。利用此原因程式碼做出自己的鏈建構信任決策的應用程式可能會無意中將此場景視為成功的鏈建構。這可能允許對手破壞應用程式的典型身份驗證邏輯。

CWE-20: Improper Input Validation
https://cwe.mitre.org/data/definitions/20

NuGet 上 System.Security.Cryptography.X509Certificates 4.3.2 已經是最新版
https://www.nuget.org/packages/system.security.cryptography.x509certificates/


因為 'System.Net.Http.4.3.4' 相依於它,所以無法解除安裝 'System.Security.Cryptography.X509Certificates.4.3.2'。


用 NuGet 把 System.Net.Http 移除後,編譯會出錯

error CS1069: 命名空間 'System.Net.Http' 中找不到類型名稱 'HttpClient'。此類型已轉送到組件 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a',請考慮加入該組件的參考。

(完)

2023年12月18日 星期一

[研究]OWASP Dependency-Check 執行出錯 Failed to initialize the RetireJS repo

[研究]OWASP Dependency-Check 執行出錯 Failed to initialize the RetireJS repo

2023-12-18


********************************************************************************

Gitea 簽入程式碼後,Jenkins 呼叫 OWASP Dependency-Check,結果出錯

[ERROR] Failed to initialize the RetireJS repo
org.owasp.dependencycheck.data.update.exception.UpdateException: Failed to initialize the RetireJS repo
	at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:141)
	at org.owasp.dependencycheck.data.update.RetireJSDataSource.update(RetireJSDataSource.java:89)
	at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:902)
	at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:707)
	at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:633)
	at org.owasp.dependencycheck.App.runScan(App.java:259)
	at org.owasp.dependencycheck.App.run(App.java:191)
	at org.owasp.dependencycheck.App.main(App.java:86)
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Download failed, unable to copy 'https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json' to 'D:\dependency-check\data\jsrepository.json'; Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
	at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:135)
	at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:91)
	at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:139)
	... 7 common frames omitted
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
	at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:267)
	at org.owasp.dependencycheck.utils.HttpResourceConnection.fetch(HttpResourceConnection.java:163)
	at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:130)
	... 9 common frames omitted
Caused by: java.net.ConnectException: Connection refused: no further information
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636)
	at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
	at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1242)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
	at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:206)
	... 11 common frames omitted
[INFO] Updating CISA Known Exploited Vulnerability list: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
[INFO] Begin database defrag
[INFO] End database defrag (6658 ms)
[WARN] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[ERROR] Unable to continue dependency-check analysis.
[ERROR] One or more fatal errors occurred
[ERROR] Failed to initialize the RetireJS repo
[ERROR] No documents exist
ERROR: Mark build as failed because of exit code 13
Build step 'Invoke Dependency-Check' changed build result to FAILURE
[DependencyTrack] Publishing artifact to Dependency-Track - http://10.3.xxx.xxx:8081
[DependencyTrack] The artifact was successfully published. You may now navigate to http://10.3.xxx.xxx:8081/projects/xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx to view the results.
Sending e-mails to: 略@略.com
[Office365connector] Matched status 'FAILURE' for webhook with name 'nccstjenkins'.
No emails were triggered.
Finished: FAILURE


********************************************************************************

解決

[研究] OWASP Dependency-Check 9.0.6 元件依賴關係檢查工具https://shaurong.blogspot.com/2023/12/owasp-dependency-check-906.html

整個 Dependency-Check 目錄砍了,執行一次,雖然沒 NVD API Key,會下載。

第二次開始,都加上  -n  參數。

(完)

相關

Dependency Check Fails to Run (Failed to initialize the RetireJS repo) #6033
依賴項檢查無法運作(無法初始化 RetireJS 儲存庫) 第6033章
2023-11-01
https://github.com/jeremylong/DependencyCheck/issues/6033

Failed to initialize the RetireJS repo · Issue #2599 · jeremylong/DependencyCheck · GitHub
https://github.com/jeremylong/DependencyCheck/issues/2599


[研究] OWASP Dependency-Check 9.0.6 元件依賴關係檢查工具

[研究] OWASP Dependency Check 9.0.6 元件依賴關係檢查工具

2023-12-18

OWASP Dependency Check
https://www.owasp.org/index.php/OWASP_Dependency_Check

官方簡報
http://jeremylong.github.io/DependencyCheck/general/dependency-check.pptx

dependency-check-9.0.6-release.zip 於 2023-12-15 釋出。

Dependency Check 是一種「軟件組成分析工具」 (Software Composition Analysis,SCA) ,它會檢查軟體組成,以及可能漏洞。它使用「通用平台枚舉」(Common Platform Enumeration,CPE)取得軟體組成相關資訊。如果找到,它將產生一個報告,提供「常見漏洞和披露」 Common Vulnerability and Exposure,CVE) 超連結。

注意,結果有可能誤判,此程式對  Java 程式比 .NET 程式合用,對 .NET程式可能誤判。

執行需要 Java JRE,否則不能執行。

Microsoft Windows [版本 10.0.19043.1110]
(c) Microsoft Corporation. 著作權所有,並保留一切權利。

C:\>C:\dependency-check\bin\dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"
'java' 不是內部或外部命令、可執行的程式或批次檔。

C:\>

敝人安裝 ( JAVA_HOME 可以不用勾選,預設也沒勾)

C:\dependency-check\bin>java --version
openjdk 17.0.3 2022-04-19 LTS
OpenJDK Runtime Environment Microsoft-32931 (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM Microsoft-32931 (build 17.0.3+7-LTS, mixed mode, sharing)

C:\dependency-check\bin>


C:\dependency-check\bin>dependency-check.bat -v
Dependency-Check Core version 9.0.6
C:\dependency-check\bin>dependency-check.bat
usage: Dependency-Check Core [--advancedHelp] [--enableExperimental]
       [--exclude <pattern>] [-f <format>] [--failOnCVSS <score>] [-h]
       [--junitFailOnCVSS <score>] [-l <file>] [-n] [--nvdApiKey <apiKey>]
       [-o <path>] [--prettyPrint] [--project <name>] [-s <path>]
       [--suppression <file>] [-v]

Dependency-Check Core can be used to identify if there are any known CVE
vulnerabilities in libraries utilized by an application. Dependency-Check
Core will automatically update required data from the Internet, such as
the CVE and CPE data files from nvd.nist.gov.

    --advancedHelp              Print the advanced help message.
    --enableExperimental        Enables the experimental analyzers.
    --exclude <pattern>         Specify an exclusion pattern. This option
                                can be specified multiple times and it
                                accepts Ant style exclusions.
 -f,--format <format>           The report format (HTML, XML, CSV, JSON,
                                JUNIT, SARIF, JENKINS, GITLAB or ALL). The
                                default is HTML. Multiple format
                                parameters can be specified.
    --failOnCVSS <score>        Specifies if the build should be failed if
                                a CVSS score above a specified level is
                                identified. The default is 11; since the
                                CVSS scores are 0-10, by default the build
                                will never fail.
 -h,--help                      Print this message.
    --junitFailOnCVSS <score>   Specifies the CVSS score that is
                                considered a failure when generating the
                                junit report. The default is 0.
 -l,--log <file>                The file path to write verbose logging
                                information.
 -n,--noupdate                  Disables the automatic updating of the
                                NVD-CVE, hosted-suppressions and RetireJS
                                data.
    --nvdApiKey <apiKey>        The API Key to access the NVD API.
 -o,--out <path>                The folder to write reports to. This
                                defaults to the current directory. It is
                                possible to set this to a specific file
                                name if the format argument is not set to
                                ALL.
    --prettyPrint               When specified the JSON and XML report
                                formats will be pretty printed.
    --project <name>            The name of the project being scanned.
 -s,--scan <path>               The path to scan - this option can be
                                specified multiple times. Ant style paths
                                are supported (e.g. 'path/**/*.jar'); if
                                using Ant style paths it is highly
                                recommended to quote the argument value.
    --suppression <file>        The file path to the suppression XML file.
                                This can be specified more then once to
                                utilize multiple suppression files
 -v,--version                   Print the version information.

C:\dependency-check\bin>

用法

注意 Dependency Check 使用線上資料庫,所以必須連上 Internet 才行。

dependency-check.bat --project "'方案/專案名稱" --scan "bin目錄"  --out  "輸出檔案 or 輸出檔案目錄"


掃描 .NET 方案,另外要安裝 .NET Core 3.1 SDK 
( 只安裝 .NET Core Runtime 3.1 不行,另外 .NET 5.0 和 .NET Framework 4.8 是另外的東西)

敝人掃描 使用 .NET Framework 4.8 的 WebForm  WebApplication 方案,
虛擬機 Windows 10 每次測試都還原快照,
實驗1:.NET Framework 4.8 Runtime 失敗 
實驗2:.NET Framework 4.8 Dev Pack 失敗
實驗3:.NET Core 3.1 Runtime 失敗
實驗4:.NET Core 3.1 SDK 成功

沒安裝 .NET Core 3.1 SDK  會有下面畫面

dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"


C:\>C:\dependency-check\bin\dependency-check.bat --project "WebApplication1" --scan
   "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"
[INFO] Checking for updates
[INFO] Skipping NVD check since last check was within 4 hours.
[INFO] Skipping RetireJS update since last update was within 24 hours.
[INFO] Check for updates complete (250 ms)
[INFO]

Dependency-Check is an open source tool performing a best effort analysis of 3rd party 
dependencies; false positives and false negatives may exist in the analysis performed by 
the tool. Use of the tool and the reporting provided constitutes acceptance for use in 
an AS IS condition, and there are NO warranties, implied or otherwise, with regard to 
the analysis or its use. Any use of the tool and the reporting provided is at the user’s 
risk. In no event shall the copyright holder or OWASP be held liable for any damages 
whatsoever arising out of or in connection with the use of this tool, the analysis 
performed, or the resulting report.


   About ODC: https://jeremylong.github.io/DependencyCheck/general/internals.html
   False Positives: https://jeremylong.github.io/DependencyCheck/general/suppression.html

? Sponsor: https://github.com/sponsors/jeremylong


[INFO] Analysis Started
[INFO] Finished File Name Analyzer (0 seconds)
[ERROR] ----------------------------------------------------
[ERROR] .NET Assembly Analyzer could not be initialized and at least one 'exe' or 'dll' was 
scanned. The 'dotnet' executable could not be found on the path; either disable the Assembly 
Analyzer or add the path to dotnet core in the configuration.
[ERROR] ----------------------------------------------------
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Created CPE Index (2 seconds)
[INFO] Finished CPE Analyzer (3 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[WARN] Unable to determine Package-URL identifiers for 41 dependencies
[INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Analysis Complete (3 seconds)
[INFO] Writing report to: C:\Temp\dependency-check-report.html

C:\>

9.0.6掃描失敗 (待研究,好像目前需要申請 NVD API Key 才能用)

NVD - API Key Request
https://nvd.nist.gov/developers/request-an-api-key

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"
[INFO] Checking for updates
[WARN] An NVD API Key was not provided - it is highly recommended to use an NVD API key as the update can take a VERY long time without an API Key
[INFO] NVD API has 233,564 records in this update
[INFO] Downloaded 10,000/233,564 (4%)
[INFO] Downloaded 20,000/233,564 (9%)
[INFO] Downloaded 30,000/233,564 (13%)
[INFO] Downloaded 40,000/233,564 (17%)
[INFO] Downloaded 50,000/233,564 (21%)
[INFO] Downloaded 60,000/233,564 (26%)
[INFO] Downloaded 70,000/233,564 (30%)
[INFO] Downloaded 80,000/233,564 (34%)
[INFO] Downloaded 90,000/233,564 (39%)
[INFO] Downloaded 100,000/233,564 (43%)
[INFO] Downloaded 110,000/233,564 (47%)
[INFO] Downloaded 120,000/233,564 (51%)
[INFO] Downloaded 130,000/233,564 (56%)
[INFO] Downloaded 140,000/233,564 (60%)
[INFO] Downloaded 150,000/233,564 (64%)
[INFO] Downloaded 160,000/233,564 (69%)
[INFO] Downloaded 170,000/233,564 (73%)
[INFO] Downloaded 180,000/233,564 (77%)
[INFO] Downloaded 190,000/233,564 (81%)
[INFO] Downloaded 200,000/233,564 (86%)
[INFO] Downloaded 210,000/233,564 (90%)
[ERROR] Error updating the NVD Data
org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:375)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:115)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
        at org.owasp.dependencycheck.App.runScan(App.java:262)
        at org.owasp.dependencycheck.App.run(App.java:194)
        at org.owasp.dependencycheck.App.main(App.java:89)
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 403
        at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:357)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:348)
        ... 7 common frames omitted
[ERROR] Failed to initialize the RetireJS repo
org.owasp.dependencycheck.data.update.exception.UpdateException: Failed to initialize the RetireJS repo
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:152)
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.update(RetireJSDataSource.java:95)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
        at org.owasp.dependencycheck.App.runScan(App.java:262)
        at org.owasp.dependencycheck.App.run(App.java:194)
        at org.owasp.dependencycheck.App.main(App.java:89)
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Download failed, unable to copy 'https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json' to 'C:\dependency-check\data\jsrepository.json'; Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:150)
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:99)
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:150)
        ... 7 common frames omitted
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
        at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:267)
        at org.owasp.dependencycheck.utils.HttpResourceConnection.fetch(HttpResourceConnection.java:163)
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:137)
        ... 9 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:309)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
        at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)
        at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
        at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:580)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
        at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:206)
        ... 11 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
        at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)
        at java.base/sun.security.validator.Validator.validate(Validator.java:264)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)
        ... 26 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
        at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
        at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
        at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
        ... 31 common frames omitted
[INFO] Updating CISA Known Exploited Vulnerability list: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
[INFO] Begin database defrag
[INFO] End database defrag (2726 ms)
[WARN] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[ERROR] Unable to continue dependency-check analysis.
[ERROR] One or more fatal errors occurred
[ERROR] Failed to initialize the RetireJS repo
[ERROR] No documents exist

C:\dependency-check\bin>
C:\dependency-check\bin>

申請收到信件

Request for NVD API Key
收件匣

nvd-noreply@nist.gov
上午10:31 (6 分鐘前)
寄給 我

Thank you for your request for an NVD API Key. Please click the link below to confirm your receipt of this email and activate your API Key. If your key is not activated within seven days, a request for a new API Key must be submitted.

https://nvd.nist.gov/developers/confirm-api-key?uuid=略

For additional information on both the CVE and CPE API, please visit https://nvd.nist.gov/developers.

If you did not request an API Key from the NVD, please contact NVD Support at nvd@nist.gov.

V/r
National Vulnerability Database Team
nvd@nist.gov

點信中連結

NVD API Key Activated
Thank you for confirming your request for an NVD API key. Please securely save this key. Once you close or leave this page, the key will no longer be accessible from this link. If you lose or forget your API key you must request a new one. There is no process for recovering an API Key.

API Key: 略 

To request a new API key, please resubmit an API Key Request. Please note that activating a new key will deactivate the key shown above.

再次掃描 (加上

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"  --nvdApiKey 略
[INFO] Checking for updates
[ERROR] Error updating the NVD Data
org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:375)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:115)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
        at org.owasp.dependencycheck.App.runScan(App.java:262)
        at org.owasp.dependencycheck.App.run(App.java:194)
        at org.owasp.dependencycheck.App.main(App.java:89)
Caused by: io.github.jeremylong.openvulnerability.client.nvd.NvdApiException: NVD Returned Status Code: 404
        at io.github.jeremylong.openvulnerability.client.nvd.NvdCveClient.next(NvdCveClient.java:357)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:348)
        ... 7 common frames omitted
[ERROR] Failed to initialize the RetireJS repo
org.owasp.dependencycheck.data.update.exception.UpdateException: Failed to initialize the RetireJS repo
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:152)
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.update(RetireJSDataSource.java:95)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
        at org.owasp.dependencycheck.App.runScan(App.java:262)
        at org.owasp.dependencycheck.App.run(App.java:194)
        at org.owasp.dependencycheck.App.main(App.java:89)
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Download failed, unable to copy 'https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json' to 'C:\dependency-check\data\jsrepository.json'; Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:150)
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:99)
        at org.owasp.dependencycheck.data.update.RetireJSDataSource.initializeRetireJsRepo(RetireJSDataSource.java:150)
        ... 7 common frames omitted
Caused by: org.owasp.dependencycheck.utils.DownloadFailedException: Error downloading file https://raw.githubusercontent.com/Retirejs/retire.js/master/repository/jsrepository.json; unable to connect.
        at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:267)
        at org.owasp.dependencycheck.utils.HttpResourceConnection.fetch(HttpResourceConnection.java:163)
        at org.owasp.dependencycheck.utils.Downloader.fetchFile(Downloader.java:137)
        ... 9 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
        at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:309)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
        at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458)
        at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201)
        at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
        at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505)
        at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
        at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
        at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:580)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
        at org.owasp.dependencycheck.utils.HttpResourceConnection.obtainConnection(HttpResourceConnection.java:206)
        ... 11 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
        at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)
        at java.base/sun.security.validator.Validator.validate(Validator.java:264)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
        at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)
        ... 26 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
        at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
        at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
        at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
        ... 31 common frames omitted
[INFO] Skipping Known Exploited Vulnerabilities update check since last check was within 24 hours.
[WARN] Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[ERROR] Unable to continue dependency-check analysis.
[ERROR] One or more fatal errors occurred
[ERROR] Failed to initialize the RetireJS repo
[ERROR] No documents exist

C:\dependency-check\bin>

再次掃描,用 -n 參數不更新

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"  --nvdApiKey 略  -n
[INFO]

Dependency-Check is an open source tool performing a best effort analysis of 3rd party dependencies; false positives and false negatives may exist in the analysis performed by the tool. Use of the tool and the reporting provided constitutes acceptance for use in an AS IS condition, and there are NO warranties, implied or otherwise, with regard to the analysis or its use. Any use of the tool and the reporting provided is at the user's risk. In no event shall the copyright holder or OWASP be held liable for any damages whatsoever arising out of or in connection with the use of this tool, the analysis performed, or the resulting report.


   About ODC: https://jeremylong.github.io/DependencyCheck/general/internals.html
   False Positives: https://jeremylong.github.io/DependencyCheck/general/suppression.html

? Sponsor: https://github.com/sponsors/jeremylong


[INFO] Analysis Started
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Assembly Analyzer (1 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (1 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished Sonatype OSS Index Analyzer (1 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Known Exploited Vulnerability Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Finished Unused Suppression Rule Analyzer (0 seconds)
[INFO] Analysis Complete (3 seconds)
[INFO] Writing HTML report to: C:\Temp\dependency-check-report.html

C:\dependency-check\bin>



********************************************************************************

這次不用 NVD API Key,但有 -n 參數

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan "C:\Code\WebApplication1\WebApplication1\bin" --out "C:\Temp"  -n
[INFO]

Dependency-Check is an open source tool performing a best effort analysis of 3rd party dependencies; false positives and false negatives may exist in the analysis performed by the tool. Use of the tool and the reporting provided constitutes acceptance for use in an AS IS condition, and there are NO warranties, implied or otherwise, with regard to the analysis or its use. Any use of the tool and the reporting provided is at the user's risk. In no event shall the copyright holder or OWASP be held liable for any damages whatsoever arising out of or in connection with the use of this tool, the analysis performed, or the resulting report.


   About ODC: https://jeremylong.github.io/DependencyCheck/general/internals.html
   False Positives: https://jeremylong.github.io/DependencyCheck/general/suppression.html

? Sponsor: https://github.com/sponsors/jeremylong


[INFO] Analysis Started
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Assembly Analyzer (0 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (1 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Known Exploited Vulnerability Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Finished Unused Suppression Rule Analyzer (0 seconds)
[INFO] Analysis Complete (2 seconds)
[INFO] Writing HTML report to: C:\Temp\dependency-check-report.html

C:\dependency-check\bin>

********************************************************************************

比對執行過和未執行過的。

********************************************************************************

舊版4.0成功掃描結果如下:

C:\>cd C:\dependency-check\bin

C:\dependency-check\bin>dependency-check.bat --project "WebApplication1" --scan
   "C:\WebApplication1\WebApplication1\bin" --out "C:\Temp"
[INFO] Checking for updates
[INFO] NVD CVE requires several updates; this could take a couple of minutes.
[INFO] Download Started for NVD CVE - 2003
[INFO] Download Started for NVD CVE - 2002
[INFO] Download Complete for NVD CVE - 2003  (1637 ms)
[INFO] Download Started for NVD CVE - 2004
[INFO] Processing Started for NVD CVE - 2003
[INFO] Download Complete for NVD CVE - 2002  (2234 ms)
[INFO] Download Started for NVD CVE - 2005
[INFO] Processing Started for NVD CVE - 2002
[INFO] Processing Complete for NVD CVE - 2003  (1673 ms)
[INFO] Processing Complete for NVD CVE - 2002  (3447 ms)
[INFO] Download Complete for NVD CVE - 2004  (5371 ms)
[INFO] Download Started for NVD CVE - 2006
[INFO] Processing Started for NVD CVE - 2004
[INFO] Processing Complete for NVD CVE - 2004  (2557 ms)
[INFO] Download Complete for NVD CVE - 2005  (13303 ms)
[INFO] Download Started for NVD CVE - 2007
[INFO] Processing Started for NVD CVE - 2005
[INFO] Download Complete for NVD CVE - 2006  (9562 ms)
[INFO] Download Started for NVD CVE - 2008
[INFO] Processing Started for NVD CVE - 2006
[INFO] Download Complete for NVD CVE - 2007  (2447 ms)
[INFO] Download Started for NVD CVE - 2009
[INFO] Processing Started for NVD CVE - 2007
[INFO] Processing Complete for NVD CVE - 2005  (5133 ms)
[INFO] Download Complete for NVD CVE - 2009  (3252 ms)
[INFO] Download Started for NVD CVE - 2010
[INFO] Processing Started for NVD CVE - 2009
[INFO] Download Complete for NVD CVE - 2008  (7546 ms)
[INFO] Download Started for NVD CVE - 2011
[INFO] Processing Started for NVD CVE - 2008
[INFO] Download Complete for NVD CVE - 2010  (2988 ms)
[INFO] Download Started for NVD CVE - 2012
[INFO] Processing Started for NVD CVE - 2010
[INFO] Processing Complete for NVD CVE - 2006  (9601 ms)
[INFO] Download Complete for NVD CVE - 2012  (2472 ms)
[INFO] Download Started for NVD CVE - 2013
[INFO] Processing Started for NVD CVE - 2012
[INFO] Download Complete for NVD CVE - 2011  (3095 ms)
[INFO] Download Started for NVD CVE - 2014
[INFO] Processing Started for NVD CVE - 2011
[INFO] Processing Complete for NVD CVE - 2007  (10145 ms)
[INFO] Download Complete for NVD CVE - 2013  (2599 ms)
[INFO] Download Started for NVD CVE - 2015
[INFO] Processing Started for NVD CVE - 2013
[INFO] Download Complete for NVD CVE - 2014  (2599 ms)
[INFO] Download Started for NVD CVE - 2016
[INFO] Processing Started for NVD CVE - 2014
[INFO] Download Complete for NVD CVE - 2015  (2683 ms)
[INFO] Processing Started for NVD CVE - 2015
[INFO] Download Started for NVD CVE - 2017
[INFO] Download Complete for NVD CVE - 2016  (3402 ms)
[INFO] Processing Started for NVD CVE - 2016
[INFO] Download Started for NVD CVE - 2018
[INFO] Download Complete for NVD CVE - 2017  (4516 ms)
[INFO] Processing Started for NVD CVE - 2017
[INFO] Download Started for NVD CVE - 2019
[INFO] Download Complete for NVD CVE - 2018  (4226 ms)
[INFO] Processing Started for NVD CVE - 2018
[INFO] Download Started for NVD CVE - 2020
[INFO] Download Complete for NVD CVE - 2019  (3122 ms)
[INFO] Processing Started for NVD CVE - 2019
[INFO] Download Started for NVD CVE - 2021
[INFO] Processing Complete for NVD CVE - 2009  (25004 ms)
[INFO] Download Complete for NVD CVE - 2020  (18381 ms)
[INFO] Processing Started for NVD CVE - 2020
[INFO] Processing Complete for NVD CVE - 2008  (33324 ms)
[INFO] Download Complete for NVD CVE - 2021  (19030 ms)
[INFO] Processing Started for NVD CVE - 2021
[INFO] Processing Complete for NVD CVE - 2010  (37242 ms)
[INFO] Processing Complete for NVD CVE - 2015  (41766 ms)
[INFO] Processing Complete for NVD CVE - 2011  (48061 ms)
[INFO] Processing Complete for NVD CVE - 2014  (46927 ms)
[INFO] Processing Complete for NVD CVE - 2016  (47451 ms)
[INFO] Processing Complete for NVD CVE - 2012  (54617 ms)
[INFO] Processing Complete for NVD CVE - 2021  (23563 ms)
[INFO] Processing Complete for NVD CVE - 2019  (45071 ms)
[INFO] Processing Complete for NVD CVE - 2018  (47689 ms)
[INFO] Processing Complete for NVD CVE - 2013  (55981 ms)
[INFO] Processing Complete for NVD CVE - 2017  (49491 ms)
[INFO] Processing Complete for NVD CVE - 2020  (32336 ms)
[INFO] Download Started for NVD CVE - Modified
[INFO] Download Complete for NVD CVE - Modified  (2267 ms)
[INFO] Processing Started for NVD CVE - Modified
[INFO] Processing Complete for NVD CVE - Modified  (1786 ms)
[INFO] Begin database maintenance
[INFO] Updated the CPE ecosystem on 117835 NVD records
[INFO] Removed the CPE ecosystem on 3827 NVD records
[INFO] End database maintenance (31425 ms)
[INFO] Begin database defrag
[INFO] End database defrag (4704 ms)
[INFO] Check for updates complete (147407 ms)
[INFO]

Dependency-Check is an open source tool performing a best effort analysis of 3rd party 
dependencies; false positives and false negatives may exist in the analysis performed 
by the tool. Use of the tool and the reporting provided constitutes acceptance for
 use in an AS IS condition, and there are NO warranties, implied or otherwise, with 
regard to the analysis or its use. Any use of the tool and the reporting provided is 
at the user’s risk. In no event shall the copyright holder or OWASP be held liable for
 any damages whatsoever arising out of or in connection with the use of this tool, 
the analysis performed, or the resulting report.


   About ODC: https://jeremylong.github.io/DependencyCheck/general/internals.html
   False Positives: https://jeremylong.github.io/DependencyCheck/general/suppression.html

? Sponsor: https://github.com/sponsors/jeremylong


[INFO] Analysis Started
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Assembly Analyzer (1 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Created CPE Index (1 seconds)
[INFO] Finished CPE Analyzer (1 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished Sonatype OSS Index Analyzer (1 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Analysis Complete (4 seconds)
[INFO] Writing report to: C:\Temnp\dependency-check-report.html

C:\TEMP\dependency-check\bin>


掃描 Java 專案,可能也另外要安裝 Java SDK 。(敝人沒測)

另外,明明是 .NET Framework 4.8 的方案,結果仍需要 .NET Core 3.1 SDK 才能分析,也不需要 .NET Framework 4.8 SDK ( Dev Pack ),結果有點令人懷疑 (有空再研究)。

(完)

相關

[研究] OWASP Dependency-Check 9.0.6 元件依賴關係檢查工具
https://shaurong.blogspot.com/2023/12/owasp-dependency-check-906.html

[研究] OWASP Dependency Check 6.2.2 元件依賴關係檢查工具https://shaurong.blogspot.com/2021/08/owasp-dependency-check-622.html

[研究] OWASP Dependency Check 4.0.0 元件依賴關係檢查http://shaurong.blogspot.com/2018/12/owasp-dependency-check-400.html