Skip to content

Commit e434d43

Browse files
committed
prototype injection
1 parent 7be34c3 commit e434d43

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/management/identities/validations/identities.validation.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export class IdentitiesValidationService implements OnApplicationBootstrap {
106106
}
107107
private async createAttributes(key:string,data:any){
108108

109+
// Validate the key to prevent prototype pollution
110+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
111+
this.logger.error('Invalid key: ' + key);
112+
throw new BadRequestException('Invalid key: ' + key);
113+
}
109114
const path = this.resolveConfigPath(key);
110115
if (path === null){
111116
this.logger.error('schema for ' + key + ' does not exist');

0 commit comments

Comments
 (0)