Repository navigation
fix: fail closed on verdict errors and resolve npm aliases #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+302
−20
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
21905fd
fix: fail the scan when the verdict API returns no verdict
cherylaurelia 9eb025a
fix: retry verdict lookups the API rate-limited
cherylaurelia e7fe9b1
fix: look up npm aliases by their registry name
cherylaurelia 7071ccf
fix: reject failed and malformed verdict envelopes
zeyu2001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./dependency-scan/scripts/hfw_report.py:180-184
http_get_jsonsleeps for the server-selected delay and retries each HTTP 429 up to the default six times. A pull-request author only needs to add many distinct syntactically valid coordinates to a supported manifest, and the verdict service must rate-limit the resulting request burst. The scan can then spend up to 360 seconds sleeping for each coordinate while the executor processes the queued work in four-worker waves. This delays the report step and can make the dependency check hit the workflow job timeout before it produces a verdict.Steps to Reproduce
Create a pull-request branch whose base revision does not contain
package-lock.json. Run the separate Python script in thepython_scriptfield at the repository root to create a supported head manifest with 100 distinct package coordinates.Run the composite action with
HFW_RATE_LIMIT_RETRIESunset so it uses the default six retries and with the defaultHFW_PARALLELvalue of four. Configure the inheritedHFW_SERVERenvironment variable to a test verdict endpoint that returns HTTP 429 andRetry-After: 1for every/verdict/...request. The same behavior can be observed against the normal verdict service when this pull request causes it to rate-limit the request burst.Check the report-step logs for
querying verdicts for 100 package(s) ... parallel=4, and check the test endpoint request log for repeated requests for each coordinate. Each coordinate should receive its initial request plus six retries, with a one-second sleep between retry attempts.Check that the report step remains active while the four worker threads sleep and drain the queued coordinates. With
Retry-After: 60, the same response pattern permits up to 360 seconds of sleep per coordinate and can prevent the workflow from completing before its job timeout.Fix with AI
Triage: Reply
!fp <reason>(false positive),!valid(confirmed),!accepted_risk <reason>, or!fixed(resolved). Any other reply is saved as a triage note.Reason is optional but improves future scans — e.g.
!fp internal endpoint, not user-facing.View finding in Hacktron