{"record":{"id":"41e5f61a14351ffc","repo":"fatedier/frp","slug":"invalid-extra-payload","errorCode":null,"errorMessage":"invalid extra payload","messagePattern":"invalid extra payload","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/ssh/server.go","lineNumber":271,"sourceCode":"\t\tif addr != nil && extraPayload != \"\" {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn addr, extraPayload, nil\n}\n\nfunc (s *TunnelServer) parseClientAndProxyConfigurer(_ *tcpipForward, extraPayload string) (*v1.ClientCommonConfig, v1.ProxyConfigurer, string, error) {\n\thelpMessage := \"\"\n\tcmd := &cobra.Command{\n\t\tUse:   \"ssh v0@{address} [command]\",\n\t\tShort: \"ssh v0@{address} [command]\",\n\t\tRun:   func(*cobra.Command, []string) {},\n\t}\n\tcmd.SetGlobalNormalizationFunc(config.WordSepNormalizeFunc)\n\n\targs := strings.Split(extraPayload, \" \")\n\tif len(args) < 1 {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"invalid extra payload\")\n\t}\n\tproxyType := strings.TrimSpace(args[0])\n\tsupportTypes := []string{\"tcp\", \"http\", \"https\", \"tcpmux\", \"stcp\"}\n\tif !slices.Contains(supportTypes, proxyType) {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"invalid proxy type: %s, support types: %v\", proxyType, supportTypes)\n\t}\n\tpc := v1.NewProxyConfigurerByType(v1.ProxyType(proxyType))\n\tif pc == nil {\n\t\treturn nil, nil, helpMessage, fmt.Errorf(\"new proxy configurer error\")\n\t}\n\tconfig.RegisterProxyFlags(cmd, pc, config.WithSSHMode())\n\n\tclientCfg := v1.ClientCommonConfig{}\n\tconfig.RegisterClientCommonConfigFlags(cmd, &clientCfg, config.WithSSHMode())\n\n\tcmd.InitDefaultHelpCmd()\n\tif err := cmd.ParseFlags(args); err != nil {\n\t\tif errors.Is(err, flag.ErrHelp) {","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/ssh/server.go#L253-L289","documentation":"Emitted by parseClientAndProxyConfigurer when strings.Split(extraPayload, \" \") yields fewer than one element. Since strings.Split never returns an empty slice, this branch is effectively defensive dead code — even an empty payload produces [\"\"], which instead fails the proxy-type check. In practice you will see 'invalid proxy type' rather than this error.","triggerScenarios":"Only reachable if a future refactor makes the args slice empty (e.g. switching to a splitter that can return zero fields). With the current code, no client input reaches it.","commonSituations":"None in released code; appears only when reading the source or writing tests that call parseClientAndProxyConfigurer directly with crafted inputs.","solutions":["If you hit it in a test harness, pass a non-empty payload string such as \"tcp 127.0.0.1:22\".","If hit in production builds after local modification, review any changes to the args := strings.Split(...) line.","Treat any occurrence as a code smell: the guard is unreachable with strings.Split semantics."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Unreachable in current code — no runtime defense needed.","If testing parseClientAndProxyConfigurer directly, always pass a non-empty payload string."],"tags":["ssh","parsing","dead-code"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}