Unmasking BiDi Swaps: The Fake URL Threat

▼ Summary
– Varonis Threat Labs highlights a decade-old URL spoofing vulnerability called BiDi Swap that exploits browser handling of RTL and LTR scripts.
– BiDi Swap builds on past Unicode attacks like Punycode homograph attacks and RTL overrides, which use visually similar characters or text direction changes to deceive users.
– The Bidirectional Algorithm in Unicode, designed to display mixed-script text correctly, struggles with subdomains and URL parameters, enabling spoofing.
– Browser mitigations vary, with Chrome and Firefox offering partial protection through lookalike URL suggestions or domain highlighting, but gaps remain.
– Recommendations include user awareness, verifying suspicious URLs, and urging browser developers to enhance protections against these spoofing techniques.
A long-standing browser vulnerability known as the BiDi Swap technique is once again drawing scrutiny for its role in sophisticated phishing campaigns. This method cleverly manipulates how browsers interpret bidirectional text, allowing attackers to construct web addresses that seem legitimate but actually redirect users to malicious destinations.
Previous approaches to URL deception often relied on Unicode manipulation. One common tactic, the Punycode Homograph Attack, leverages internationalized domain names to substitute visually similar characters from different scripts. For instance, a threat actor might register a domain using a Cyrillic “а” instead of the Latin “a,” creating addresses like “аpple.com” that are nearly indistinguishable from the real thing to the casual observer. Browsers convert these domains internally, but the visual trickery remains effective at fooling users.
Another historical method involves the RTL Override Exploit, where attackers insert special Unicode control characters that reverse the text display order. This can make a dangerous file named “blafdp.exe” appear as “blaexe.pdf,” hiding the true file extension. While these control characters serve legitimate purposes for languages like Arabic and Hebrew, their misuse highlights how text rendering features can be weaponized.
These earlier spoofing techniques paved the way for BiDi Swap by demonstrating that subtle inconsistencies in how computers handle text can create significant security loopholes.
Understanding text direction is fundamental to grasping how BiDi Swap operates. Languages such as English are written left-to-right (LTR), while others like Arabic and Hebrew flow right-to-left (RTL). The Bidirectional Algorithm within the Unicode Standard manages this mix, ensuring coherent text display when both directions appear together. Unfortunately, this system doesn’t always handle complex URL structures perfectly, particularly with subdomains and parameters, leaving room for exploitation.
A typical web address contains multiple components: the protocol (like https://), optional subdomains (www), the primary domain name, top-level domain (.com), path (/blog/), and query parameters (?id=123). Attackers manipulate how these elements render when combining LTR and RTL text, creating confusion about the true destination.
The BiDi Swap technique becomes particularly dangerous when attackers craft URLs that appear to belong to trusted organizations but actually point elsewhere. By mixing LTR and RTL elements in specific ways, they can make malicious addresses look identical to legitimate ones in the browser’s address bar, a deception that easily bypasses casual inspection.
Current browser protections against these attacks vary significantly. Chrome’s lookalike URL warnings provide some defense but remain inconsistent in coverage. Firefox takes a different approach by prominently highlighting the actual domain in the address bar, making spoofed addresses easier to identify. Microsoft Edge has reportedly addressed the issue, though the visual representation of potentially malicious URLs appears unchanged.
Protecting against BiDi Swap attacks requires both technical measures and user awareness. Organizations should implement comprehensive security platforms that monitor inbound and outbound communications for suspicious patterns. For individual protection, always verify URLs carefully before clicking, particularly those containing mixed character sets or unusual formatting. Hovering over links to see the actual destination and checking for valid SSL certificates provides additional security layers.
The ongoing evolution of these spoofing techniques underscores the need for continuous improvement in browser security features and user education. As attackers refine their methods, maintaining vigilance and adopting advanced threat detection systems becomes increasingly critical for organizational security.
(Source: Bleeping Computer)
