commit f09b8e5: [Minor] Avoid FP when a protocol prefix is implicitly added

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Apr 15 20:28:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-04-15 21:23:43 +0100
URL: https://github.com/rspamd/rspamd/commit/f09b8e5be2aa8ad1593bcb0e7438af6b6d5a1305 (HEAD -> master)

[Minor] Avoid FP when a protocol prefix is implicitly added

---
 src/libserver/html.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libserver/html.c b/src/libserver/html.c
index 5e29b3b84..137907183 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -837,8 +837,8 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool,
 			 */
 			gboolean obfuscation_found = FALSE;
 
-			if (g_ascii_strncasecmp (url_str, "http", 4) == 0 &&
-				strstr (url_str, "://") != NULL) {
+			if (len > 4 && g_ascii_strncasecmp (url_text, "http", 4) == 0 &&
+				rspamd_substring_search (url_text, len,"://", 3) != -1) {
 				/* Clearly an obfuscation attempt */
 				obfuscation_found = TRUE;
 			}


More information about the Commits mailing list