Medium Severity

Attachment: HTML smuggling with dynamically constructed redirect URL

Description

Detects HTML attachments, including those nested inside forwarded EML files, that contain obfuscated JavaScript designed to dynamically assemble a redirect URL at runtime rather than embedding it directly in the markup. The script typically builds an empty route via route.join, sets an image or iframe src from a url/protocol variable, and defines a host string separately, a pattern used to evade static URL scanning before sending the recipient to a credential phishing page.

References

No references.

Sublime Security
Created Sep 29th, 2026 • Last updated Sep 29th, 2026
Source
type.inbound
and any(attachments,
        (
          .file_type == "html"
          and 2 of (
            regex.icontains(file.parse_html(.).raw,
                            'route\.join\(\s*["'']{2}\s*\)'
            ),
            regex.icontains(file.parse_html(.).raw,
                            '\.src\s*=\s*(?:url|protocol)'
            ),
            regex.icontains(file.parse_html(.).raw, 'const\s+host\s*=\s*["'']')
          )
        )
        or (
          (.file_extension == "eml" or .content_type == "message/rfc822")
          and any(file.parse_eml(.).attachments,
                  .file_type == "html"
                  and 2 of (
                    regex.icontains(file.parse_html(.).raw,
                                    'route\.join\(\s*["'']{2}\s*\)'
                    ),
                    regex.icontains(file.parse_html(.).raw,
                                    '\.src\s*=\s*(?:url|protocol)'
                    ),
                    regex.icontains(file.parse_html(.).raw,
                                    'const\s+host\s*=\s*["'']'
                    )
                  )
          )
        )
)
MQL Rule Console
•Docs•Learning 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