Skip to content

No nonce signature parameter fails validation #105

Description

@mariusor

Hello, I'm having issues with validation of requests that don't contain "nonces", which fail with the message of "nonce already seen".

This happens for the cases where there is no "nonce" in the signature parameters, not when the nonce is actually empty.

Because in the calling code I can't know if the nonce is present in the signature-input header (unless I implement my own unmarshaling for it) to be able to skip passing a nonce checker to the verifier, shouldn't only call the validation when noncePresent == true?

httpsig/verifier.go

Lines 295 to 302 in 3704855

nonceValue, noncePresent := params.Params.Get(string(Nonce))
if noncePresent {
nonce = nonceValue.(string) //nolint: forcetypeassert
}
if err := nc.CheckNonce(msg.Context, nonce); err != nil {
return fmt.Errorf("%w: nonce validation failed: %w", ErrParameter, err)
}

So, I guess my question is: should I handle the case for no "nonce" signature parameter in the calling code, or do you consider this to be an actual bug?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions