mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
sec: Fix prototype pollution in webaccess module
This commit is contained in:
parent
4ff00e278a
commit
852f282b03
1 changed files with 4 additions and 0 deletions
|
@ -177,6 +177,10 @@ const checkAccess = async (req:any, res:any, next: Function) => {
|
|||
res.status(401).send('Authentication Required');
|
||||
return;
|
||||
}
|
||||
if (ctx.username === '__proto__' || ctx.username === 'constructor' || ctx.username === 'prototype') {
|
||||
res.end(403);
|
||||
return;
|
||||
}
|
||||
settings.users[ctx.username].username = ctx.username;
|
||||
// Make a shallow copy so that the password property can be deleted (to prevent it from
|
||||
// appearing in logs or in the database) without breaking future authentication attempts.
|
||||
|
|
Loading…
Reference in a new issue