Medium Severity

Body: CSS zero-value calc() obfuscation

Description

Detects inbound messages containing HTML where a CSS calc() expression subtracts an identical value and unit from itself (e.g., calc(100px - 100px)), always resolving to zero. This pattern is commonly used to hide or collapse content from view while keeping it present in the underlying HTML, a technique often leveraged to evade text-based detection or conceal malicious content from recipients.

References

No references.

Sublime Security
Created Aug 5th, 2026 • Last updated Aug 5th, 2026
Source
type.inbound
and any(regex.iextract(body.html.raw,
                       'calc\(\s*(?P<n1>\d+(?:\.\d+)?)(?P<u1>px|vw|vh|em|rem|%)\s*-\s*(?P<n2>\d+(?:\.\d+)?)(?P<u2>px|vw|vh|em|rem|%)\s*\)'
        ),
        .named_groups["n1"] == .named_groups["n2"]
        and .named_groups["u1"] == .named_groups["u2"]
)
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