summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-26 13:12:35 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-26 13:12:35 +0100
commitb0061a0452e691c43fba6abbc4f5ea1bac21d1ea (patch)
tree7b63287358e3243046d23b6be818058304973d20 /src/libserver
parent7020903cc23c78ce8d6aa8312dc414c969e4b766 (diff)
downloadrspamd-b0061a0452e691c43fba6abbc4f5ea1bac21d1ea.tar.gz
rspamd-b0061a0452e691c43fba6abbc4f5ea1bac21d1ea.zip
[Fix] Treat unnormalised URLs as obscured
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/html.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c
index b27e07fad..ec81cc06a 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -1634,6 +1634,10 @@ rspamd_process_html_url (rspamd_mempool_t *pool, struct rspamd_url *url,
gchar *url_str;
gint rc;
+ if (url->flags & RSPAMD_URL_FLAG_UNNORMALISED) {
+ url->flags |= RSPAMD_URL_FLAG_OBSCURED;
+ }
+
if (url->querylen > 0) {
if (rspamd_url_find (pool, url->query, url->querylen, &url_str, TRUE,
@@ -1658,6 +1662,18 @@ rspamd_process_html_url (rspamd_mempool_t *pool, struct rspamd_url *url,
target_tbl = tbl_urls;
}
+ if (query_url->flags
+ & (RSPAMD_URL_FLAG_UNNORMALISED|RSPAMD_URL_FLAG_OBSCURED|
+ RSPAMD_URL_FLAG_NUMERIC)) {
+ /* Set obscured flag if query url is bad */
+ url->flags |= RSPAMD_URL_FLAG_OBSCURED;
+ }
+
+ /* And vice-versa */
+ if (url->flags & RSPAMD_URL_FLAG_OBSCURED) {
+ query_url->flags |= RSPAMD_URL_FLAG_OBSCURED;
+ }
+
if ((existing = g_hash_table_lookup (target_tbl,
query_url)) == NULL) {
g_hash_table_insert (target_tbl,