A Chrome extension to detect hidden text in email
Email X-Ray is a security-focused Chrome extension that helps you detect sophisticated phishing tactics used by attackers to hide malicious content in emails. It scans emails in real-time and highlights suspicious elements that might otherwise go unnoticed.
It can detect many of the latest phishing tactics that try to deceive users through visual manipulation and technical trickery. The extension examines the email's HTML and CSS to find content that's hidden from view, links that don't go where they claim, and other suspicious patterns commonly used in phishing attacks.
Hidden content detection looks for text that's been made invisible through CSS manipulation. This includes setting font sizes to zero, making text completely transparent, positioning it thousands of pixels off-screen, or using CSS filters and blend modes to render it invisible. The scanner also catches color camouflage where text is the same color as the background, and detects when clip-path masking is used to hide portions of content.
Tracking and surveillance techniques are identified by scanning for tiny 1x1 pixel images, SVG elements with zero dimensions, and CSS background images on hidden elements. Modern phishing emails often use SVG-based tracking with remote image references that phone home when the email is opened.
Link analysis examines every URL in the email, checking for data URLs that can hide malicious content, JavaScript URLs that execute code, and mismatches between what a link displays and where it actually points. The extension analyzes domain names for excessive dashes, long random number sequences, suspicious top-level domains like .top or .xyz, and brand impersonation patterns where a legitimate company name appears in a fraudulent domain.
Unicode-based attacks are caught by detecting confusable charactersβlookalike letters from different alphabets like Cyrillic or Greek. For example, a Cyrillic 'Π°' (U+0430) looks identical to Latin 'a' (U+0061) but is a different character, allowing attackers to create domains like "pΠ°ypal.com" that appear legitimate. The scanner checks for punycode domains and uses Unicode normalization to catch sophisticated substitution attacks. It also finds zero-width invisible characters that can be used to hide tracking codes or manipulate displayed text.
Email header analysis examines the reply-to address and compares it against the sender. Phishing emails often spoof a legitimate sender but set replies to go to a different address, or claim to be from a corporate domain while directing replies to a free Gmail or Yahoo account.
Attachment inspection flags files with dangerous extensions like .exe or .scr, double-extension tricks like "invoice.pdf.exe", and gibberish filenames with no vowels or all caps with numbers. It also notes when attachments use common phishing keywords like "invoice", "urgent", or "verify".
Additional patterns include detecting invisible iframes that could harvest credentials, finding fake unsubscribe mechanisms that use JavaScript or suspicious domains, and identifying suspicious image metadata like extremely long alt text on hidden images.
1. Hidden Text Detection
Scans for CSS-based text hiding techniques:
- Font size manipulation (0px, <1px)
- Opacity levels (0 or near-transparent <0.1)
- CSS visibility/display properties (
display: none,visibility: hidden) - CSS filters (
brightness(0%),blur()) - Mix-blend-mode concealment
- Color camouflage (text color matches background within 40 RGB difference)
- Off-screen positioning (
text-indent < -100px, absolute/fixed positioning) - Clip-path masking
Identifies tracking mechanisms:
- Traditional 1x1 or 2x2 pixel images
- SVG elements with zero dimensions but active viewBox
- Remote SVG
<image>references to tracking servers - CSS background-image on hidden elements (width/height β€2px, display:none, opacity:0)
Examines URLs for phishing indicators:
- Data URLs (
data:) that can hide malicious content - JavaScript URLs (
javascript:) for XSS attempts - URL/text mismatches (displayed URL differs from href)
- Punycode domains (
xn--) for IDN homograph attacks - Excessive dashes (
---) in domains - Long numeric sequences (6+ digits, likely auto-generated)
- Suspicious TLDs (.top, .xyz, .click, .link, .tk, .ml, etc.)
- Excessive subdomain depth (>5 levels)
- Brand impersonation (brand name in wrong position)
- @ symbol obfuscation in URLs
Detects Unicode character substitution:
- Confusable character mapping (Cyrillic, Greek lookalikes)
- NFKC Unicode normalization for sophisticated attacks
- Tracks 12 confusable character sets (a/Π°, e/Π΅, o/ΠΎ, etc.)
Finds hidden credential harvesting:
- Hidden iframes (
display: none,visibility: hidden,opacity: 0) - Tiny iframes (<10x10 pixels)
Scans for invisible Unicode characters:
- Zero-width space (U+200B)
- Zero-width non-joiner (U+200C)
- Zero-width joiner (U+200D)
- Zero-width no-break space (U+FEFF)
- Word joiner (U+2060)
- And 6 other invisible Unicode variants
Examines image metadata:
- Long alt text (>200 chars) on hidden/tiny images
- Zero-width characters in alt attributes
Identifies malicious file downloads:
- Dangerous extensions (.exe, .scr, .bat, .cmd, .vbs, .js, .jar, .apk, .msi)
- Double extension tricks (file.pdf.exe)
- Gibberish filenames (no vowels, all caps with numbers)
- Common phishing names (invoice, urgent, verify, payment, etc.)
- External hosting (not on Gmail/Yahoo servers)
Detects fake unsubscribe mechanisms:
- JavaScript unsubscribe links
- Data URL unsubscribe forms
- Suspicious TLDs in unsubscribe links
- Embedded forms in email body (legitimate emails use links)
Identifies email header manipulation:
- Domain mismatch (FROM vs REPLY-TO)
- No-reply sender but replies enabled
- Corporate sender with free email reply-to (Gmail/Yahoo/Outlook)
Advanced hiding methods:
- Backdrop-filter detection
- Complex filter chains
- Blend mode analysis
Scan Trigger: Click extension icon or use keyboard shortcut (Cmd/Ctrl+Shift+X)
JSON export with structured findings data including element tags, classes, and threat details
100% local processing - no network requests
No data collection or external API calls
Minimal permissions (activeTab, storage)
Host permissions limited to mail.google.com and mail.yahoo.com only
Platform Support: Gmail and Yahoo Mail (desktop web versions)
curl -L "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" -o ~/Downloads/googlechrome.dmg
open ~/Downloads/googlechrome.dmgRecommended: Use the latest version of your browser for best compatibility and security
-
Clone this repository:
git clone https://github.com/artcore-c/email-xray.git cd email-xray -
Open Chrome Extensions:
- Navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right)
- Navigate to
-
Load the extension:
- Click "Load unpacked"
- Select the
email-xrayfolder - The Email X-Ray icon should appear in your toolbar
- Open an email in Gmail or Yahoo Mail
- Click the Email X-Ray icon in your Chrome toolbar
- Click "Scan Current Email"
- Review the results in the panel that appears
Press β+β§+X (Mac) or Ctrl+Shift+X (Windows/Linux) while viewing an email to instantly scan.
The extension displays findings in three severity levels:
π΄ CRITICAL: Immediate security concern (hidden iframes, invisible text with suspicious content)
π WARNING: Potentially suspicious (tracking pixels, unusual formatting)
π΅ INFO: Informational (minor anomalies worth noting)
- Click on a finding in the panel to scroll to it in the email
- Click on highlighted elements in the email to see detection details
- Export results using the "Export Results (JSON)" button for documentation
- Chrome 88+
- Chromium-based browsers (Edge, Brave, Opera)
- MacOS, Windows, Linux
- Intended for use with Gmail and Yahoo Mail web interfaces only
- Cannot scan emails in native mail clients
- Some detection methods are heuristic-based (may have false positives/negatives)
- Attachments are not scanned (only email body content)
email-xray/
βββ manifest.json # Extension configuration
βββ content.js # Main detection logic
βββ popup.html # Extension popup UI
βββ popup.js # Popup interaction handling
βββ styles.css # Visual styling
βββ icons/ # Extension icons
βββ icon16.png
βββ icon48.png
βββ icon128.png
No build process required. The extension runs directly from source files.
Test on sample phishing emails or create test cases with:
- Hidden divs with
style="font-size:0px" - Links with
href="javascript:alert(1)" - Images with
width="1" height="1" - Text with zero-width characters:
Hello\u200BWorld
The extension showing hidden CSS in a phishing email,
highlighting suspicious elements and providing detailed analysis in
the results panel.
Attachment analysis revealing a potentially malicious file attachment.
Comprehensive scan revealing brand impersonation with phony links, multiple
tracking pixels (1x1 images), and homograph attacks using confusable Unicode
characters.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Email X-Ray is a tool to assist in identifying potential phishing attempts. It is not a guarantee of email safety and should be used as part of a comprehensive security strategy. Always exercise caution with suspicious emails.
Created by Unicorn-1
- Inspired by the growing sophistication of email phishing attacks
- Built with security and privacy as core principles
- Designed for the security-conscious email user
Email X-Ray is a detection tool, not a protection layer. It helps identify suspicious patterns but cannot guarantee complete safety. The extension may miss sophisticated attacks or flag legitimate content (false positives/negatives are possible with heuristic detection).
- Never click links or download attachments from suspicious emails, even after scanning
- Remember that hidden elements may exist beneath visible content - avoid clicking anywhere in flagged emails
- If the extension detects threats, report the email to your email provider's spam/phishing system
- For emails impersonating legitimate companies, report directly to that company's official abuse/security contact
- Use Email X-Ray as one tool in a broader security strategy, not as your only defense
The extension runs entirely in your browser and sends no data externally. All code is open-source and auditable in this repository.

