Cannot edit or enter another vendor under the same CVE #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After creating a CVE and uploading a document under 1 vendor. Trying to reenter the same CVE with another vendor fails
Fixing this requires edits to the following:
Database Schema
Backend API
FrontEnd display
Edit cve_database.db
Adding Multi-Vendor Support
Partial fix to DB, however, documents are not split between vendors
Issue Resolution: Cannot edit or enter another vendor under the same CVE
Root Cause
The database schema had a
UNIQUEconstraint oncve_idalone, preventing multiple vendors from being added to the same CVE-ID.Fix Applied
1. Database Schema Migration
Changed constraint from
UNIQUE(cve_id)toUNIQUE(cve_id, vendor):What this does: Allows the same CVE-ID with different vendors while preventing duplicate CVE-ID + Vendor combinations.
2. Documents Table Schema
Added
vendorcolumn to associate documents with specific vendors:What this does: Each document is now tied to a specific vendor, allowing proper organization under
CVE-ID/Vendor/documents.3. Backend API - CVE Creation
Fixed INSERT statement to include all required fields:
What this does: Properly inserts vendor field and provides clear error message for duplicate CVE-ID + Vendor combinations.
4. Backend API - Document Upload
Fixed INSERT statement to include vendor field:
What this does: Associates uploaded documents with the correct vendor, enabling proper file organization and filtering.
5. Document Retrieval - Vendor Filtering
Updated document fetch endpoint to filter by vendor:
What this does: Returns only documents for the selected vendor when viewing a specific vendor's documents.
Migration Script
File:
fix_multivendor_constraint.jsKey operations:
cvestable tocves_oldcvestable withUNIQUE(cve_id, vendor)constraintTesting
uploads/CVE-ID/Vendor/filesResult
✅ System now fully supports multiple vendors per CVE-ID, each with their own document storage and compliance tracking.
Files Modified
backend/server.js- CVE and document endpointsbackend/cve_database.db- Database schemabackend/fix_multivendor_constraint.js- Migration script (new)backend/add_vendor_to_documents.js- Documents table migration (new)