Skip to content

Commit 187d6c2

Browse files
authored
dep: update github.com/gogs/git-module to v1.8.4 (gogs#7872)
## Describe the pull request Fixes GHSA-m27m-h5gj-wwmg by including gogs/git-module#110
1 parent e63fc23 commit 187d6c2

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default
2+
* @gogs/core

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/go-macaron/toolbox v0.0.0-20190813233741-94defb8383c6
1818
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561
1919
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
20-
github.com/gogs/git-module v1.8.3
20+
github.com/gogs/git-module v1.8.4
2121
github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4
2222
github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0
2323
github.com/gogs/minwinsvc v0.0.0-20170301035411-95be6356811a
@@ -37,7 +37,7 @@ require (
3737
github.com/satori/go.uuid v1.2.0
3838
github.com/sergi/go-diff v1.3.1
3939
github.com/sourcegraph/run v0.12.0
40-
github.com/stretchr/testify v1.9.0
40+
github.com/stretchr/testify v1.10.0
4141
github.com/unknwon/cae v1.0.2
4242
github.com/unknwon/com v1.0.1
4343
github.com/unknwon/i18n v0.0.0-20190805065654-5c6446a380b6

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBU
129129
github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
130130
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8=
131131
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
132-
github.com/gogs/git-module v1.8.3 h1:4N9HOLzkmSfb5y4Go4f/gdt1/Z60/aQaAKr8lbsfFps=
133-
github.com/gogs/git-module v1.8.3/go.mod h1:yAn6ZMwh8x0u3fMotXqMP7Ct1XNNOZWNdBSBx6IFGCY=
132+
github.com/gogs/git-module v1.8.4 h1:oSt8sOL4NWOGrSo/CwbS+C4YXtk76QvxyPofem/ViTU=
133+
github.com/gogs/git-module v1.8.4/go.mod h1:bQY0aoMK5Q5+NKgy4jXe3K1GFW+GnsSk0SJK0jh6yD0=
134134
github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4 h1:C7NryI/RQhsIWwC2bHN601P1wJKeuQ6U/UCOYTn3Cic=
135135
github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
136136
github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0 h1:K02vod+sn3M1OOkdqi2tPxN2+xESK4qyITVQ3JkGEv4=
@@ -419,8 +419,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
419419
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
420420
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
421421
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
422-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
423422
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
423+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
424+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
424425
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
425426
github.com/unknwon/cae v1.0.2 h1:3L8/RCN1ARvD5quyNjU30EdvYkFbxBfnRcIBXugpHlg=
426427
github.com/unknwon/cae v1.0.2/go.mod h1:HqpmD2fVq9G1oGEXrXzbgIp51uJ29Hshv41n9ljm+AA=
@@ -511,7 +512,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
511512
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
512513
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
513514
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
514-
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
515+
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
515516
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
516517
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
517518
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

internal/database/release.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func createTag(gitRepo *git.Repository, r *Release) error {
125125
return fmt.Errorf("get branch commit: %v", err)
126126
}
127127

128-
// Trim '--' prefix to prevent command line argument vulnerability.
129-
r.TagName = strings.TrimPrefix(r.TagName, "--")
128+
// 🚨 SECURITY: Trim any leading '-' to prevent command line argument injection.
129+
r.TagName = strings.TrimLeft(r.TagName, "-")
130130
if err = gitRepo.CreateTag(r.TagName, commit.ID.String()); err != nil {
131131
if strings.Contains(err.Error(), "is not a valid tag name") {
132132
return ErrInvalidTagName{r.TagName}

internal/database/repo_editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (repo *Repository) GetDiffPreview(branch, treePath, content string) (diff *
243243
return nil, fmt.Errorf("write file: %v", err)
244244
}
245245

246-
// 🚨 SECURITY: Prevent including unintended options in the path to the git command.
246+
// 🚨 SECURITY: Prevent including unintended options in the path to the Git command.
247247
cmd := exec.Command("git", "diff", "--end-of-options", treePath)
248248
cmd.Dir = localPath
249249
cmd.Stderr = os.Stderr

0 commit comments

Comments
 (0)