Skip to content

Enhanced CVE Integration #5050

@Pritz395

Description

@Pritz395

Overview

This issue tracks the enhancement of CVE (Common Vulnerabilities and Exposures) integration in OWASP BLT. Currently, basic CVE functionality exists (CVE ID input, score fetching from NVD API, and display), but we can significantly improve it to provide more value to users and organizations.

Current State

  • cve_id and cve_score fields in Issue model
  • NVD API integration via get_cve_score() method
  • CVE ID validation in report form
  • CVE score display on issue detail pages
  • CVE-based analytics in organization dashboards

Proposed Enhancements

1. Enhanced CVE Data Model

  • Create dedicated CVE model to store comprehensive CVE data
  • Store description, published date, affected products, references
  • Support CVSS v2 and v3 metrics
  • Link to Issue model while maintaining backward compatibility

2. Improved NVD API Integration

  • Refactor to fetch full CVE details instead of just base score
  • Better error handling and rate limit management
  • Support for CVSS v3.1 metrics

3. Caching Layer

  • Implement caching for CVE data to reduce API calls
  • Cache invalidation strategy
  • Handle cache misses gracefully

4. CVE Search & Filtering

  • Search/filter issues by CVE ID
  • Filter by CVE score range
  • Database indexes for performance

5. API Enhancements

  • Dedicated CVE endpoints (/api/v1/cve/)
  • Enhanced IssueSerializer with richer CVE data
  • CVE statistics endpoint

6. UI/UX Improvements

  • Real-time CVE ID autocomplete in report form
  • Enhanced CVE display with severity badges
  • Expandable CVE details section
  • Visual indicators for CVE severity

7. Advanced Features (Optional)

  • Background tasks for periodic CVE score updates
  • CVE history tracking
  • CVE-based notifications/alerts

Implementation Plan

This will be implemented incrementally across multiple PRs:

  1. Enhanced CVE data model
  2. Improved NVD API integration
  3. Caching layer
  4. CVE search & filtering (backend)
  5. CVE API endpoints
  6. CVE autocomplete (frontend)
  7. Enhanced CVE display (UI)
  8. Advanced features (optional)

Benefits

  • Better user experience with search and autocomplete
  • Improved performance through caching
  • Richer CVE information for better decision-making
  • Enhanced analytics and reporting capabilities
  • Better scalability with background tasks

Technical Stack

  • Backend: Django models, views, API endpoints
  • Caching: Django cache framework
  • API: NVD API v2.0 integration
  • Frontend: Tailwind CSS (following project standards)

Related

  • Existing CVE fields: website/models.py (lines 580-581)
  • Current implementation: website/models.py (lines 627-641)
  • CVE display: website/templates/includes/issue_right_info.html

Acceptance Criteria

  • Enhanced CVE data model created
  • Full CVE details fetched from NVD API
  • Caching implemented
  • Search and filtering functional
  • API endpoints created
  • UI improvements implemented
  • Backward compatibility maintained
  • Tests written and passing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions