[CHERRY-PICK] fix(security): validate blob-mount source project and reject tokens missing iat (#23270) - #23297
Merged
chlins merged 1 commit intoMay 29, 2026
Conversation
…eject tokens missing iat (goharbor#23270) Follow-up to goharbor#22900. tokenIssuedAfterProjectCreation only validated info.ProjectName. A cross-repository blob mount (POST /v2/<repo>/blobs/uploads/?from=<src>) also requires pull access to the source project, so a token issued before the source project was deleted and recreated with the same name would still be accepted. Validate the issued-at time against the blob-mount source project as well. Also fail closed when the token has no iat claim: claims.IssuedAt is a *NumericDate pointer and was dereferenced unconditionally, panicking the request handler for a token without iat instead of rejecting it. Signed-off-by: Vadim Bauer <vb@container-registry.com> (cherry picked from commit 8b82233)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-2.15.0 #23297 +/- ##
=================================================
Coverage ? 65.98%
=================================================
Files ? 1074
Lines ? 116754
Branches ? 2952
=================================================
Hits ? 77039
Misses ? 35438
Partials ? 4277
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Cherry-pick of #23270 onto
release-2.15.0.#23270 was a follow-up to #22900 (the project-recreation defense) that closed two remaining gaps in
tokenIssuedAfterProjectCreation:Issue being fixed
Cherry-pick of #23270.
Please indicate you've done the following: