Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a security vulnerability where tracked time records could be accessed or deleted across different issues by knowing the tracked time ID. The fix adds issue ID scoping to the GetTrackedTimeByID function to ensure that tracked time records can only be accessed when the correct issue ID is provided.
Changes:
- Modified
GetTrackedTimeByIDto require bothissueIDandtrackedTimeIDparameters, adding a WHERE clause to scope the lookup - Updated all callers (API endpoint, web endpoint, and comment loading) to pass the issue ID
- Added comprehensive integration tests to verify the security fix works for both web and API endpoints
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| models/issues/tracked_time.go | Core security fix: Changed GetTrackedTimeByID signature to accept issueID parameter and added WHERE clause for issue_id scoping |
| routers/api/v1/repo/issue_tracked_time.go | Updated API endpoint to pass issue.ID to GetTrackedTimeByID |
| routers/web/repo/issue_timetrack.go | Updated web endpoint to pass issue.ID to GetTrackedTimeByID |
| models/issues/comment.go | Updated comment loading to pass c.IssueID to GetTrackedTimeByID |
| tests/integration/issue_timetrack_test.go | New test validating web endpoint rejects cross-issue tracked time deletion attempts |
| tests/integration/api_issue_tracked_time_test.go | Added test case validating API endpoint rejects cross-issue tracked time deletion attempts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
silverwind
approved these changes
Feb 18, 2026
Zettat123
approved these changes
Feb 20, 2026
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this pull request
Feb 20, 2026
lunny
added a commit
that referenced
this pull request
Feb 21, 2026
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Feb 23, 2026
* giteaofficial/main: (81 commits) Add keyboard shortcuts for repository file and code search (go-gitea#36416) Refactor text utility classes to Tailwind CSS (go-gitea#36703) Prevent redirect bypasses via backslash-encoded paths (go-gitea#36660) Fix force push time-line commit comments of pull request (go-gitea#36653) Fix get release draft permission check (go-gitea#36659) Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (go-gitea#30256) Update JS and PY deps (go-gitea#36708) Move jobparser from act repository to Gitea (go-gitea#36699) Fix push time bug (go-gitea#36693) Add icon to buttons "Close with Comment", "Close Pull Request", "Close Issue" (go-gitea#36654) various fixes (go-gitea#36697) Add AI Contribution Policy to CONTRIBUTING.md (go-gitea#36651) Add some validation on values provided to USER_DISABLED_FEATURES and EXTERNAL_USER_DISABLED_FEATURES (go-gitea#36688) Rework e2e tests (go-gitea#36634) Remove unused functions (go-gitea#36672) Add migration http transport for push/sync mirror lfs (go-gitea#36665) Fix track time issue id (go-gitea#36664) Refactor inline style attributes (go-gitea#36652) Update Nix flake (go-gitea#36679) Upgrade gogit to 5.16.5 (go-gitea#36680) ... # Conflicts: # web_src/js/features/repo-issue-content.ts
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.
No description provided.