summaryrefslogtreecommitdiff
path: root/internal/command/commandargs/shell.go
diff options
context:
space:
mode:
authorPatrick Bajao <ebajao@gitlab.com>2021-07-26 05:50:50 +0000
committerPatrick Bajao <ebajao@gitlab.com>2021-07-26 05:50:50 +0000
commit757aa7c0e0b8733c75c744f188b0136c1fe1830f (patch)
treefa00ccc82a3b2d57b13a53a6cb09378848f64324 /internal/command/commandargs/shell.go
parente01ebb3bfa7afc0d2f26dd2f4bbadce56f325722 (diff)
parentf2c8eecc2c4b195e9ba0bc129f5cbd5c53a04c89 (diff)
downloadgitlab-shell-13-19-stable.tar.gz
Merge branch 'security-300265-13-19' into '13-19-stable'v13.19.113-19-stable
Modify regex to prevent partial matches See merge request gitlab-org/security/gitlab-shell!7
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 {