Skip to content

fix(security): reject bearer tokens issued before project creation (#… - #22939

Merged
chlins merged 1 commit into
goharbor:release-2.14.0from
wy65701436:release-2.14.0-cp-22900
Mar 5, 2026
Merged

chlins merged 1 commit into
goharbor:release-2.14.0from
wy65701436:release-2.14.0-cp-22900

Conversation

@wy65701436

Copy link
Copy Markdown
Contributor

…22900)

Prevents authorization bypass when a project is deleted and recreated with the same name. Compares token issued-at (iat) against the current project's creation_time; tokens older than the project are rejected.

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

…oharbor#22900)

Prevents authorization bypass when a project is deleted and recreated
with the same name. Compares token issued-at (iat) against the current
project's creation_time; tokens older than the project are rejected.

Signed-off-by: Vadim Bauer <[email protected]>
@codecov

codecov Bot commented Mar 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-2.14.0@ca5469b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/server/middleware/security/v2_token.go 85.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-2.14.0   #22939   +/-   ##
=================================================
  Coverage                  ?   65.85%           
=================================================
  Files                     ?     1072           
  Lines                     ?   116078           
  Branches                  ?     2931           
=================================================
  Hits                      ?    76444           
  Misses                    ?    35395           
  Partials                  ?     4239           
Flag Coverage Δ
unittests 65.85% <85.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/server/middleware/security/v2_token.go 72.54% <85.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chlins chlins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@chlins
chlins enabled auto-merge (squash) March 5, 2026 10:07
@chlins
chlins merged commit a8c8c84 into goharbor:release-2.14.0 Mar 5, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants