{"record":{"id":"ac891fe367d2b9ca","repo":"projectdiscovery/nuclei","slug":"invalid-uncompressed-ecdsa-public-key","errorCode":null,"errorMessage":"invalid uncompressed ecdsa public key","messagePattern":"invalid uncompressed ecdsa public key","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/templates/signer/tmpl_signer.go","lineNumber":93,"sourceCode":"\nfunc (t *TemplateSigner) userFragment() (string, error) {\n\t// wrap with sync.Once to reduce unnecessary md5 hashing\n\tt.Do(func() {\n\t\tt.fragment, t.fragmentErr = publicKeyFragment(t.handler.ecdsaPubKey)\n\t})\n\treturn t.fragment, t.fragmentErr\n}\n\nfunc publicKeyFragment(publicKey *ecdsa.PublicKey) (string, error) {\n\tif publicKey == nil {\n\t\treturn \"\", nil\n\t}\n\tpublicKeyBytes, err := publicKey.Bytes()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"encode ecdsa public key: %w\", err)\n\t}\n\tif len(publicKeyBytes) < 3 || publicKeyBytes[0] != 4 || (len(publicKeyBytes)-1)%2 != 0 {\n\t\treturn \"\", fmt.Errorf(\"invalid uncompressed ecdsa public key\")\n\t}\n\txCoordinateLength := (len(publicKeyBytes) - 1) / 2\n\t// Keep the old fragment stable: big.Int.Bytes omitted leading zero bytes.\n\txCoordinateBytes := bytes.TrimLeft(publicKeyBytes[1:1+xCoordinateLength], \"\\x00\")\n\thashed := md5.Sum(xCoordinateBytes)\n\treturn fmt.Sprintf(\"%x\", hashed), nil\n}\n\n// Sign signs the given template with the template signer and returns the signature\nfunc (t *TemplateSigner) Sign(data []byte, tmpl SignableTemplate) (string, error) {\n\texistingSignature, content := ExtractSignatureAndContent(data)\n\tcontent = normalizeTemplateContentForSignature(content)\n\n\t// Executable templates can only be re-signed by the current signer.\n\thasJavascript := false\n\tif javascriptTemplate, ok := tmpl.(javascriptSignableTemplate); ok {\n\t\thasJavascript = javascriptTemplate.HasJavascriptRequest()\n\t}","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/templates/signer/tmpl_signer.go#L75-L111","documentation":"Error \"invalid uncompressed ecdsa public key\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/templates/signer/tmpl_signer.go:93 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"}