projectdiscovery/nuclei · error
invalid uncompressed ecdsa public key
Error message
invalid uncompressed ecdsa public key
What it means
Error "invalid uncompressed ecdsa public key" thrown in projectdiscovery/nuclei.
Source
Thrown at pkg/templates/signer/tmpl_signer.go:93
func (t *TemplateSigner) userFragment() (string, error) {
// wrap with sync.Once to reduce unnecessary md5 hashing
t.Do(func() {
t.fragment, t.fragmentErr = publicKeyFragment(t.handler.ecdsaPubKey)
})
return t.fragment, t.fragmentErr
}
func publicKeyFragment(publicKey *ecdsa.PublicKey) (string, error) {
if publicKey == nil {
return "", nil
}
publicKeyBytes, err := publicKey.Bytes()
if err != nil {
return "", fmt.Errorf("encode ecdsa public key: %w", err)
}
if len(publicKeyBytes) < 3 || publicKeyBytes[0] != 4 || (len(publicKeyBytes)-1)%2 != 0 {
return "", fmt.Errorf("invalid uncompressed ecdsa public key")
}
xCoordinateLength := (len(publicKeyBytes) - 1) / 2
// Keep the old fragment stable: big.Int.Bytes omitted leading zero bytes.
xCoordinateBytes := bytes.TrimLeft(publicKeyBytes[1:1+xCoordinateLength], "\x00")
hashed := md5.Sum(xCoordinateBytes)
return fmt.Sprintf("%x", hashed), nil
}
// Sign signs the given template with the template signer and returns the signature
func (t *TemplateSigner) Sign(data []byte, tmpl SignableTemplate) (string, error) {
existingSignature, content := ExtractSignatureAndContent(data)
content = normalizeTemplateContentForSignature(content)
// Executable templates can only be re-signed by the current signer.
hasJavascript := false
if javascriptTemplate, ok := tmpl.(javascriptSignableTemplate); ok {
hasJavascript = javascriptTemplate.HasJavascriptRequest()
}View on GitHub (pinned to 265b3a3dec)
When it happens
Trigger: Thrown at pkg/templates/signer/tmpl_signer.go:93 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of projectdiscovery/nuclei@265b3a3dec (2026-08-15).
Data as JSON: /api/errors/ac891fe367d2b9ca.
Report an issue: GitHub.