Skip to content

Commit 075148c

Browse files
Merge branch 'main' into thunderbird
2 parents 9fc22be + 639fd49 commit 075148c

File tree

7 files changed

+29
-159
lines changed

7 files changed

+29
-159
lines changed

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ jobs:
261261
- name: Get date
262262
id: get-date
263263
run: |
264-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
264+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
265265
- name: Get cached database
266266
uses: actions/cache@v3
267267
with:
268268
path: ~/.cache/cve-bin-tool
269-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
269+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
270270
- name: Install cve-bin-tool
271271
run: |
272272
python -m pip install --upgrade pip
@@ -337,12 +337,12 @@ jobs:
337337
- name: Get date
338338
id: get-date
339339
run: |
340-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
340+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
341341
- name: Get cached database
342342
uses: actions/cache@v3
343343
with:
344344
path: ~/.cache/cve-bin-tool
345-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
345+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
346346
- name: Install cve-bin-tool
347347
run: |
348348
python -m pip install --upgrade pip

.github/workflows/update-cache.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
if: github.repository == 'intel/cve-bin-tool'
4646
name: Update windows cached database
4747
runs-on: windows-latest
48-
timeout-minutes: 20
48+
timeout-minutes: 60
4949
env:
5050
PYTHONIOENCODING: 'utf8'
5151
steps:
@@ -57,11 +57,11 @@ jobs:
5757
- name: Get date
5858
id: get-date
5959
run: |
60-
echo "date=$(get-date -format "yyyyMMdd")" >> $GITHUB_OUTPUT
60+
echo "DATE=$(powershell get-date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
6161
- uses: actions/cache@v3
6262
with:
6363
path: ~/.cache/cve-bin-tool
64-
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.date }}
64+
key: ${{ runner.os }}-cve-bin-tool-${{ steps.get-date.outputs.DATE }}
6565
- name: Install cve-bin-tool
6666
run: |
6767
python -m pip install --upgrade pip

cve_bin_tool/cve_scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def get_cves(self, product_info: ProductInfo, triage_data: TriageData):
211211
query = f"""
212212
SELECT CVE_number, severity, description, score, cvss_version, cvss_vector, data_source
213213
FROM cve_severity
214-
WHERE CVE_number IN ({",".join(["?"] * number_of_cves)}) AND score >= ?
215-
ORDER BY CVE_number
214+
WHERE CVE_number IN ({",".join(["?"] * number_of_cves)}) AND score >= ? and description != "unknown"
215+
ORDER BY CVE_number, last_modified DESC
216216
"""
217217
# Add score parameter to tuple listing CVEs to pass to query
218218
result = self.cursor.execute(query, cve_list[start:end] + [self.score])

cve_bin_tool/cvedb.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,17 @@ def get_cvelist_if_stale(self) -> None:
157157
self.time_of_last_update = datetime.datetime.today()
158158

159159
def latest_schema(
160-
self, table_name: str, table_schema: str, cursor: sqlite3.Cursor | None = None
160+
self,
161+
table_name: str = "",
162+
table_schema: str = "",
163+
cursor: sqlite3.Cursor | None = None,
161164
) -> bool:
162165
"""Check database is using latest schema"""
166+
if table_name == "":
167+
# If no table specified, check cve_range (the last one changed)
168+
_, range_schema = self.table_schemas()
169+
return self.latest_schema("cve_range", range_schema)
170+
163171
self.LOGGER.debug("Check database is using latest schema")
164172
cursor = self.db_open_and_get_cursor()
165173
schema_check = f"SELECT * FROM {table_name} WHERE 1=0"
@@ -265,13 +273,19 @@ def init_database(self) -> None:
265273
# Check schema on cve_severity
266274
if not self.latest_schema("cve_severity", severity_schema, cursor):
267275
# Recreate table using latest schema
268-
self.LOGGER.info("Upgrading database cve_severity to latest schema")
276+
self.LOGGER.info("Upgrading cve_severity data. This may take some time.")
277+
self.LOGGER.info(
278+
"If this step hangs, try using `-u now` to get a fresh db."
279+
)
269280
cursor.execute("DROP TABLE cve_severity")
270281
cursor.execute(cve_data_create)
271282

272283
# Check schema on cve_range
273284
if not self.latest_schema("cve_range", range_schema, cursor):
274-
self.LOGGER.info("Upgrading database cve_range to latest schema")
285+
self.LOGGER.info("Upgrading cve_range data. This may take some time.")
286+
self.LOGGER.info(
287+
"If this step hangs, try using `-u now` to get a fresh db."
288+
)
275289
cursor.execute("DROP TABLE cve_range")
276290
cursor.execute(version_range_create)
277291

cve_bin_tool/parsers/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def find_vendor(self, product, version):
4949
if vendor_package_pair != []:
5050
vendor = vendor_package_pair[0]["vendor"]
5151
file_path = self.filename
52-
self.logger.info(f"{file_path} is {product} {version}")
52+
self.logger.debug(f"{file_path} is {product} {version}")
5353
return ScanInfo(ProductInfo(vendor, product, version), file_path)
5454
return None
5555

