From a071a73e6dca70d8f422c03b65a6cbb6e36f75d0 Mon Sep 17 00:00:00 2001 From: lhonRafaat Date: Thu, 28 Nov 2024 17:46:02 +0300 Subject: [PATCH] fix(common): enforce string type in validationpipe strictly parse the value to string to avoid nested objects being passed if the type is explicitly set to string closes #14234 --- packages/common/pipes/validation.pipe.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/common/pipes/validation.pipe.ts b/packages/common/pipes/validation.pipe.ts index 6163ea0d4d5..11de63be218 100644 --- a/packages/common/pipes/validation.pipe.ts +++ b/packages/common/pipes/validation.pipe.ts @@ -206,6 +206,9 @@ export class ValidationPipe implements PipeTransform { if (metatype === Number) { return +value; } + if (metatype === String) { + return String(value); + } return value; }