aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_magic/patterns.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-11 16:31:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-11 16:31:30 +0100
commitb56b5fc2248f1c0ff6d57033935df97e7441f30e (patch)
treec30986b7907d24c6e232ce8367ef84199b699b61 /lualib/lua_magic/patterns.lua
parentd4f4efdef40b07b452ef12b33cf192be51e0ef4f (diff)
downloadrspamd-b56b5fc2248f1c0ff6d57033935df97e7441f30e.tar.gz
rspamd-b56b5fc2248f1c0ff6d57033935df97e7441f30e.zip
[Minor] Improve pdf magic detection
Diffstat (limited to 'lualib/lua_magic/patterns.lua')
-rw-r--r--lualib/lua_magic/patterns.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua
index c1ea89659..87583c9de 100644
--- a/lualib/lua_magic/patterns.lua
+++ b/lualib/lua_magic/patterns.lua
@@ -27,18 +27,21 @@ local patterns = {
matches = {
{
string = [[^%PDF-\d]],
- position = 6, -- must be end of the match, as that's how hyperscan works (or use relative_position)
+ position = {'<=', 1024},
weight = 60,
+ heuristic = heuristics.pdf_format_heuristic
},
{
string = [[^\012%PDF-\d]],
- position = 7,
+ position = {'<=', 1024},
weight = 60,
+ heuristic = heuristics.pdf_format_heuristic
},
{
string = [[^%FDF-\d]],
- position = 6,
+ position = {'<=', 1024},
weight = 60,
+ heuristic = heuristics.pdf_format_heuristic
},
},
},