{"record":{"id":"b8d2466bf8c625b9","repo":"kovidgoyal/kitty","slug":"specified-password-is-too-long-b8d246","errorCode":null,"errorMessage":"Specified password is too long","messagePattern":"Specified password is too long","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/cmd/at/main.go","lineNumber":367,"sourceCode":"\t\t\t} else {\n\t\t\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t\t\terr = nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\tif !ans.is_set && password_env != \"\" {\n\t\tans.val, ans.is_set = os.LookupEnv(password_env)\n\t}\n\tif !ans.is_set && use_password == \"always\" {\n\t\tans.is_set = true\n\t\treturn ans, nil\n\t}\n\tif len(ans.val) > 1024 {\n\t\treturn ans, fmt.Errorf(\"Specified password is too long\")\n\t}\n\treturn ans, nil\n}\n\nvar all_commands []func(*cli.Command) *cli.Command = make([]func(*cli.Command) *cli.Command, 0, 64)\n\nfunc register_at_cmd(f func(*cli.Command) *cli.Command) {\n\tall_commands = append(all_commands, f)\n}\n\nfunc setup_global_options(cmd *cli.Command) (err error) {\n\tif global_options.already_setup {\n\t\treturn nil\n\t}\n\terr = cmd.GetOptionValues(&rc_global_opts)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cmd/at/main.go#L349-L385","documentation":"The password supplied to kitty @ (via --password, KITTY_PASSWORD, or the password prompt) exceeds 1024 bytes. kitty's remote-control encryption encrypts the password with the negotiated key and refuses oversized values.","triggerScenarios":"get_password checks len(ans.val) > 1024 after assembling the password from flag/env/prompt and fails for longer values.","commonSituations":"Accidentally passing a file path's contents, a key from a password manager with metadata, a pasted multi-line blob, or a shell expansion gone wrong as the password.","solutions":["Use a password shorter than 1024 bytes","Check that you didn't accidentally pass a filename expecting it to be read, or a shell variable with extra content","If you need stronger auth, use a long random string under the limit or the socket-based auth instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(password) > 1024 { return errors.New(\"password too long\") }","typeGuard":"func validRCPassword(p string) bool { return len(p) <= 1024 && p != \"\" }","tryCatchPattern":null,"preventionTips":["Use a concise random passphrase","Verify you're passing the password value, not a file's contents"],"tags":["kitty","remote-control","password","validation"],"backgroundTag":"password-too-long","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}