Skip to content

Commit 5aac20d

Browse files
authored
repo_tag: ignore unintended Git options when creating tags (#110)
### Describe the pull request Fixes GHSA-m27m-h5gj-wwmg
1 parent 377da9c commit 5aac20d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/go.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Checkout code
2828
uses: actions/checkout@v4
2929
- name: Install Go
30-
uses: actions/setup-go@v4
30+
uses: actions/setup-go@v5
3131
with:
3232
go-version: 1.23.x
3333
- name: Check Go module tidiness
@@ -51,7 +51,7 @@ jobs:
5151
name: Test
5252
strategy:
5353
matrix:
54-
go-version: [ 1.22.x, 1.23.x ]
54+
go-version: [ 1.23.x ]
5555
platform: [ ubuntu-latest, macos-latest, windows-latest ]
5656
runs-on: ${{ matrix.platform }}
5757
steps:

CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default
2+
* @gogs/core

repo_tag.go

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ func (r *Repository) CreateTag(name, rev string, opts ...CreateTagOptions) error
248248
cmd.AddCommitter(opt.Author)
249249
}
250250
} else {
251+
// 🚨 SECURITY: Prevent including unintended options in the path to the Git command.
252+
cmd.AddArgs("--end-of-options")
251253
cmd.AddArgs(name)
252254
}
253255

0 commit comments

Comments
 (0)