Repository navigation
[Scanning] Follow pagination links only on the original origin - #303
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EFH7zwwFh7RNHRvHugDK6
|
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.



Pull Request
📖 Description
Docker Hub, the generic OCI tag listing and Docker Scout followed the "next page" link exactly as the remote side returned it, so a tampered response could send the Docker Hub bearer token to any host. A new shared
PaginationLinkGuardnow resolves each link against the current request (relative links included) and follows it only when scheme, host and port match the allowed origin. Any other link sends no request, logs a warning without credentials and makes the call return failed, so a truncated list is never reported as succeeded. The change also fixes root-relativeLinktargets on OCI registries such as ghcr.io, which failed on Linux. The rule is recorded in decision 0004 and described in the registries, vulnerabilities and telemetry area documents,ARCHITECTURE.mdand theREADME.mdconfiguration rows.🎫 Issues
Closes #264
💬 Reviewer Notes
Start with
src/DockerUpdateGuard/Infrastructure/PaginationLinkGuard.cs; the three call sites send exactly theUrithe guard returned. Docker Scout's realnextlink form could not be observed without credentials; the design fails closed, which decision 0004 records as residual risk. A mirror or proxy set asDockerHub:ApiBaseUrlmust rewrite next-page links to its own origin.📑 Test Plan
New
PaginationLinkGuardTestspin the link formsUriaccepts (case, default port, scheme downgrade, relative, UNC and backslash forms, punycode). The Docker Hub, Docker Scout and OCI client tests cover cross-origin rejection with no request to the foreign host, noAuthorizationheader leaving the configured origin, and no secrets in messages or logs. All tests pass, and changed-line coverage is 100 %.✅ Checklist
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (line coverage on new or changed production code and overall).README.md,ARCHITECTURE.md) to reflect my changes..squad/stack.mdprescribes.csharp.instructions.mdare followed.⏭ Next Steps