Skip to content

fix: IsBase64 validaton leads to "call stack size exceeded" for large strings (update validator package required) #2630

@andreasvh-conceto

Description

@andreasvh-conceto

Description

The validation for base64 results into stack overflow error if the size of the incoming string is greater than 3355436 bytes. This was fixed in the PR validatorjs/validator.js#2574 in validator dependency. The new upcoming validator release 13.15.19 is holding the fix. The version of the validator dependency should then be updated after Release PR has been merged and released.

See: validatorjs/validator.js#2573
PR in validator library: validatorjs/validator.js#2574

Minimal code-snippet showcasing the problem

export class FooDto {
@IsBase64()
someBase64: string // send here a string  base64 larger than the above mentioned byte size
}

Expected behavior

IsBase64 will succeed even for large base64

Actual behavior

isBase64() causes "RangeError: Maximum call stack size exceeded"
see: validatorjs/validator.js#2573

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions