Skip to content

History of Advisories #2329

Open
Open

Description

@Samk1710

Right now, when an advisory is updated upstream, we create a new record in the db(mark it with is_latest=True) on the subsequent importer run but there is no way for a user to see what actually changed over time.

  • At first we need a Way Back Machine mimic for advisories to see a advisory snapshot exactly how it was at that point in time
  • We display the diffs between versions directly in the UI (if a severity score changes, a new reference is added, or a package is removed, users should be able to see exactly when and what happened at a glance)

Suggested UX:

  • Add a "History" tab to the advisory detail page.
  • Show a chronologically ordered list of versions of the advisory
  • Allow users to click into a specific historical snapshot to view the advisory exactly as it was at that point in time, just like a way Back Machine
  • Need a summary/diff of what changed for a quick overview

Excluding changes summary and epss score(can be tracked after merge of #2328 ; also since it changes everyday) might be good.

Activity

  1. moved this from Todo to In Progress in GSOC '26 - VulnerableCode Insightson Jun 7, 2026
  2. Samk1710 commented on Jun 7, 2026

    @Samk1710
    ContributorAuthor
  3. added
    insightsVulnerableCode Insights features, providing more insights into vulnerablecode data.
    on Jun 22, 2026
  4. Samk1710 commented on Jul 9, 2026

    @Samk1710
    ContributorAuthor

    A similar function can be used to find the diff:

    vulnerablecode/vulnerabilities/utils.py

    Line 644 in 77e9052

    def compute_content_id(advisory_data):

    We are considering the following fields for diff :

    normalized_data = {
            "advisory_id": advisory_data.advisory_id,
            "aliases": advisory_data.aliases,
            "summary": advisory_data.summary,
            "affected_packages": [pkg.to_dict() for pkg in advisory_data.affected_packages if pkg],
            "references": [ref.to_dict() for ref in advisory_data.references if ref],
            "severities": [sev.to_dict() for sev in advisory_data.severities if sev],
            "weaknesses": advisory_data.weaknesses,
            "patches": [patch.to_dict() for patch in advisory_data.patches],
            "url": advisory_data.url,
        }

    Suugested History Model:

    class AdvisoryV2HistoryDiff(models.Model):
    
        advisory_before = models.ForeignKey(
            AdvisoryV2,
            on_delete=models.CASCADE,
            related_name="history_diff_before",
            null=True,  # For the very first advisory 
            blank=True
        )
        
        advisory_after = models.OneToOneField(
            AdvisoryV2,
            on_delete=models.CASCADE,
            related_name="history_diff",
        )
    
        summary_added = models.TextField(blank=True, null=True)
        summary_removed = models.TextField(blank=True, null=True)
    
        url_added = models.URLField(blank=True, null=True)
        url_removed = models.URLField(blank=True, null=True)
    
        added_severities = models.ManyToManyField("AdvisorySeverity", related_name="added_in_history", blank=True)
        removed_severities = models.ManyToManyField("AdvisorySeverity", related_name="removed_in_history", blank=True)
    
        added_references = models.ManyToManyField("AdvisoryReference", related_name="added_in_history", blank=True)
        removed_references = models.ManyToManyField("AdvisoryReference", related_name="removed_in_history", blank=True)
        
       ...
       ...
    
    
        # (similar for  packages,  aliases, weaknesses and patches)

    @ziadhany @keshav-space your thoughts on this?

  5. moved this from In Progress to Under Review in GSOC '26 - VulnerableCode Insightson Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    insightsVulnerableCode Insights features, providing more insights into vulnerablecode data.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions