Skip to content

Most denormalisers do not validate input #779

@driskell

Description

@driskell

Version(s) affected

5.2.2

Description

Most of the denormalisers do not correctly validate the incoming data.

As such, it's very easy to trigger a TypeError crash or similar by passing in invalid data.
The only way to avoid it is to perform manual validation, which leaks elements of the denormalisation process into the caller.

For example attempting to denormalise a PublicKeyCredential from an empty array or one without a rawId will crash with a TypeError

Although this won't occur during normal operation, it can be abused to cause a Denial of Service or excessive logging and alerts

How to reproduce

deserialize('[]', PublicKeyCredentialSource::class, 'json')

Possible Solution

Check keys exist and coerce to necessary types inside denormalisers

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions