diff options
author | Patrick Bajao <ebajao@gitlab.com> | 2021-07-26 05:51:09 +0000 |
---|---|---|
committer | Patrick Bajao <ebajao@gitlab.com> | 2021-07-26 05:51:09 +0000 |
commit | d6b32537346c98c21f25a84e9bd060c6a9188fec (patch) | |
tree | 7f1b2348f812dfb90c518d7344602125e82a138a /internal/command/commandargs/shell.go | |
parent | 584643e0e10e0cbeee4f8366b5e50656dfee9ea4 (diff) | |
parent | be84773e180914570ef2af88c839df3d26149153 (diff) | |
download | gitlab-shell-13-18-stable.tar.gz |
Merge branch 'security-300265-13-18' into '13-18-stable'v13.18.113-18-stable
Modify regex to prevent partial matches
See merge request gitlab-org/security/gitlab-shell!8
Diffstat (limited to 'internal/command/commandargs/shell.go')
-rw-r--r-- | internal/command/commandargs/shell.go | 4 |
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 { |