Repository navigation
List every existing advisory under --strict-blocking - #459
Draft
David Larsen (dc-larsen) wants to merge 7 commits into
Draft
David Larsen (dc-larsen) wants to merge 7 commits into
David Larsen (dc-larsen) wants to merge 7 commits into
Conversation
Existing alerts for --strict-blocking are read from the new full scan through socketdev's fullscans.stream(). socketdev 3.6.2 merged alerts that share a type and severity on a package, so only the first CVE of each severity reached the CLI. The Existing alerts table and the EXISTING blocking issues count undercounted (3 instead of 8 in the repro), and when the first CVE of a group was resolved or triaged to monitor or ignore, the Block CVEs behind it were dropped and the run passed. socketdev 3.6.3 keys merged alerts on the advisory ID and keeps the most severe action. Pin it. The CLI's own consolidation already keeps the advisory ID (Issue.consolidation_key) and filters on error/warn before it dedupes, so no CLI logic changes. The new tests run the real FullScans.stream() over a canned response, so they fail if the pinned SDK collapses advisories again. Bumps the version to 2.13.1. uv.lock needs `uv lock` once socketdev 3.6.3 is published.
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 19:59 — with
GitHub Actions
Failure
This was referenced Nov 20, 2026
--strict-blocking
Full-scan mode with --enable-json, --enable-sarif or --enable-gitlab-security reads alerts through the same SDK stream, so those reports now list every advisory on a package too. Diff mode's existing alerts in the GitLab and FOSSA-format output change the same way.
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 22:06 — with
GitHub Actions
Failure
This was referenced Nov 20, 2026
socketdev 3.6.3 was released without the advisory dedupe fix, which now ships as 3.6.4. uv.lock still needs `uv lock` once 3.6.4 is published.
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 22:22 — with
GitHub Actions
Failure
…eep-each-existing-advisory # Conflicts: # CHANGELOG.md # pyproject.toml
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 22:30 — with
GitHub Actions
Failure
This was referenced Nov 20, 2026
…eep-each-existing-advisory
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 22:37 — with
GitHub Actions
Failure
…eep-each-existing-advisory # Conflicts: # CHANGELOG.md
2.13.2 was released from main, so this change needs the next patch version.
David Larsen (dc-larsen)
had a problem deploying
to
socket-firewall
November 20, 2026 23:11 — with
GitHub Actions
Failure
This branch had an error being deployed
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.
Follow-up to #453. Under
--strict-blocking, the Existing alerts table and theEXISTING blocking issuescount show one CVE per package and severity. In a customer report, handlebars@4.0.11 has 6 Critical CVEs with a Block action in the raw full scan, and the CLI listed 1. The whole repro scan had 8 existing blockers; the CLI reported 3 ("Loaded 49 alerts" vs 69 raw).The same bug can pass a run that should fail. If the first-listed CVE of a group is resolved or triaged to monitor/ignore, the Block CVEs behind it are dropped. Reproduced below: vm2@3.9.11 with 34 Block CVEs, stock 2.13.0 exits 0.
Root Cause
Core.add_existing_alerts_from_full_scanreads alerts on unchanged packages throughCore.get_sbom_data→sdk.fullscans.stream(). socketdev 3.6.2 runsDedupeon that stream, which keys alerts on(type, severity, category, file, start, end)and keeps the first alert'saction. CVE alerts have no file, so all same-severity advisories on a package collapse into one before the CLI sees them. #453 fixed the CLI's own key (Issue.consolidation_key()includes the advisory ID), but the data was already gone. In diff mode, new-alert rows aren't affected because added packages come from the diff-scan artifacts, not the stream.The same stream also feeds full-scan mode when
--enable-json,--enable-sarifor--enable-gitlab-securityis set (Core.create_full_scan_with_report_url→get_sbom_data), and existing alerts in diff mode for--enable-gitlab-securityand--legal-format fossa. Those outputs now get one entry per advisory as well. Live example, PyPI project (Django 2.2, Pillow 6.2.0 and others), full-scan mode with--enable-json:new_alertswent from 5 alerts / 3 Block to 22 / 20 Block. The changelog has a bullet for this.Fix
Pin
socketdev==3.6.4. That release keys merged alerts on the advisory ID and keeps the most severe action (error > warn > monitor > ignore).No CLI logic change.
get_unchanged_alertsalready filters to error/warn before it dedupes onconsolidation_key(), so it handles the full alert list correctly once it gets it.New tests in
tests/core/test_existing_alerts.pyrun the realFullScans.stream()over a canned NDJSON response (the existing tests stubstream, so they never exercised the SDK merge):ignoreormonitor, seconderror→ the Block CVE is kept and the run failsThey fail on socketdev 3.6.2 (3 failed; the triaged case returns no existing alerts) and pass with the Doug/fix reachability engine cwd #134 branch (3.6.4).
Changelog: a
### Changedbullet for the SDK bump and three### Fixedbullets under## 2.13.3.Version: 2.13.1 and 2.13.2 were released from
mainon 2026-11-20, so this branch mergesmainatv2.13.2and bumps to2.13.3inpyproject.toml,socketsecurity/__init__.pyanduv.lock, with its CHANGELOG entries under a new## 2.13.3heading. Inuv.lockonly thesocketsecurityversion line changes; itssocketdeventry stays at 3.6.3 until 3.6.4 is published, which is whyuv lock --lockedfails. #459, #460, #461, #462, #463, #464 and #465 all make the same bump, so the version files merge cleanly between them, and once one merges the rest ride main's unreleased2.13.3(Version Check accepts a version equal to main's while it is above the latest PyPI release). Merging a second one conflicts only inCHANGELOG.md: keep one## 2.13.3heading and combine the bullets under its subsections (Upgrade notes, Changed, Fixed, Documentation, in that order). There are no code conflicts between them. Ifmainreleases 2.13.3 before this merges, bump to the next patch again.Tests
pytestwith socketdev 3.6.4 installed from the SDK branch, API key variables unset: 1004 passed (main: 1001 passed).ruff checkpasses.hatch buildandtwine check dist/*pass.End to end: stock 2.13.0 + socketdev 3.6.2 vs this branch + the #134 SDK branch, against a test org. Each project has a default-branch baseline and a PR branch with no dependency change, run with
--strict-blocking --ignore-commit-files --integration api --scm api. "Raw" is counted fromGET /orgs/{org}/full-scans/{id}for the same scan: distinct (package, alert type, advisory) with actionerror. Patched runs were repeated twice with identical results.--strict-blocking). A non-strict run on the unchanged branch exits 0 with both. Adding a package to the MERN app changes only the existing count (17 → 22).--strict-blocking, streamline exit code behavior #453, not this change; the header still says 8.Public Changelog
--strict-blockinglists and counts every CVE on an unchanged package, and a triaged CVE no longer hides a Block CVE of the same severity on that package. JSON, SARIF and GitLab security reports from a full scan also list every advisory on a package.