cve_bin_tool/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from cve_bin_tool.log import LOGGER
1010

11-
VERSION: str = "3.2rc0"
11+
VERSION: str = "3.2"
1212

1313

1414
def check_latest_version():

triage.json

Lines changed: 1 addition & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -76,150 +76,6 @@
7676
"ref": "urn:cbt:1/plotly#plotly.js-2.13.2"
7777
}
7878
]
79-
},
80-
{
81-
"id": "CVE-2016-10735",
82-
"source": {
83-
"name": "GAD"
84-
},
85-
"analysis": {
86-
"state": "not_affected",
87-
"response": [ "code_not_reachable" ],
88-
"justification": "Bad version detection with GAD",
89-
"detail": ""
90-
},
91-
"affects": [
92-
{
93-
"ref": "urn:cdx:NOTKNOWN/1#bootstrap-5.2.0"
94-
}
95-
],
96-
"vendor": "getbootstrap",
97-
"product": "bootstrap",
98-
"version": "5.2.0",
99-
"cve_number": "CVE-2016-10735",
100-
"severity": "MEDIUM",
101-
"score": "6.1",
102-
"source": "GAD",
103-
"cvss_version": "3",
104-
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
105-
"paths": "",
106-
"remarks": "Mitigated",
107-
"comments": ""
108-
},
109-
{
110-
"id": "CVE-2018-14040",
111-
"source": {
112-
"name": "GAD"
113-
},
114-
"analysis": {
115-
"state": "not_affected",
116-
"response": [ "code_not_reachable" ],
117-
"justification": "Bad version detection with GAD",
118-
"detail": ""
119-
},
120-
"affects": [
121-
{
122-
"ref": "urn:cdx:NOTKNOWN/1#bootstrap-5.2.0"
123-
}
124-
],
125-
"vendor": "getbootstrap",
126-
"product": "bootstrap",
127-
"version": "5.2.0",
128-
"cve_number": "CVE-2018-14040",
129-
"severity": "MEDIUM",
130-
"score": "6.1",
131-
"source": "GAD",
132-
"cvss_version": "3",
133-
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
134-
"paths": "",
135-
"remarks": "Mitigated",
136-
"comments": ""
137-
},
138-
{
139-
"id": "CVE-2018-14041",
140-
"source": {
141-
"name": "GAD"
142-
},
143-
"analysis": {
144-
"state": "not_affected",
145-
"response": [ "code_not_reachable" ],
146-
"justification": "Bad version detection with GAD",
147-
"detail": ""
148-
},
149-
"affects": [
150-
{
151-
"ref": "urn:cdx:NOTKNOWN/1#bootstrap-5.2.0"
152-
}
153-
],
154-
"vendor": "getbootstrap",
155-
"product": "bootstrap",
156-
"version": "5.2.0",
157-
"cve_number": "CVE-2018-14041",
158-
"severity": "MEDIUM",
159-
"score": "6.1",
160-
"source": "GAD",
161-
"cvss_version": "3",
162-
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
163-
"paths": "",
164-
"remarks": "Mitigated",
165-
"comments": ""
166-
},
167-
{
168-
"id": "CVE-2018-14042",
169-
"source": {
170-
"name": "GAD"
171-
},
172-
"analysis": {
173-
"state": "not_affected",
174-
"response": [ "code_not_reachable" ],
175-
"justification": "Bad version detection with GAD",
176-
"detail": ""
177-
},
178-
"affects": [
179-
{
180-
"ref": "urn:cdx:NOTKNOWN/1#bootstrap-5.2.0"
181-
}
182-
],
183-
"vendor": "getbootstrap",
184-
"product": "bootstrap",
185-
"version": "5.2.0",
186-
"cve_number": "CVE-2018-14042",
187-
"severity": "MEDIUM",
188-
"score": "6.1",
189-
"source": "GAD",
190-
"cvss_version": "3",
191-
"cvss_vector": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
192-
"paths": "",
193-
"remarks": "Mitigated",
194-
"comments": ""
195-
},
196-
{
197-
"id": "CVE-2019-8331",
198-
"source": {
199-
"name": "GAD"
200-
},
201-
"analysis": {
202-
"state": "not_affected",
203-
"response": [ "code_not_reachable" ],
204-
"justification": "Bad version detection with GAD",
205-
"detail": ""
206-
},
207-
"affects": [
208-
{
209-
"ref": "urn:cdx:NOTKNOWN/1#bootstrap-5.2.0"
210-
}
211-
],
212-
"vendor": "getbootstrap",
213-
"product": "bootstrap",
214-
"version": "5.2.0",
215-
"cve_number": "CVE-2019-8331",
216-
"severity": "MEDIUM",
217-
"score": "6.1",
218-
"source": "GAD",
219-
"cvss_version": "3",
220-
"cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
221-
"paths": "",
222-
"comments": ""
223-
}
79+
}
22480
]
22581
}

0 commit comments

Comments
 (0)