Skip to content

Commit 8fb2063

Browse files
committed
[FIX] Security issues
1 parent b3ca668 commit 8fb2063

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: .github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
- name: golangci-lint
1616
uses: golangci/golangci-lint-action@v6
1717
with:
18-
version: v1.60
18+
version: v1.61
1919
skip-cache: true

Diff for: utils/bash.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package utils
22

33
import (
4+
"math"
45
"os"
56
"os/exec"
67
"os/user"
@@ -24,11 +25,18 @@ func GetUserUIDs(username string) (uint32, uint32, error) {
2425
if err != nil {
2526
return 0, 0, err
2627
}
28+
if uid < 0 || uid > math.MaxUint32 {
29+
uid = 0
30+
}
2731

2832
gid, err := strconv.Atoi(u.Gid)
2933
if err != nil {
3034
return 0, 0, err
3135
}
36+
if gid < 0 || uid > math.MaxUint32 {
37+
gid = 0
38+
}
39+
3240
return uint32(uid), uint32(gid), nil
3341
}
3442

0 commit comments

Comments
 (0)