]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] url: do not drop URLs with long userinfo
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 6 May 2026 17:25:25 +0000 (18:25 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 6 May 2026 17:28:09 +0000 (18:28 +0100)
commitf1c1c3063ea9fd1d5b8d3de5d7d01ac749bdedfc
treecd6b7b48d346e7429d3baf3e15f79ba4fea1d277
parentac41ee91a123387df7717f25a85afd98832dcb10
[Fix] url: do not drop URLs with long userinfo

The C parser consults lua_url_filter for every byte of userinfo past
max_email_user (64); the filter previously rejected anything longer
than 2048 bytes, which silently dropped the entire URL. That blanket
length REJECT killed exactly the userinfo-obfuscation phishing pattern
(https://legit.com<lots-of-spaces>@evil.com/...) the parser is meant
to surface.

Raise the catastrophic-length REJECT to 16 KiB (still well under the
parser's own G_MAXUINT16/2 cap) and have parse_user mark the URL as
RSPAMD_URL_FLAG_OBSCURED | RSPAMD_URL_FLAG_HAS_USER as soon as the
userinfo crosses 64 bytes, regardless of the filter verdict, so
downstream rules can act on the obfuscation signal.
lualib/lua_url_filter.lua
src/libserver/url.c
test/lua/unit/lua_url_filter.lua