Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

- updating docs to include - documentation of api fixing parsing of severity level

Ricardo0cb63d086f83
diff --git a/docs/widgets.md b/docs/widgets.md
index fb61a684..2bf68612 100644
--- a/docs/widgets.md
+++ b/docs/widgets.md
@@ -631,6 +631,7 @@ This widget display email addresses / aliases from addy.io. Click an email addre
Keep track of recent security advisories and vulnerabilities, with optional filtering by score, exploits, vendor and product. All fields are optional.
Sources from: https://services.nvd.nist.gov/rest/json/cves/2.0
+Docs: https://nvd.nist.gov/developers/vulnerabilities
<p align="center"><img width="400" src="https://storage.googleapis.com/as93-screenshots/dashy/cve.png" /></p>
diff --git a/src/components/Widgets/CveVulnerabilities.vue b/src/components/Widgets/CveVulnerabilities.vue
index 8540fd7f..ff4294f0 100644
--- a/src/components/Widgets/CveVulnerabilities.vue
+++ b/src/components/Widgets/CveVulnerabilities.vue
@@ -126,12 +126,35 @@ export default {
this.cveList = cveList;
},
parseScore(metrics = {}) {
- if (!metrics || !metrics.cvssMetricV2) {
+ if (!metrics) {
return 'Unset';
}
- for (let i = 0; i < metrics.cvssMetricV2.length; i += 1) {
- if (metrics.cvssMetricV2[i].baseSeverity !== undefined && metrics.cvssMetricV2[i].baseSeverity !== '') {
- return metrics.cvssMetricV2[i].baseSeverity;
+ if (metrics.cvssMetricV40 !== undefined) {
+ for (let i = 0; i < metrics.cvssMetricV40.length; i += 1) {
+ if (metrics.cvssMetricV40[i].baseSeverity !== undefined && metrics.cvssMetricV40[i].baseSeverity !== '') {
+ return metrics.cvssMetricV40[i].baseSeverity;
+ }
+ }
+ }
+ if (metrics.cvssMetricV31 !== undefined) {
+ for (let i = 0; i < metrics.cvssMetricV31.length; i += 1) {
+ if (metrics.cvssMetricV31[i].baseSeverity !== undefined && metrics.cvssMetricV31[i].baseSeverity !== '') {
+ return metrics.cvssMetricV31[i].baseSeverity;
+ }
+ }
+ }
+ if (metrics.cvssMetricV30 !== undefined) {
+ for (let i = 0; i < metrics.cvssMetricV30.length; i += 1) {
+ if (metrics.cvssMetricV30[i].baseSeverity !== undefined && metrics.cvssMetricV30[i].baseSeverity !== '') {
+ return metrics.cvssMetricV30[i].baseSeverity;
+ }
+ }
+ }
+ if (metrics.cvssMetricV2 !== undefined) {
+ for (let i = 0; i < metrics.cvssMetricV2.length; i += 1) {
+ if (metrics.cvssMetricV2[i].baseSeverity !== undefined && metrics.cvssMetricV2[i].baseSeverity !== '') {
+ return metrics.cvssMetricV2[i].baseSeverity;
+ }
}
}
return 'Unset';