Skip to content

Commit

Permalink
Merge pull request #3166 from Shikachuu/fix-login-username
Browse files Browse the repository at this point in the history
Add repository login component username validation
  • Loading branch information
AkihiroSuda committed Jul 14, 2024
2 parents d9d133c + f630815 commit d9a9a83
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 d9a9a83

Please sign in to comment.