]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] lua_url: Re-encode control characters and spaces in URL tostring
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 6 Feb 2026 15:11:44 +0000 (15:11 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 6 Feb 2026 15:11:44 +0000 (15:11 +0000)
commit9f3a41069512c9c2287c99c9917350ff2da6ee24
treebc0f8f23d703b3dce6ab467a14fc735a94fdc519
parent16e3dbe5bbdcfa96c1e7d822d4bcdead7967a848
[Fix] lua_url: Re-encode control characters and spaces in URL tostring

The URL parser (rspamd_url_decode) decodes percent-encoded sequences
like %20 back to literal characters in the internal representation.
When tostring() returned these decoded URLs, spaces and control chars
would break subsequent re-parsing (e.g., in url_redirector redirect
chains and Redis cache round-trips). Fix by re-encoding characters
<= 0x20 on serialization, matching browser behavior: decode internally
for matching, re-encode on copy.
src/lua/lua_url.c