Skip to content

fix: Gentoo GLSA data embeds the package SLOT directly in the version#2376

Open
singlaamitesh wants to merge 1 commit into
aboutcode-org:mainfrom
singlaamitesh:fix/1921-vulnerablecode-1921
Open

fix: Gentoo GLSA data embeds the package SLOT directly in the version#2376
singlaamitesh wants to merge 1 commit into
aboutcode-org:mainfrom
singlaamitesh:fix/1921-vulnerablecode-1921

Conversation

@singlaamitesh

Copy link
Copy Markdown

Fixes #1921

Summary

Gentoo GLSA data embeds the package SLOT directly in the version text (e.g. '6.9.3:6' or '3.24.48:3'), which univers.versions.GentooVersion cannot parse since a colon isn't valid Gentoo version syntax; this caused affected/safe versions to be silently dropped (previously caught by an existing try/except, masking the real bug of empty affected_packages). Fixed both the legacy and v2 Gentoo importers to strip the ':' suffix before constructing GentooVersion, and added regression tests using a real GLSA (qtsvg, 202511-03) fetched from the upstream glsa.git repo that reproduces the issue.

Changes

  • vulnerabilities/importers/gentoo.py
  • vulnerabilities/pipelines/v2_importers/gentoo_importer.py
  • vulnerabilities/tests/test_gentoo.py
  • vulnerabilities/tests/pipelines/v2_importers/test_gentoo_importer_v2.py
  • vulnerabilities/tests/test_data/gentoo/glsa-202511-03.xml
  • vulnerabilities/tests/test_data/gentoo/glsa-202511-03-expected.json
  • vulnerabilities/tests/test_data/gentoo_v2/glsa-202511-03.xml
  • vulnerabilities/tests/test_data/gentoo_v2/glsa-202511-03-expected.json

How this was tested

Ran the affected tests locally.

Copilot AI review requested due to automatic review settings July 14, 2026 05:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GentooImporter failing with InvalidVersion error

2 participants