-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Illegal Base64URL string #21
Comments
That's this: https://x.com/alexseigler/status/1857127079705497882?t=lDqE2WGLCZavRrhX0qN5uQ&s=19 MSFT broke the API by adding an extra |
I just retested using the Yubico "PoC" scripts and I can successfully create, register and authenticate.
I will pass your Twitter post along. |
It will work if you don't already have any authenticators registered on the account. The issue is with the |
OK, I have passed it along. Note that my test user has multiple FIDO2 authenticators already however. |
Yes, it kind of depends. Not all of the credentials are broken. The ones that are 44 chars are fine, the ones that are 64 chars got padded with a extra 0 for some reason so they are now 65 chars which is illegal (len % 4 = 1 is never OK). I think the length might vary based on the YK firmware revision. The older ones seem shorter and the newer ones seem like they are 64 chars (base64url with no padding). That's the pattern I noticed. Thankfully I have a database with thousands of registered users and key data, which made the pattern pretty easy to spot. |
@aseigler Could you please send the bug report to fido-dev@microsoft.com ? There are additional confirmed issues, including this one:
|
Given that I haven't heard a peep from anyone on this I was thinking about this a little more and I looked at my data samples again. It seems that all Like this ReadOnlySpan<byte> input;
int paddingLength;
bool isFunky = BinaryPrimitives.TryReadInt32LittleEndian(input.Slice(input[^1], 1), out paddingLength);
if (!isFunky)
{
paddingLength = (input.Length % 4) switch
{
0 => 0, // Padding is not needed
2 => 2, // "==" missing in Base64Url vs. Base64
3 => 1, // "=" missing in Base64Url vs. Base64
_ => throw new ArgumentException("Illegal Base64URL string!", nameof(input))
};
} |
Either that...or somebody was trying to do something like: var b64 = "XDjx9wXDrVWBmE2MbPSkXdeMERfv6gN98uxavJ0ZrSyT8jYUs2BHKjAmh4P_T3Av";
int paddingChars = (b64.Length % 4); And intended to do: b64 = b64.PadRight(b64.Length + paddingChars, '='); Which would yield b64 = b64 + paddingChars; Which would yield
|
Hi Michael,
Having installed v.
1.0.3
(passkey module only) and running command:Register-Passkey -UserId 'username@domain.com' -DisplayName 'YubiKey 5C NFC'
Getting error:
ParentContainsErrorRecordException: Exception calling "Create" with "1" argument(s): "Illegal Base64URL string! (Parameter 'input')"
In readme.md you state:
Should I understand this as I might be missing a dependency or that it is incorporated already in the PS module?
Environment:
Thank you in advance,
The text was updated successfully, but these errors were encountered: