You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a prototype pollution in file lib/session.js, line 46. data[key]=params[key];
The code uses key as the index for the data object. If key is "proto", prototype pollution occurs.
To reproduce, see it('5.test read and write session ', function(done) {}. Since the key of v is supplied by users, attackers can change the key of variable v to be __proto__ to conduct attacks.
Suggestions:
To fix this vulnerability, it is recommended to blacklist prototype pollution payloads in key
set(params){
return new Promise( (resolve)=>{
let data= _sessionData[this.sessionId];
for(let key in params){
+ if (key === '__proto__' or key === 'constructor') {
+ continue;
+ }
data[key]=params[key];
}
resolve(data)
});
}
The text was updated successfully, but these errors were encountered:
There is a prototype pollution in file lib/session.js, line 46.
data[key]=params[key];
The code uses
key
as the index for the data object. Ifkey
is "proto", prototype pollution occurs.To reproduce, see
it('5.test read and write session ', function(done) {}
. Since the key ofv
is supplied by users, attackers can change the key of variablev
to be__proto__
to conduct attacks.Suggestions:
To fix this vulnerability, it is recommended to blacklist prototype pollution payloads in
key
The text was updated successfully, but these errors were encountered: