• Sublime Core Feed

Description

This rule detects messages with HTML attachments containing QR codes

References

No references.

Sublime Security
Created Nov 22nd, 2023 • Last updated Jan 12th, 2026
Source
type.inbound
and 1 <= length(attachments) < 3

// inspects HTML attachments for QR codes
and any(attachments,
        (
          .file_extension in~ ("html", "htm", "shtml", "dhtml", "xhtml")
          or (
            .file_extension is null
            and .file_type == "unknown"
            and .content_type == "application/octet-stream"
          )
          or .file_extension in~ $file_extensions_common_archives
          or .file_type == "html"
          or .content_type == "text/html"
        )
        and any(file.explode(file.html_screenshot(.)),
                // any URL
                ml.link_analysis(.scan.qr.url).submitted
                // currently we won't pick it up as a URL if it's
                // not prefaced with a scheme. this is not very strong,
                // but it's unlikely to cause FPs for this rule
                or regex.contains(.scan.qr.data, '\.')
        )
)

// negate highly trusted sender domains unless they fail DMARC authentication
and (
  (
    sender.email.domain.root_domain in $high_trust_sender_root_domains
    and not headers.auth_summary.dmarc.pass
  )
  or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
and (
  not profile.by_sender().solicited
  or (
    profile.by_sender().any_messages_malicious_or_spam
    and not profile.by_sender().any_messages_benign
  )
)
and not profile.by_sender().any_messages_benign
MQL Rule Console
DocsLearning Labs

Playground

Test against your own EMLs or sample data.

Share

Post about this on your socials.

Get Started. Today.

Managed or self-managed. No MX changes.

Deploy and integrate a free Sublime instance in minutes.
Get Started