From 3d2208a9dadd84a9bb4f19606b6ea9bb02d39d8c Mon Sep 17 00:00:00 2001 From: Roy Lane Date: Thu, 19 Mar 2026 09:47:35 -0400 Subject: [PATCH 1/4] cveListSearch: temporarily point to development search site --- src/stores/cveListSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/cveListSearch.js b/src/stores/cveListSearch.js index bb0c9d403..6c707a36e 100644 --- a/src/stores/cveListSearch.js +++ b/src/stores/cveListSearch.js @@ -219,7 +219,7 @@ export const useCveListSearchStore = defineStore('cveListSearch ', { }, async getSearchResults() { this.isQueryingSearchService = true; - const searchUrl = `${import.meta.env.VITE_API_BASE_URL}${import.meta.env.VITE_LIST_SEARCH_PATH}`; + const searchUrl = 'https://dev.search.cve.org/webSearch'; this.resetResults(); From 253c7f6d4d667e8b9c405080869457a77170c2fd Mon Sep 17 00:00:00 2001 From: Robert Roberge Date: Wed, 20 May 2026 18:11:13 -0400 Subject: [PATCH 2/4] Update SECURITY.md Update CVE website Security Policy --- SECURITY.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index f16eaf924..3baef96a7 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,22 +1,16 @@ # Security Policy ## Reporting a Vulnerability -Please use the CVE Program web forms to report security vulnerabilities for the -CVE website. Please include vulnerability details, steps to reproduce (e.g., proof-of-concept code, -screenshots) and an assessment of the impact in your report. We appreciate concise and high-quality reports. - -## Web Form Submissions - -* In the “Select a request type” drop down menu, please select “Other” -* Enter your email address in the space provided -* You may enter a PGP key if you prefer to encrypt your correspondence -* In the “Type of comment” drop down menu, please select “Issue” -* In the textbox labeled “Please provide your question, issue, comment, etc.” please start the message with the following information: - - First Line: “CVE Website Security Anomaly Report” - - Second Line: “Distribution: CVE Website Development Team” - - Third Line: "Description: [Free Text description of the anomaly]” -* Enter the Security code -* Click “Submit Request” +Please use the CVE Program Web Forms (choose “General Support”) to report security vulnerabilities for the +CVE website. + +Please include: + +* Vulnerability details +* Steps to reproduce (e.g., proof-of-concept code, screenshots) +* An assessment of the impact + +We appreciate concise and high-quality reports. ## Scope @@ -28,4 +22,4 @@ We will release fixes for verified security vulnerabilities. We expect to publis security advisories. ## Coordination -We appreciate the opportunity to investigate and develop fixes before public disclosure, following coordinated vulnerability disclosure practices. \ No newline at end of file +We appreciate the opportunity to investigate and develop fixes before public disclosure, following coordinated vulnerability disclosure practices. From f98abbe202e105ff90ee2e6c67d0f598cd37cb10 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sun, 8 Nov 2026 14:38:39 +0100 Subject: [PATCH 3/4] Generate a CycloneDX SBOM of the website bundle Add `rollup-plugin-sbom` to the Vite build, so every build emits a CycloneDX SBOM of the packages actually shipped to the browser (`/cyclonedx/bom.json` and `/.well-known/sbom`). Build-time dependencies are intentionally left out: they are already covered by the GitHub Dependency Graph via `package-lock.json`. Packages pulled in through Sass (Bulma) are invisible to the bundler, so they are added explicitly in the `afterCollect` hook. The same hook adds the third-party scripts loaded at runtime from their vendors' servers (Osano, Google tag, Google Programmable Search), as unversioned components identified by their exact download URL. The Google scripts are generated per tag/search engine ID, so their URLs are built from the same `VITE_*` variables the website uses, and they are omitted when the ID is not configured (the script is then not loaded). The Google tag is recorded as a dependency of `vue-gtag`, which injects it. Link the SBOM from the "Policies & Cookies" section of the footer. Assisted-By: Claude Opus 5.5 --- package-lock.json | 261 +++++++++++++++++++++++++++++--- package.json | 2 + src/components/FooterModule.vue | 1 + vite.config.ts | 118 ++++++++++++++- 4 files changed, 354 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 662f487e0..80af1a9b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "vue-router": "^5.0.3" }, "devDependencies": { + "@cyclonedx/cyclonedx-library": "^10.3.0", "@eslint/js": "^10.0.1", "@rushstack/eslint-patch": "^1.15.0", "@tsconfig/node18": "^18.2.6", @@ -45,6 +46,7 @@ "npm-run-all2": "^6.2.6", "postcss-scss": "^4.0.9", "prettier": "^3.6.2", + "rollup-plugin-sbom": "^4.0.1", "sass-embedded": "^1.93.3", "typescript": "^6.0.2", "typescript-eslint": "^8.67.0", @@ -481,6 +483,54 @@ "integrity": "sha512-H5qg4D/2PQLqdGvnyqF9GbVQxs/y/EEeEczlEi0zD2ZFnYFUHV3L3akm3OSxgjAURbZwU7xIjXO1n1SVElhJLA==", "license": "MIT" }, + "node_modules/@cyclonedx/cyclonedx-library": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@cyclonedx/cyclonedx-library/-/cyclonedx-library-10.3.0.tgz", + "integrity": "sha512-RIT28sp1U0PCHaaeF3yNRwk6Jig/XJ8UsYAVOMYaHQ+0VVOvsjcp0PTWQFLUqJFF8XMud+Kdq6G+wtDAh+QJFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://owasp.org/donate/?reponame=www-project-cyclonedx&title=OWASP+CycloneDX" + } + ], + "license": "Apache-2.0", + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "ajv-formats-draft2019": "^1.6.1", + "libxmljs2": "^0.35||^0.37", + "packageurl-js": "*", + "spdx-expression-parse": "*", + "xmlbuilder2": "^3.0.2||^4.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + }, + "ajv-formats": { + "optional": true + }, + "ajv-formats-draft2019": { + "optional": true + }, + "libxmljs2": { + "optional": true + }, + "packageurl-js": { + "optional": true + }, + "spdx-expression-parse": { + "optional": true + }, + "xmlbuilder2": { + "optional": true + } + } + }, "node_modules/@dual-bundle/import-meta-resolve": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.2.1.tgz", @@ -2628,23 +2678,6 @@ "node": ">= 6.0.0" } }, - "node_modules/ajv": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", - "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/alien-signals": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-3.2.1.tgz", @@ -3466,6 +3499,23 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", @@ -3479,6 +3529,13 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, "node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", @@ -3901,6 +3958,29 @@ "dev": true, "license": "MIT" }, + "node_modules/hosted-git-info": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-10.1.1.tgz", + "integrity": "sha512-DeOnSPAvOndYKfw075gt8yZzQ7S2hNztw34zBTfhIzLhmBTswIBg5/y+pqu/VD5cYWm5goAFTusDmUEmKZ0PEQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^11.1.0" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -4011,13 +4091,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -4571,6 +4644,34 @@ "node": ">=18" } }, + "node_modules/normalize-package-data": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-9.0.0.tgz", + "integrity": "sha512-la34cHOCAT6itNOYCvPi40XP8r0y6OHuNkooOfnfFUHdgy5MBw665qq5xsuS02AEC7WPQvhwvb7E9PI1gipplw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^10.1.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/nostics": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/nostics/-/nostics-1.3.0.tgz", @@ -4726,6 +4827,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/packageurl-js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/packageurl-js/-/packageurl-js-2.0.1.tgz", + "integrity": "sha512-N5ixXjzTy4QDQH0Q9YFjqIWd6zH6936Djpl2m9QNFmDv5Fum8q8BjkpAcHNMzOFE0IwQrFhJWex3AN6kS0OSwg==", + "dev": true, + "license": "MIT" + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -5118,6 +5226,42 @@ "@rolldown/binding-win32-x64-msvc": "1.2.16" } }, + "node_modules/rollup-plugin-sbom": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-sbom/-/rollup-plugin-sbom-4.0.1.tgz", + "integrity": "sha512-gRzuUXt/9MFhQ8+Pf6W/yNmBvUYM7CxgXpO3x4xJOQ3l6c/7O7D/oFPIRsDvqHvxg5DDjlSYkqwshDbv7eMiCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cyclonedx/cyclonedx-library": "10.3.0", + "normalize-package-data": "9.0.0", + "packageurl-js": "2.0.1", + "spdx-expression-parse": "5.0.0" + }, + "engines": { + "node": ">=22.9.0" + }, + "peerDependencies": { + "rolldown": "^1", + "rollup": "^4", + "vite": "^6 || ^7 || ^8", + "xmlbuilder2": "^3 || ^4" + }, + "peerDependenciesMeta": { + "rolldown": { + "optional": true + }, + "rollup": { + "optional": true + }, + "vite": { + "optional": true + }, + "xmlbuilder2": { + "optional": true + } + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5572,6 +5716,53 @@ "node": ">=0.10.0" } }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-correct/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-5.0.0.tgz", + "integrity": "sha512-vngmw3Rgn+o2arXNbnZaj5UtOEBuWBfvaI+Wc8GFfykIhA5/vdK9/Sp/XkLv63dykz2rxKDvKEHupF5P0FORcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.24.tgz", + "integrity": "sha512-cLS9TtWkIQFyLkJ3/5aFQAOHOSKTlOs/7WDut/XPSdjom1fJhUdkepeJAKXa9Y05+FabHd0sti+Et559vDtkpQ==", + "dev": true, + "license": "CC0-1.0" + }, "node_modules/speakingurl": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/speakingurl/-/speakingurl-14.0.1.tgz", @@ -5950,6 +6141,28 @@ "dev": true, "license": "MIT" }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/varint": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", diff --git a/package.json b/package.json index d2802173e..3be7cf83a 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "vue-router": "^5.0.3" }, "devDependencies": { + "@cyclonedx/cyclonedx-library": "^10.3.0", "@eslint/js": "^10.0.1", "@rushstack/eslint-patch": "^1.15.0", "@tsconfig/node18": "^18.2.6", @@ -52,6 +53,7 @@ "npm-run-all2": "^6.2.6", "postcss-scss": "^4.0.9", "prettier": "^3.6.2", + "rollup-plugin-sbom": "^4.0.1", "sass-embedded": "^1.93.3", "typescript": "^6.0.2", "typescript-eslint": "^8.67.0", diff --git a/src/components/FooterModule.vue b/src/components/FooterModule.vue index 14c815d56..25743cd5e 100644 --- a/src/components/FooterModule.vue +++ b/src/components/FooterModule.vue @@ -6,6 +6,7 @@
  • Terms of Use
  • Website Security Policy
  • +
  • Website SBOM
  • Privacy Policy
  • Cookie Notice
  • Manage Cookies
  • diff --git a/vite.config.ts b/vite.config.ts index f94c4f66e..4408e13bb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,11 +1,109 @@ import { fileURLToPath, pathToFileURL, URL } from 'node:url' -import { defineConfig } from 'vite' +import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +import sbom from 'rollup-plugin-sbom' +import { Enums, Models, SPDX } from '@cyclonedx/cyclonedx-library' +import { readFileSync } from 'node:fs' +import { createRequire } from 'node:module' + +// Packages included in the bundle through Sass `@use`/`@forward`. +// Sass resolves these itself, so the bundler, and therefore the SBOM plugin, never sees them. +const SASS_PACKAGES = ['bulma'] + +function addSassPackages(bom: Models.Bom) { + const require = createRequire(import.meta.url) + for (const name of SASS_PACKAGES) { + const pkg = JSON.parse(readFileSync(require.resolve(`${name}/package.json`), 'utf8')) + // Scoped names keep their `@` encoded and their `/` as a namespace separator. + const purl = `pkg:npm/${encodeURIComponent(pkg.name).replace('%2F', '/')}@${encodeURIComponent(pkg.version)}` + const license = SPDX.isSupportedSpdxId(pkg.license) + ? new Models.SpdxLicense(pkg.license) + : new Models.LicenseExpression(pkg.license) + license.acknowledgement = Enums.LicenseAcknowledgement.Declared + const component = new Models.Component(Enums.ComponentType.Library, pkg.name, { + version: pkg.version, + description: pkg.description, + purl, + bomRef: purl, + licenses: new Models.LicenseRepository([license]) + }) + bom.components.add(component) + bom.metadata.component?.dependencies.add(component.bomRef) + } +} + +interface RemoteScript { + name: string + description: string + // Exact URL requested by the website; the script is not loaded at all when undefined. + url: string | undefined + supplier: { name: string, url: string } + // npm package that loads the script; the website itself when undefined. + loadedBy?: string +} + +const UNVERSIONED_NOTE = 'Generated by the vendor for this website and served without a version; its content can change at any time.' + +// Third-party scripts loaded at runtime from their vendors' servers. +// They are not part of the bundle and have no fixed version, but they run with the same privileges as the website. +// Keep in sync with `index.html`, `src/main.ts` (vue-gtag) and `src/views/SiteSearch.vue`. +function remoteScripts(env: Record): RemoteScript[] { + const gaTagId = env.VITE_GOOGLE_ANALYTICS_PROPERTY_ID + const searchEngineId = env.VITE_GOOGLE_SITE_SEARCH_ENGINE_ID + return [ + { + name: 'osano.js', + description: 'Osano cookie consent manager.', + url: 'https://cmp.osano.com/AzyhULTdPkqmy4aDN/46057d56-0263-4cca-abac-9adddada4f3b/osano.js', + supplier: { name: 'Osano', url: 'https://www.osano.com/' } + }, + { + name: 'gtag.js', + description: 'Google tag (Google Analytics).', + // vue-gtag only injects the script when a tag ID is configured, using its default URL and data layer name. + url: gaTagId ? `https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(gaTagId)}&l=dataLayer` : undefined, + supplier: { name: 'Google LLC', url: 'https://www.google.com/' }, + loadedBy: 'vue-gtag' + }, + { + name: 'cse.js', + description: 'Google Programmable Search Engine, used by the site search page.', + url: searchEngineId ? `https://cse.google.com/cse.js?cx=${encodeURIComponent(searchEngineId)}` : undefined, + supplier: { name: 'Google LLC', url: 'https://www.google.com/' } + } + ] +} + +function addRemoteScripts(bom: Models.Bom, scripts: RemoteScript[]) { + for (const script of scripts) { + if (!script.url) { + continue + } + const purl = `pkg:generic/${encodeURIComponent(script.name)}?download_url=${encodeURIComponent(script.url)}` + const component = new Models.Component(Enums.ComponentType.Library, script.name, { + description: `${script.description} ${UNVERSIONED_NOTE}`, + purl, + bomRef: purl, + supplier: new Models.OrganizationalEntity({ name: script.supplier.name, url: new Set([script.supplier.url]) }), + externalReferences: new Models.ExternalReferenceRepository([ + new Models.ExternalReference(script.url, Enums.ExternalReferenceType.Distribution) + ]) + }) + bom.components.add(component) + const dependent = script.loadedBy + ? Array.from(bom.components).find((c) => c.group === undefined && c.name === script.loadedBy) + : bom.metadata.component + if (!dependent) { + throw new Error(`SBOM: ${script.name} is loaded by ${script.loadedBy}, which is not in the bundle`) + } + dependent.dependencies.add(component.bomRef) + } +} // https://vitejs.dev/config/ -export default defineConfig({ +export default defineConfig(({ mode }) => ({ plugins: [ vue(), vueJsx(), @@ -38,6 +136,18 @@ export default defineConfig({ } }, build: { - cssMinify: 'esbuild' + cssMinify: 'esbuild', + rolldownOptions: { + plugins: [ + // Generates a CycloneDX SBOM of the modules actually included in the bundle. + // Published as `/cyclonedx/bom.json` and `/.well-known/sbom`. + sbom({ + afterCollect: (bom) => { + addSassPackages(bom) + addRemoteScripts(bom, remoteScripts(loadEnv(mode, process.cwd(), 'VITE_'))) + } + }) + ] + } } -}) +})) From 2df2ec81ae27f2ee504beaa73b301b9c0b240b43 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Sun, 8 Nov 2026 15:08:33 +0100 Subject: [PATCH 4/4] Document all environment variables in `.env-EXAMPLE` Add `VITE_LIST_SEARCH_PATH` and `VITE_GOOGLE_SITE_SEARCH_ENGINE_ID`, which are used by the code (and the latter by the SBOM generation) but were missing from the example, and describe each variable. Assisted-By: Claude Opus 5.5 --- .env-EXAMPLE | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.env-EXAMPLE b/.env-EXAMPLE index 94c979dcb..603080301 100644 --- a/.env-EXAMPLE +++ b/.env-EXAMPLE @@ -1,4 +1,12 @@ +# Base URL of the website API (newsletter, partners, CVE list search), with a trailing slash VITE_API_BASE_URL={{ TODO }} +# Path of the CVE list search endpoint, relative to VITE_API_BASE_URL +VITE_LIST_SEARCH_PATH={{ TODO }} +# Base URL of CVE Services (CVE record and CVE ID lookups) VITE_CVE_SERVICES_BASE_URL={{ TODO }} +# Deployment environment; `prd` for the production website VITE_WEBSITE_ENVIRONMENT={{ TODO }} -VITE_GOOGLE_ANALYTICS_PROPERTY_ID={{ TODO }} \ No newline at end of file +# Google Analytics tag ID (G-XXXXXXXXXX); leave empty to disable Google Analytics +VITE_GOOGLE_ANALYTICS_PROPERTY_ID={{ TODO }} +# Google Programmable Search Engine ID, used by the site search page +VITE_GOOGLE_SITE_SEARCH_ENGINE_ID={{ TODO }}