smallstep / certificates

🛡️ A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH.
https://smallstep.com/certificates
Apache License 2.0
6.35k stars 415 forks source link

[Bug]: Device attestation validation returns 500 for invalid CBOR payload #1902

Open basovnik opened 1 week ago

basovnik commented 1 week ago

Steps to Reproduce

Your Environment

Expected Behavior

The server should return a client error -> status 400.

Actual Behavior

The server returns internal error -> status 500.

Unexpected error: error validating challenge: error unmarshalling CBOR: EOF Log message:

ERRO[6548] duration=33.057877ms duration-ns=33057877 error="error validating challenge: error unmarshalling CBOR: EOF" fields.time="2024-06-26T11:16:32+02:00" method=POST name=ca nonce=eHpuMGRaMlpMa3BoU0JUcDJwWnZSeVprRE44QmJ3Y1c path=/acme/acme/challenge/6zzEABv1oqdHExiAETjjR0RHVnD4hwVP/P9STwds3QRTt5CQhMCjU3ij4Uxs5cN6W protocol=HTTP/1.1 referer= remote-address=127.0.0.1 request-id=2dfcf8a3-c285-4fd0-80d5-9efc05688c82 response="{\"type\":\"urn:ietf:params:acme:error:serverInternal\",\"detail\":\"The server experienced an internal error\"}" size=105 status=500 user-agent="Apache-HttpClient/4.5.13 (Java/17.0.4)" user-id=

Additional Context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).