Onbekend COSE-algoritme aangetroffen. alg: -257

AI-generated summary

A user reports an issue with 2FA login using a hardware security key on Windows 10, where the system displays an error: “The algorithm used for the security key is not recognized.” Server logs show “Unknown COSE algorithm encountered. alg: -257.” SystemZ suspects the issue stems from a missing algorithm implementation in the cose-ruby library, which only supports a limited set of algorithms. dan confirms that algorithm -257 corresponds to RS256, which is not implemented and not recommended. The team discusses potential causes, including the security key model and browser version, and references related issues and documentation, such as cose-ruby’s algorithm list and cose-ruby issue #48.

Hi,

One of my users can’t login with 2FA using hardware key.

After pressing button on key during login, Windows 10 is asking for a PIN.
After entering PIN he is receiving error “The algorithm used for the security key is not recognized.”. I checked, it’s i18n key webauthn.validation.unknown_cose_algorithm_error.

Server logs this as an error:

Unknown COSE algorithm encountered. alg: -257. user_id: <redacted>. params: <ActionController::Parameters {"signature"=>"<redacted>", "clientData"=>"<redacted>", "authenticatorData"=>"<redacted>", "credentialId"=>"<redacted>"} permitted: false>

Quick google search only found this:
https://review.discourse.org/t/fix-catch-error-when-unknown-cose-algorithm-is-supplied-for-security-key-8649/8074

So probably it need to be implemented but strangely somehow user managed to set it on account?
Not sure if I can fix it from forum’s admin side without code change.

I’m using recommended, standalone Docker install with version 2.7.0.beta3. I rebuilt forum and updated it less than 1h before creating this thread.

That’s strange. Can they login with 2FA and this hardware key on other webapps? Any ideas @dan?

Can you share the security key model and browser version?

Will be interesting to see which algorithm is missing from:

I am guessing this one: Support EdDSA · Issue #48 · cedarcode/cose-ruby · GitHub EdDSA.

If we have the model and OS of the dev.

Maybe it is this thing? https://blockchain2fa.io/

I guess you can use blockchains for anything.

This is a limitation of cose-ruby library we use as @sam pointed out. It supports only these algorithms:

According to the error message, that security key is using algorithm “-257” which stands for RS256 and is not recommended. That is probably the reason why the library does not implement it.

What device are you trying to use for authentication?