You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CoseKey overloads of VerifyAsync do not always agree with (synchronous) Verify #130922
The sync and async versions of the CoseSign1Message and CoseSignature Verify method groups accepting CoseKey do not apply the same validation to the alg header.
Specifically, the synchronous version validates that the presented key matches the alg header, and the asynchronous version skips that check.
This means that a COSE_Sign1 which incorrectly writes a PS512 header when the signature was applied with Pkcs1 padding with SHA-2-256 will fail to verify with the synchronous method, but succeed with the asynchronous one.
The async overloads taking CoseKey don't look at the alg header at all, accepting documents that don't even provide it.
I'd say the RFC strongly implies that the alg header should be written down, but it doesn't actually explicitly say it... but what's most important is that the sync and async versions should agree.
Activity
dotnet-policy-service commentedon Jul 16, 2026
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.
bartonjs commentedon Jul 16, 2026
The async overloads taking CoseKey don't look at the alg header at all, accepting documents that don't even provide it.
I'd say the RFC strongly implies that the alg header should be written down, but it doesn't actually explicitly say it... but what's most important is that the sync and async versions should agree.