Skip to content

Commit

Permalink
fix: add login component username validation
Browse files Browse the repository at this point in the history
Signed-off-by: Czékus Máté <[email protected]>
  • Loading branch information
Shikachuu committed Jul 14, 2024
1 parent 95a5fca commit f630815
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/nerdctl/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func processLoginOptions(cmd *cobra.Command) (types.LoginCommandOptions, error)
return types.LoginCommandOptions{}, err
}

if strings.Contains(username, ":") {
return types.LoginCommandOptions{}, errors.New("username cannot contain colons")
}

if password != "" {
log.L.Warn("WARNING! Using --password via the CLI is insecure. Use --password-stdin.")
if passwordStdin {
Expand Down

0 comments on commit f630815

Please sign in to comment.