From b2b4338b15f8acf79ee107aad210c6a6de549861 Mon Sep 17 00:00:00 2001 From: Kay Zumbusch Date: Thu, 17 Nov 2022 20:00:10 +0100 Subject: [PATCH] issue 436: fix regular expression for base64 validation --- lib/pop3/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pop3/connection.js b/lib/pop3/connection.js index 1ee4f972..29bec579 100644 --- a/lib/pop3/connection.js +++ b/lib/pop3/connection.js @@ -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(); }