Skip to content

Duplicate Cards Displayed (Same ID/Content Across Versions) on copi.owasp.org/cards #2516

@khushal-winner

Description

@khushal-winner

Describe the bug
Duplicate cards (same ID and content, e.g. VE2) appear multiple times on https://copi.owasp.org/cards due to all versions being loaded from the database.

Expected behavior
Only the latest version (or any single) of each card should be displayed, without duplicates.

Video Demo

2026-03-05.04-43-23.mp4

Desktop (please complete the following information):

  • OS: any
  • Browser: any
  • Version: any

Additional context
Root cause: list_cards() in lib/copi/cornucopia.ex fetches all card records without filtering by latest version or grouping by external_id/edition. Multiple YAML files (e.g. webapp-cards-1.22-en.yaml to 2.2-en.yaml) seed identical cards (VE2 etc.) across versions. The HEEx template renders every record, causing duplicates.
Suggested fix: Update query to select only max version per card/edition.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions