/** * Known Vulnerable Packages Database * Static database of known CVEs for offline vulnerability detection * This is a sample database - in production, integrate with OSV, NVD, or Snyk APIs */ import { CVEInfo, PackageEcosystem, Severity } from '../types'; /** * CVE database entry */ export interface CVEDatabaseEntry { ecosystem: PackageEcosystem; packageName: string; cve: CVEInfo; vulnerableVersions: string[]; } /** * Sample CVE database with well-known vulnerabilities */ export const CVE_DATABASE: CVEDatabaseEntry[] = [ // Log4Shell - Critical Java vulnerability { ecosystem: 'maven', packageName: 'org.apache.logging.log4j:log4j-core', cve: { id: 'CVE-2021-44228', description: 'Apache Log4j2 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints.', cvssScore: 10.0, severity: Severity.CRITICAL, publishedDate: '2021-12-10', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2021-44228', 'https://logging.apache.org/log4j/2.x/security.html' ], fixedVersion: '2.17.0', cwes: ['CWE-502', 'CWE-400', 'CWE-20'], exploitAvailable: true }, vulnerableVersions: ['2.0-beta9', '2.0-rc1', '2.0-rc2', '2.0', '2.0.1', '2.0.2', '2.1', '2.2', '2.3', '2.4', '2.4.1', '2.5', '2.6', '2.6.1', '2.6.2', '2.7', '2.8', '2.8.1', '2.8.2', '2.9.0', '2.9.1', '2.10.0', '2.11.0', '2.11.1', '2.11.2', '2.12.0', '2.12.1', '2.13.0', '2.13.1', '2.13.2', '2.13.3', '2.14.0', '2.14.1', '2.15.0', '2.16.0'] }, // Lodash prototype pollution { ecosystem: 'npm', packageName: 'lodash', cve: { id: 'CVE-2020-8203', description: 'Prototype pollution vulnerability in lodash before 4.17.20 allows attackers to cause denial of service or execute arbitrary code via merge, mergeWith, and defaultsDeep functions.', cvssScore: 7.4, severity: Severity.HIGH, publishedDate: '2020-07-15', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2020-8203', 'https://github.com/lodash/lodash/issues/4744' ], fixedVersion: '4.17.20', cwes: ['CWE-1321'], exploitAvailable: true }, vulnerableVersions: ['<4.17.20'] }, { ecosystem: 'npm', packageName: 'lodash', cve: { id: 'CVE-2021-23337', description: 'Lodash versions prior to 4.17.21 are vulnerable to Command Injection via the template function.', cvssScore: 7.2, severity: Severity.HIGH, publishedDate: '2021-02-15', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2021-23337', 'https://snyk.io/vuln/SNYK-JS-LODASH-1040724' ], fixedVersion: '4.17.21', cwes: ['CWE-94'], exploitAvailable: true }, vulnerableVersions: ['<4.17.21'] }, // Express.js vulnerabilities { ecosystem: 'npm', packageName: 'express', cve: { id: 'CVE-2022-24999', description: 'qs before 6.10.3 allows attackers to cause a Node process hang because an __ proto__ key can be used.', cvssScore: 7.5, severity: Severity.HIGH, publishedDate: '2022-11-26', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2022-24999' ], fixedVersion: '4.18.2', cwes: ['CWE-1321'], exploitAvailable: false }, vulnerableVersions: ['<4.18.2'] }, // Django vulnerabilities { ecosystem: 'pip', packageName: 'django', cve: { id: 'CVE-2023-36053', description: 'Django 3.2 before 3.2.20, 4.1 before 4.1.10, and 4.2 before 4.2.3 allows a denial of service via EmailValidator/URLValidator regex backtracking.', cvssScore: 7.5, severity: Severity.HIGH, publishedDate: '2023-07-03', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2023-36053', 'https://www.djangoproject.com/weblog/2023/jul/03/security-releases/' ], fixedVersion: '4.2.3', cwes: ['CWE-1333'], exploitAvailable: false }, vulnerableVersions: ['<3.2.20', '>=4.0,<4.1.10', '>=4.2,<4.2.3'] }, { ecosystem: 'pip', packageName: 'django', cve: { id: 'CVE-2023-41164', description: 'Django 3.2.x before 3.2.21, 4.1.x before 4.1.11, and 4.2.x before 4.2.5 allows a denial of service in django.utils.encoding.uri_to_iri.', cvssScore: 7.5, severity: Severity.HIGH, publishedDate: '2023-09-04', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2023-41164' ], fixedVersion: '4.2.5', cwes: ['CWE-400'], exploitAvailable: false }, vulnerableVersions: ['<3.2.21', '>=4.0,<4.1.11', '>=4.2,<4.2.5'] }, // Flask vulnerabilities { ecosystem: 'pip', packageName: 'flask', cve: { id: 'CVE-2023-30861', description: 'Flask is a lightweight WSGI web application framework. Versions prior to 2.2.5 and 2.3.2 are vulnerable to possible disclosure of permanent session cookie.', cvssScore: 7.5, severity: Severity.HIGH, publishedDate: '2023-05-02', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2023-30861', 'https://github.com/pallets/flask/security/advisories/GHSA-m2qf-hxjv-5gpq' ], fixedVersion: '2.3.2', cwes: ['CWE-539'], exploitAvailable: false }, vulnerableVersions: ['<2.2.5', '>=2.3,<2.3.2'] }, // Axios vulnerabilities { ecosystem: 'npm', packageName: 'axios', cve: { id: 'CVE-2023-45857', description: 'An issue in Axios allows a request to a non-HTTPS destination to leak the secret XSRF-TOKEN cookie value.', cvssScore: 6.5, severity: Severity.MEDIUM, publishedDate: '2023-11-08', references: [ 'https://nvd.nist.gov/vuln/detail/CVE-2023-45857' ], fixedVersion: '1.6.0', cwes: ['CWE-352'], exploitAvailable: false }, vulnerableVersions: ['>=0.8.1,<1.6.0'] }, // jQuery vulnerabilities { ecosystem: 'npm', packageName: 'jquery', cve: { id: 'CVE-2020-11023', description: 'In jQuery versions greater than or equal to 1.0.3 and before 3.5.0, passing HTML containing