aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authortwesterhever <40121680+twesterhever@users.noreply.github.com>2022-11-06 14:41:55 +0000
committerGitHub <noreply@github.com>2022-11-06 14:41:55 +0000
commitac6d1a6566a4ecf3e4ff75c27047d1f9ef2f01d7 (patch)
treed556f6177039ce02f8ed6da23c8f2c74ed859235 /rules
parent9ac1a7513254f3ef4491c4199526cbece74e7934 (diff)
downloadrspamd-ac6d1a6566a4ecf3e4ff75c27047d1f9ef2f01d7.tar.gz
rspamd-ac6d1a6566a4ecf3e4ff75c27047d1f9ef2f01d7.zip
[Minor] Implement multibase prefixes for IPFS gateway URL rule
Diffstat (limited to 'rules')
-rw-r--r--rules/regexp/misc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/regexp/misc.lua b/rules/regexp/misc.lua
index 47b8f74a9..940a9187e 100644
--- a/rules/regexp/misc.lua
+++ b/rules/regexp/misc.lua
@@ -105,8 +105,8 @@ rspamd_config:register_dependency('LEAKED_PASSWORD_SCAM', 'BITCOIN_ADDR')
-- These contain "ipfs" somewhere (either in the FQDN or the URL path) and a
-- content identifier (CID), comprising of either "qm", followed by 46 alphanumerical
-- characters (CIDv0), or a CIDv1 of an alphanumerical string of unspecified length,
--- depending on the hash algorithm used.
-local ipfs_cid = '/(qm[a-z0-9]{44}|[a-z0-9]{45,256})/{url}i'
+-- depending on the hash algorithm used, but starting with a multibase prefix.
+local ipfs_cid = '/(qm[a-z0-9]{44}|[079fFvVtTbBcChkKzZmMuUP][a-z0-9]{45,256})/{url}i'
local ipfs_string = '/ipfs(\\.|-|_|\\/|\\?)/{url}i'
reconf['HAS_IPFS_GATEWAY_URL'] = {
description = 'Message contains InterPlanetary File System (IPFS) gateway URL, likely malicious',