• Sublime Core Feed
High Severity

Attachment: HTML smuggling - QR Code with suspicious links

Labels

Description

This rule detects messages with HTML attachments containing QR codes

References

No references.

Sublime Security
Created Nov 22nd, 2023 • Last updated Nov 27th, 2023
Feed Source
Sublime Core Feed
Source
GitHub
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
                beta.linkanalysis(.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 (
      any(distinct(headers.hops, .authentication_results.dmarc is not null),
          strings.ilike(.authentication_results.dmarc, "*fail")
      )
    )
  )
  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_false_positives
  )
)
and not profile.by_sender().any_false_positives

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.

Get Started