@@ -13,6 +13,185 @@ import (
1313 cvedict "github.com/vulsio/go-cve-dictionary/models"
1414)
1515
16+ func TestConvertEuvdToModel (t * testing.T ) {
17+ type args struct {
18+ cveID string
19+ euvds []cvedict.Euvd
20+ }
21+ tests := []struct {
22+ name string
23+ args args
24+ want []models.CveContent
25+ }{
26+ {
27+ name : "CVE-2025-49575" ,
28+ args : args {
29+ cveID : "CVE-2025-49575" ,
30+ euvds : []cvedict.Euvd {
31+ {
32+ EuvdID : "EUVD-2025-18144" ,
33+ EnisaUUID : "e15c6dcd-bca6-37ab-b0e0-e1cd92a91c98" ,
34+ Description : "Citizen skin vulnerable to stored XSS through multiple system messages" ,
35+ DatePublished : time .Date (2025 , time .June , 11 , 19 , 59 , 54 , 0 , time .UTC ),
36+ DateUpdated : time .Date (2025 , time .June , 13 , 03 , 43 , 58 , 0 , time .UTC ),
37+ References : []cvedict.EuvdReference {
38+ {
39+ Reference : cvedict.Reference {
40+ Link : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" ,
41+ Name : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" ,
42+ },
43+ },
44+ {
45+ Reference : cvedict.Reference {
46+ Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" ,
47+ Name : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" ,
48+ },
49+ },
50+ },
51+ Aliases : []cvedict.EuvdAlias {
52+ {
53+ Alias : "GHSA-4c2h-67qq-vm87" ,
54+ },
55+ {
56+ Alias : "CVE-2025-49575" ,
57+ },
58+ },
59+ },
60+ {
61+ EuvdID : "EUVD-2025-18208" ,
62+ EnisaUUID : "c8b99a1b-5107-3825-a99f-30d856d6c47e" ,
63+ Description : "Citizen skin vulnerable to stored XSS through multiple system messages" ,
64+ DatePublished : time .Date (2025 , time .June , 11 , 19 , 59 , 54 , 0 , time .UTC ),
65+ DateUpdated : time .Date (2025 , time .June , 13 , 03 , 43 , 58 , 0 , time .UTC ),
66+ BaseScore : 6.5 ,
67+ BaseScoreVersion : "3.1" ,
68+ BaseScoreVector : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N" ,
69+ References : []cvedict.EuvdReference {
70+ {
71+ Reference : cvedict.Reference {
72+ Link : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" ,
73+ Name : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" ,
74+ },
75+ },
76+ {
77+ Reference : cvedict.Reference {
78+ Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" ,
79+ Name : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" ,
80+ },
81+ },
82+ },
83+ Aliases : []cvedict.EuvdAlias {
84+ {
85+ Alias : "CVE-2025-49575" ,
86+ },
87+ },
88+ Assigner : "GitHub_M" ,
89+ EPSS : 0.02 ,
90+ },
91+ },
92+ },
93+ want : []models.CveContent {
94+ {
95+ Type : models .Euvd ,
96+ CveID : "CVE-2025-49575" ,
97+ Title : "EUVD-2025-18144" ,
98+ Summary : "Citizen skin vulnerable to stored XSS through multiple system messages" ,
99+ SourceLink : "https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-18144" ,
100+ References : []models.Reference {
101+ {Link : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" },
102+ {Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" },
103+ },
104+ Published : time .Date (2025 , time .June , 11 , 19 , 59 , 54 , 0 , time .UTC ),
105+ LastModified : time .Date (2025 , time .June , 13 , 03 , 43 , 58 , 0 , time .UTC ),
106+ },
107+ {
108+ Type : models .Euvd ,
109+ CveID : "CVE-2025-49575" ,
110+ Title : "EUVD-2025-18208" ,
111+ Summary : "Citizen skin vulnerable to stored XSS through multiple system messages" ,
112+ Cvss3Score : 6.5 ,
113+ Cvss3Vector : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N" ,
114+ Cvss3Severity : "MEDIUM" ,
115+ SourceLink : "https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-18208" ,
116+ References : []models.Reference {
117+ {Link : "https://github.com/StarCitizenTools/mediawiki-skins-Citizen/security/advisories/GHSA-4c2h-67qq-vm87" },
118+ {Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-49575" },
119+ },
120+ Published : time .Date (2025 , time .June , 11 , 19 , 59 , 54 , 0 , time .UTC ),
121+ LastModified : time .Date (2025 , time .June , 13 , 03 , 43 , 58 , 0 , time .UTC ),
122+ },
123+ },
124+ },
125+ {
126+ name : "CVE-2025-34028" ,
127+ args : args {
128+ cveID : "CVE-2025-34028" ,
129+ euvds : []cvedict.Euvd {
130+ {
131+ EuvdID : "EUVD-2025-12275" ,
132+ EnisaUUID : "631cd45a-4015-314b-b4b4-099d07280668" ,
133+ Description : "The Commvault Command Center Innovation Release allows an unauthenticated actor to upload ZIP files that represent install packages that, when expanded by the target server, are vulnerable to path traversal vulnerability that can result in Remote Code Execution via malicious JSP.\n \n \n \n \n \n This issue affects Command Center Innovation Release: 11.38.0 to 11.38.20. The vulnerability is fixed in 11.38.20 with SP38-CU20-433 and SP38-CU20-436 and also fixed in 11.38.25 with SP38-CU25-434 and SP38-CU25-438." ,
134+ DatePublished : time .Date (2025 , time .April , 22 , 16 , 32 , 23 , 0 , time .UTC ),
135+ DateUpdated : time .Date (2025 , time .November , 29 , 02 , 06 , 36 , 0 , time .UTC ),
136+ BaseScore : 9.3 ,
137+ BaseScoreVersion : "4.0" ,
138+ BaseScoreVector : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:H/SC:L/SI:H/SA:H" ,
139+ References : []cvedict.EuvdReference {
140+ {
141+ Reference : cvedict.Reference {
142+ Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-34028" ,
143+ Name : "https://nvd.nist.gov/vuln/detail/CVE-2025-34028" ,
144+ },
145+ },
146+ {
147+ Reference : cvedict.Reference {
148+ Link : "https://documentation.commvault.com/securityadvisories/CV_2025_04_1.html" ,
149+ Name : "https://documentation.commvault.com/securityadvisories/CV_2025_04_1.html" ,
150+ },
151+ },
152+ },
153+ Aliases : []cvedict.EuvdAlias {
154+ {
155+ Alias : "CVE-2025-34028" ,
156+ },
157+ {
158+ Alias : "GHSA-6q9c-pjw5-5rjm" ,
159+ },
160+ },
161+ Assigner : "VulnCheck" ,
162+ EPSS : 45.93 ,
163+ ExploitedSince : func () * time.Time { t := time .Date (2025 , time .May , 02 , 12 , 00 , 00 , 0 , time .UTC ); return & t }(),
164+ },
165+ },
166+ },
167+ want : []models.CveContent {
168+ {
169+ Type : models .Euvd ,
170+ CveID : "CVE-2025-34028" ,
171+ Title : "EUVD-2025-12275" ,
172+ Summary : "The Commvault Command Center Innovation Release allows an unauthenticated actor to upload ZIP files that represent install packages that, when expanded by the target server, are vulnerable to path traversal vulnerability that can result in Remote Code Execution via malicious JSP.\n \n \n \n \n \n This issue affects Command Center Innovation Release: 11.38.0 to 11.38.20. The vulnerability is fixed in 11.38.20 with SP38-CU20-433 and SP38-CU20-436 and also fixed in 11.38.25 with SP38-CU25-434 and SP38-CU25-438." ,
173+ Cvss40Score : 9.3 ,
174+ Cvss40Vector : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:H/SC:L/SI:H/SA:H" ,
175+ Cvss40Severity : "CRITICAL" ,
176+ SourceLink : "https://euvd.enisa.europa.eu/vulnerability/EUVD-2025-12275" ,
177+ References : []models.Reference {
178+ {Link : "https://nvd.nist.gov/vuln/detail/CVE-2025-34028" },
179+ {Link : "https://documentation.commvault.com/securityadvisories/CV_2025_04_1.html" },
180+ },
181+ Published : time .Date (2025 , time .April , 22 , 16 , 32 , 23 , 0 , time .UTC ),
182+ LastModified : time .Date (2025 , time .November , 29 , 02 , 06 , 36 , 0 , time .UTC ),
183+ },
184+ },
185+ },
186+ }
187+ for _ , tt := range tests {
188+ t .Run (tt .name , func (t * testing.T ) {
189+ if got := models .ConvertEuvdToModel (tt .args .cveID , tt .args .euvds ); ! reflect .DeepEqual (got , tt .want ) {
190+ t .Errorf ("ConvertEuvdToModel() = %v, want %v" , got , tt .want )
191+ }
192+ })
193+ }
194+ }
16195func TestConvertVulncheckToModel (t * testing.T ) {
17196 type args struct {
18197 cveID string
0 commit comments