fix: group security alerts by normalized name and link to GHSA pages#15
Merged
Merged
Conversation
Dependabot reports the same package under inconsistent casing across advisories (e.g. "starlette" and "Starlette"). Grouping by the raw name split it into two packages with different fix versions, so the second upgrade downgraded what the first one fixed, leaving the lockfile on a still-vulnerable version. Group by the PEP 503 normalized name so all advisories merge and the highest fix version wins. Also prefer the GHSA advisory URL over NVD for vulnerability links: freshly-assigned CVEs are often still RESERVED and 404 on NVD, while the GHSA page always exists for a Dependabot alert. Claude-Session: https://claude.ai/code/session_01VFS7dXstJqCtX4zYF9Gp3x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Investigated odd output from the security workflow in python-template#90. Two independent bugs:
1. Casing → split grouping → upgrade-then-downgrade (security correctness)
fetch_alerts()grouped Dependabot alerts by the raw package name. GitHub's advisory database reports the same package under inconsistent casing across advisories (e.g.starletteandStarlette), so it split into twoVulnerablePackageentries with different fix versions:starlette(3 CVEs) → fix1.3.1Starlette(1 CVE) → fix1.3.0upgrade_packages()then processed both sequentially: upgraded to1.3.1, then downgraded to1.3.0. The lockfile ended on1.3.0, leaving the three1.3.1CVEs unfixed even though the PR claimed to address them — plus two confusingly-cased rows.2. Broken vulnerability links
Advisory.markdown_link()preferred NVD CVE links. Freshly-assignedCVE-2026-*ids are still RESERVED and return "CVE ID Not Found" on NVD, so the links were dead.Fix
1.3.1). Single upgrade, single row, lockfile lands on the correct fixed version.Verified both changes with an inline test against the real functions.
https://claude.ai/code/session_01VFS7dXstJqCtX4zYF9Gp3x