Skip to content

security: fix argument injection via crafted branch names in pull requests - #8390

Merged
unknwon merged 2 commits into
mainfrom
GHSA-2grc-qr7q-6m36
Jul 16, 2026
Merged

unknwon merged 2 commits into
mainfrom
GHSA-2grc-qr7q-6m36

Conversation

@unknwon

@unknwon unknwon commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

A branch name beginning with a dash could be treated by git as a command-line option rather than a revision when building a pull request patch, letting a user with write access influence how the underlying git command behaves (e.g., writing the diff to an arbitrary path via --output).

This bumps gogs/git-module to v1.8.8, which passes --end-of-options to the git diff invocation in DiffBinary (gogs/git-module#141), so such a value is treated as a revision that fails to resolve rather than as an option.

Fixes GHSA-2grc-qr7q-6m36.

@unknwon unknwon changed the title security: reject dash-prefixed refs when creating pull requests security: prevent argument injection via crafted branch names in pull requests Jul 16, 2026
@unknwon unknwon added this to the 0.14.4 milestone Jul 16, 2026
unknwon added 2 commits July 15, 2026 23:03
…uests

Bump gogs/git-module to v1.8.8, which passes --end-of-options to the git
diff invocation in DiffBinary. A branch name beginning with a dash, such
as "--output=/path", is now treated as a revision rather than a git
option, so an authenticated user with write access can no longer make git
write files to arbitrary paths by creating a pull request.

Fixes GHSA-2grc-qr7q-6m36.
@unknwon
unknwon force-pushed the GHSA-2grc-qr7q-6m36 branch from b87648a to 55c4a75 Compare July 16, 2026 03:04
@unknwon unknwon changed the title security: prevent argument injection via crafted branch names in pull requests security: fix argument injection via crafted branch names in pull requests Jul 16, 2026
@unknwon
unknwon merged commit 1ce6e1b into main Jul 16, 2026
8 checks passed
@unknwon
unknwon deleted the GHSA-2grc-qr7q-6m36 branch July 16, 2026 03:09
unknwon added a commit that referenced this pull request Nov 11, 2026
@unknwon unknwon mentioned this pull request Nov 11, 2026
4 of 6 tasks
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