{"record":{"id":"fdc03d26b40a1b4a","repo":"projectdiscovery/nuclei","slug":"unc-path-requires-host-share-q","errorCode":null,"errorMessage":"UNC path requires \\\\\\\\host\\\\share: %q","messagePattern":"UNC path requires \\\\\\\\\\\\\\\\host\\\\\\\\share: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/file/smb_path.go","lineNumber":114,"sourceCode":"\t\tPath:     rel,\n\t\tUser:     user,\n\t\tPassword: pass,\n\t\tDomain:   domain,\n\t}, nil\n}\n\nfunc parseUNC(raw string) (*SMBTarget, error) {\n\ts := strings.ReplaceAll(raw, `\\`, `/`)\n\ts = strings.TrimPrefix(s, \"//\")\n\tparts := strings.Split(s, \"/\")\n\tcleaned := make([]string, 0, len(parts))\n\tfor _, p := range parts {\n\t\tif p != \"\" {\n\t\t\tcleaned = append(cleaned, p)\n\t\t}\n\t}\n\tif len(cleaned) < 2 {\n\t\treturn nil, fmt.Errorf(\"UNC path requires \\\\\\\\host\\\\share: %q\", raw)\n\t}\n\thost := cleaned[0]\n\tshare := cleaned[1]\n\trel := \".\"\n\tif len(cleaned) > 2 {\n\t\trel = strings.Join(cleaned[2:], \"/\")\n\t}\n\tif err := smbsession.RequireShareName(share); err != nil {\n\t\treturn nil, err\n\t}\n\tnormalized, err := smbsession.NormalizeSharePath(rel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &SMBTarget{Host: host, Port: 445, Share: share, Path: normalized}, nil\n}\n\nfunc splitSharePath(urlPath string) (share, rel string, err error) {","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/file/smb_path.go#L96-L132","documentation":"Error \"UNC path requires \\\\\\\\host\\\\share: %q\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/file/smb_path.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}