@@ -12,24 +12,6 @@ const ajv = new Ajv()
1212const inputSchema = /** @type {const } */ ( {
1313 additionalProperties : true ,
1414 properties : {
15- document : {
16- additionalProperties : true ,
17- properties : {
18- tracking : {
19- additionalProperties : true ,
20- properties : {
21- revision_history : {
22- elements : {
23- additionalProperties : true ,
24- optionalProperties : {
25- date : { type : 'string' } ,
26- } ,
27- } ,
28- } ,
29- } ,
30- } ,
31- } ,
32- } ,
3315 vulnerabilities : {
3416 elements : {
3517 additionalProperties : true ,
@@ -72,10 +54,10 @@ export function mandatoryTest_6_1_53(doc) {
7254 }
7355
7456 doc . vulnerabilities ?. forEach ( ( vulnerability , vulnerabilityIndex ) => {
75- const exploitDate = vulnerability . first_known_exploitation_dates || [ ]
76- exploitDate . forEach ( ( exploit , exploitIdx ) => {
77- const date = exploit . date
78- const exploitationDate = exploit . exploitation_date
57+ const exploitationDates = vulnerability . first_known_exploitation_dates || [ ]
58+ exploitationDates . forEach ( ( item , Index ) => {
59+ const date = item . date
60+ const exploitationDate = item . exploitation_date
7961
8062 if (
8163 compareZonedDateTimes (
@@ -85,8 +67,9 @@ export function mandatoryTest_6_1_53(doc) {
8567 ) {
8668 ctx . isValid = false
8769 ctx . errors . push ( {
88- instancePath : `/vulnerabilities/${ vulnerabilityIndex } /first_known_exploitation_dates/${ exploitIdx } ` ,
89- message : 'the "exploitation_date" is newer than the "date"' ,
70+ instancePath : `/vulnerabilities/${ vulnerabilityIndex } /first_known_exploitation_dates/${ Index } ` ,
71+ message :
72+ 'the "exploitation_date" is newer than the "date" which states when that information was last updated' ,
9073 } )
9174 }
9275 } )
0 commit comments