Skip to content

security: fix cross-repository label modification vulnerability#8123

Merged
unknwon merged 1 commit intomainfrom
fix/ghsa-cv22-72px-f4gh
Jan 31, 2026
Merged

security: fix cross-repository label modification vulnerability#8123
unknwon merged 1 commit intomainfrom
fix/ghsa-cv22-72px-f4gh

Conversation

@unknwon
Copy link
Member

@unknwon unknwon commented Jan 31, 2026

Summary

  • Fix broken access control vulnerability in UpdateLabel that allowed cross-repository label tampering

Details

The UpdateLabel function in internal/route/repo/issue.go used database.GetLabelByID(f.ID) which fetches labels without validating repository ownership. This allowed authenticated users with write access to any repository to modify labels belonging to other repositories.

Changed to use database.GetLabelOfRepoByID(c.Repo.Repository.ID, f.ID) which validates the label belongs to the current repository at the database layer, consistent with how DeleteLabel and the API's EditLabel handle this.

References

🤖 Generated with Claude Code

The UpdateLabel function used GetLabelByID which fetches labels without
validating repository ownership, allowing authenticated users with write
access to any repository to modify labels belonging to other repositories.

Changed to use GetLabelOfRepoByID which validates the label belongs to
the current repository at the database layer.

Ref: GHSA-cv22-72px-f4gh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@unknwon unknwon merged commit bb68c0a into main Jan 31, 2026
11 checks passed
@unknwon unknwon deleted the fix/ghsa-cv22-72px-f4gh branch January 31, 2026 17:28
@unknwon unknwon added this to the 0.14.0 milestone Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant