You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
severity: high — src/scanner/source.ts / resolveScanSource fetch path
The new GitHub scan path allows --ref to be any branch/tag/fully qualified ref and passes the resolved ref directly to git fetch ... origin <expectedRevision>. For refs that resolve to a moving branch/tag, the code then checks out the fetched commit by SHA, but it does not re-verify that the fetched commit still matches the advertised ref at checkout time. A repo update between ls-remote and fetch can produce a scan of a different revision than requested, making results non-reproducible and potentially bypassing “scan before install” assumptions. Fix: fetch and verify the exact advertised ref atomically where possible, or re-run ls-remote after fetch and abort unless the resolved SHA still matches the requested ref; for reproducibility, prefer requiring a full commit SHA in security-sensitive flows.
severity: medium — src/scanner/source.ts / normalizeGithubRepositoryUrl and repo URL handling
The scanner only accepts https://github.com/owner/repository and rejects other GitHub-hosted HTTPS forms (e.g. uppercase hostnames, .git with queryless alternate paths are okay, but www.github.com, enterprise GitHub, or URLs with encoded path variants are not). More importantly, the regex accepts any single path segment after the owner, so some malformed repository URLs can be normalized and sent to git before later failure, which can be used to trigger unnecessary network access and confusing error paths. Fix: validate the URL with new URL(), require exact github.com host, and perform stricter path segment checks before any git invocation; clearly reject unsupported GitHub Enterprise/alternate hosts up front.
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
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.
Summary
Add HTTPS GitHub repository support to
agentguard scan.--refselection for branches, tags, fully qualified refs, and full commit SHAs.Type
Testing
npm run buildpassesnpm testpasses (604 tests)Related Issues
Closes #