commit 34104c5ef5c63e42f2954af5a5e34b43927cb286
parent c3f3ebff6e4cba698f4bebff65c4b9b721ba1d16
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 29 Jul 2026 13:08:36 +0200
email: anchor the address validation regex
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/authorization/anastasis_authorization_plugin_email.c b/src/authorization/anastasis_authorization_plugin_email.c
@@ -588,7 +588,8 @@ libanastasis_plugin_authorization_email_init (void *cls)
}
{
int regex_result;
- const char *regexp = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}";
+ /* anchored so the whole address must match, not merely contain a match */
+ const char *regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
regex_result = regcomp (&ctx->regex,
regexp,