issue 436: fix regular expression for base64 validation

This commit is contained in:
Kay Zumbusch 2022-11-17 20:00:10 +01:00
parent e17123cf2f
commit b2b4338b15

View file

@ -881,7 +881,7 @@ class POP3Connection extends EventEmitter {
}
authPlain(plain, next) {
if (!/^[a-zA-Z0-9+/]+=+?$/.test(plain)) {
if (!/^(?:[a-zA-Z0-9+/]{4})*(?:(?:[a-zA-Z0-9+/]{3}=)|(?:[a-zA-Z0-9+/]{2}==))?$/.test(plain)) {
this.send('-ERR malformed command');
return next();
}