summaryrefslogtreecommitdiff
path: root/internal/command/commandargs/shell.go
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2021-08-04 02:31:15 +0000
committerPatrick Bajao <ebajao@gitlab.com>2021-08-04 02:31:15 +0000
commitdf0138b5f0f8f998a832c6c063128f56d1953604 (patch)
tree419b8a92d0a60bad566cf821197bec8838d7a130 /internal/command/commandargs/shell.go
parent00735e0bbf51e28bcec5086d9d0f62999d19d2c5 (diff)
parentfcff692b596270483fba4496d3fb7d971367f9d8 (diff)
downloadgitlab-shell-df0138b5f0f8f998a832c6c063128f56d1953604.tar.gz
Merge branch 'security-300265' into 'main'
Modify regex to prevent partial matches See merge request gitlab-org/security/gitlab-shell!6
Diffstat (limited to 'internal/command/commandargs/shell.go')
-rw-r--r--internal/command/commandargs/shell.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/command/commandargs/shell.go b/internal/command/commandargs/shell.go
index 9cf6720..589f58d 100644
--- a/internal/command/commandargs/shell.go
+++ b/internal/command/commandargs/shell.go
@@ -20,8 +20,8 @@ const (
)
var (
- whoKeyRegex = regexp.MustCompile(`\bkey-(?P<keyid>\d+)\b`)
- whoUsernameRegex = regexp.MustCompile(`\busername-(?P<username>\S+)\b`)
+ whoKeyRegex = regexp.MustCompile(`\Akey-(?P<keyid>\d+)\z`)
+ whoUsernameRegex = regexp.MustCompile(`\Ausername-(?P<username>\S+)\z`)
)
type Shell struct {