Skip to content

Webauthn\CollectedClientData::createFormJson not working #510

@hulvat

Description

@hulvat

Version(s) affected

4.7

Description

Hi
I got error could not load data when a called method

$publicKeyCredentialLoader->load($data);

I found that this method

createFormJson in Webauthn\CollectedClientData call this code on line 91
$rawData = Base64UrlSafe::decodeNoPadding($data);

but when i changed to
$rawData = base64_decode($data);

everythings work ok.

How to reproduce

just send this base 64 encoded string to method createFormJson and it will throw error

eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiWVdFIiwib3JpZ2luIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ==

despite the fact, that this string is valid base64 encoded string

Possible Solution

change
$rawData = Base64UrlSafe::decodeNoPadding($data);
to
$rawData = base64_decode($data);

Additional Context

No response

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions