commit bce6f96: [Minor] Fix PDF_JAVASCRIPT rule

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jan 21 09:28:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-01-21 09:27:13 +0000
URL: https://github.com/rspamd/rspamd/commit/bce6f96e75160fd11ce19cad3570786ad76a8e52 (HEAD -> master)

[Minor] Fix PDF_JAVASCRIPT rule

---
 rules/content.lua | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/rules/content.lua b/rules/content.lua
index 718fd22c1..fb7a0ad58 100644
--- a/rules/content.lua
+++ b/rules/content.lua
@@ -24,12 +24,9 @@ local function process_pdf_specific(task, part, specific)
     end
   end
 
-  if specific.javascript then
+  if specific.openaction and #specific.openaction > 10 then
     task:insert_result('PDF_JAVASCRIPT', 1.0, part:get_filename())
-    suspicious_factor = suspicious_factor + 0.1
-    if specific.openaction then
-      suspicious_factor = suspicious_factor + 0.5
-    end
+    suspicious_factor = suspicious_factor + 0.5
   end
 
   if specific.suspicious then


More information about the Commits mailing list