Repository navigation
Link advisory IDs in PR and MR security comments - #477
David Larsen (dc-larsen) wants to merge 3 commits into
Conversation
PR SummaryLow Risk Overview HTML titles use Changelog updated for 2.16.0; existing and new tests cover linking, deduplication, whole-ID matching, and HTML escaping. Reviewed by Cursor Bugbot for commit 97ceb80. Configure here. |
|
bugbot run |
There was a problem hiding this comment.
David Larsen (@dc-larsen), please fix one rendering edge case before this lands.
Advisory IDs in alert titles
In advisory_ids_for_title(), an ID already in the title is excluded from the linked list, so it stays plain text. The substring check can also hide a different CVE whose ID is a prefix of one in the title. Link a complete ID in place and append links for the remaining IDs once. Add tests for both cases and keep the escaping and finding-identity coverage. Please verify the links render in a GitLab MR as well as GitHub.
PR and release notes
- Suggested title: Link advisory IDs in PR and MR security comments. Keep the before/after example. Trim the body to the behavior, identity compatibility, and rendering checks. Shorten the rendering docstring to its escaping and link contract.
- Put a single entry under Changed in the shared
2.16.0changelog: “PR and MR security comments link available GHSA and CVE IDs to their public advisory pages.” Use the same sentence in the PR’s Public Changelog block. The existing CLI reference and README are sufficient for this presentation change. - Please fold this into 2.16.0. #478 should set the version because it adds a supported CLI flag. Drop the independent 2.15.7 bump and rerun CI and Bugbot on the final head.
Each security comment row showed one advisory ID, the GHSA when the alert had one and the CVE otherwise, as plain text. Alerts from the API usually carry both, so the CVE was dropped from the row, and developers who only see the PR comment had no link to the advisory. Rows now list every advisory ID on the alert, GHSA first, each linked to its public page (github.com/advisories for GHSA, nvd.nist.gov for CVE), the same two sites the GitLab security report already links. Only IDs in the canonical GHSA or CVE shape are linked; anything else renders as escaped text. IDs keep the API's spelling instead of being upper-cased. Issue.advisory_ids() is new and used only for display. advisory_id() and consolidation_key() are unchanged, so de-duplication, SARIF rule IDs and GitLab finding IDs stay the same. Shares the 2.16.0 version set in #478.
An ID the title already named was dropped from the linked list and stayed plain text, and the substring check also hid a different CVE whose ID is a prefix of one in the title (CVE-2021-2333 inside CVE-2021-23337). IDs now match only in full. An ID the title names is linked in place, keeping the title's spelling and linking the API's ID, and the remaining IDs are appended once. The plain-text title uses the same full-ID match.
7ec9f6d to
3f3be31
Compare
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 97ceb80. Configure here.
|
🐳 Docker preview published: This mutable tag is only created when a Docker preview is explicitly requested. |
PR and MR security comments link available GHSA and CVE IDs to GitHub Advisories and NVD. When the title already contains a complete ID, the ID links in place. The row appends the remaining IDs once. Finding identity, SARIF rule IDs, and GitLab finding IDs are preserved.
Stacked on #479 so the advisory links share the 2.16.0 version and changelog section.
Verification
Public Changelog
PR and MR security comments link available GHSA and CVE IDs to their public advisory pages.
Refs: CE-532