DEV Community

pabli44
pabli44

Posted on

Unicode Infection

Be careful with Unicode; don't be too trusting. Your PC can be infected if you make a mistake. Here are a few cases to keep in mind just in case:

**The "Reverse Extension" Trick (RTLO)**
This is the most dangerous method. There is a special Unicode character called Right-to-Left Override (U+202E) that reverses the order of the text that follows it.

How it works: An attacker names a malicious file something like instructions_codgpj.exe.

The trick: They insert the RTLO character before "gpj".

What you see: The system displays it as instructions_jop.gdc.

The danger: You think you are opening an image (.jpg) or a document, but in reality, you are executing a command file (.scr, .exe, .bat).

**Homograph Attacks (Phishing)**
Unicode allows the use of characters from different alphabets that look identical to ours. This is frequently used to create fake links.

Example: The "а" in the Cyrillic alphabet looks exactly like our Latin "a".

The risk: An attacker registers the domain pаypal.com (using the Cyrillic "a"). Visually, it is perfect, but it leads you to a scam site that can download malware onto your PC.

**Buffer Overflow**
Sometimes, programmers do not prepare their applications to handle complex or very long Unicode characters.

If a program expects simple text and receives a strange Unicode string, it could crash.

In extreme and highly technical cases, an attacker could design a string of text that, when processed, "breaks" the program's memory and executes hidden malicious code. This is uncommon nowadays thanks to modern operating system protections.

Top comments (0)