CWE-1007 Base Incomplet Medium likelihood

Insufficient Visual Distinction of Homoglyphs Presented to User

This vulnerability occurs when an application shows text or symbols to users without clearly distinguishing between characters that look identical or very similar (called homoglyphs). Because users…

Définition

What is CWE-1007?

This vulnerability occurs when an application shows text or symbols to users without clearly distinguishing between characters that look identical or very similar (called homoglyphs). Because users can't easily tell these characters apart, they might misinterpret information and accidentally perform unsafe actions, like clicking a malicious link.
Homoglyphs are different characters that appear identical or nearly identical on screen. For example, a lowercase 'L' and an uppercase 'i' can look the same in many fonts, and the Latin 'A' is visually identical to the Greek 'Alpha'. While software treats these as completely different characters, users can't see the difference, creating a gap between what the system understands and what the user perceives. Attackers exploit this visual ambiguity to trick users. A common method is creating deceptive phishing links or hostnames that mimic trusted sites. Similarly, an attacker might register a username like 'Admin' (with a Cyrillic 'A') that looks identical to the real 'Admin' account, making malicious activity harder to spot in system logs. This highlights a critical need for interfaces to help users visually distinguish between potentially confusing characters.
Impact réel

Real-world CVEs caused by CWE-1007

  • web forum allows impersonation of users with homoglyphs in account names

  • Improper character restriction in URLs in web browser

  • Incomplete denylist does not include homoglyphs of "/" and "?" characters in URLs

  • web browser does not convert hyphens to punycode, allowing IDN spoofing in URLs

  • homoglyph spoofing using punycode in URLs and certificates

  • homoglyph spoofing using punycode in URLs and certificates

  • homoglyph spoofing using punycode in URLs and certificates

Comment les attaquants l'exploitent

Parcours de l'attaquant étape par étape

  1. 1

    The following looks like a simple, trusted URL that a user may frequently access.

  2. 2

    However, the URL above is comprised of Cyrillic characters that look identical to the expected ASCII characters. This results in most users not being able to distinguish between the two and assuming that the above URL is trusted and safe. The "e" is actually the "CYRILLIC SMALL LETTER IE" which is represented in HTML as the character &#x435, while the "a" is actually the "CYRILLIC SMALL LETTER A" which is represented in HTML as the character &#x430. The "p", "c", and "o" are also Cyrillic characters in this example. Viewing the source reveals a URL of "http://www.еxаmрlе.соm". An adversary can utilize this approach to perform an attack such as a phishing attack in order to drive traffic to a malicious website.

  3. 3

    The following displays an example of how creating usernames containing homoglyphs can lead to log forgery.

  4. 4

    Assume an adversary visits a legitimate, trusted domain and creates an account named "admin", except the 'a' and 'i' characters are Cyrillic characters instead of the expected ASCII. Any actions the adversary performs will be saved to the log file and look like they came from a legitimate administrator account.

  5. 5

    Upon closer inspection, the account that generated three of these log entries is "аdmіn". Only the third log entry is by the legitimate admin account. This makes it more difficult to determine which actions were performed by the adversary and which actions were executed by the legitimate "admin" account.

Exemple de code vulnérable

Vulnerable code

The following looks like a simple, trusted URL that a user may frequently access.

Vulnérable
http://www.еxаmрlе.соm
Charge utile de l'attaquant

The following looks like a simple, trusted URL that a user may frequently access.

Charge utile de l'attaquant
http://www.еxаmрlе.соm
Exemple de code sécurisé

Secure pseudo

Sécurisé pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Liste de contrôle de prévention

How to prevent CWE-1007

  • Implementation Use a browser that displays Punycode for IDNs in the URL and status bars, or which color code various scripts in URLs. Due to the prominence of homoglyph attacks, several browsers now help safeguard against this attack via the use of Punycode. For example, Mozilla Firefox and Google Chrome will display IDNs as Punycode if top-level domains do not restrict which characters can be used in domain names or if labels mix scripts for different languages.
  • Implementation Use an email client that has strict filters and prevents messages that mix character sets to end up in a user's inbox. Certain email clients such as Google's GMail prevent the use of non-Latin characters in email addresses or in links contained within emails. This helps prevent homoglyph attacks by flagging these emails and redirecting them to a user's spam folder.
Signaux de détection

How to detect CWE-1007

Manual Dynamic Analysis Moderate

If utilizing user accounts, attempt to submit a username that contains homoglyphs. Similarly, check to see if links containing homoglyphs can be sent via email, web browsers, or other mechanisms.

Correction automatique Plexicus

Plexicus détecte automatiquement CWE-1007 et ouvre une PR de correction en moins de 60 secondes.

Codex Remedium analyse chaque commit, identifie cette faiblesse précise et livre une pull request prête à être relue avec le correctif. Pas de tickets. Pas de transferts.

Questions fréquentes

Frequently asked questions

Qu'est-ce que CWE-1007 ?

This vulnerability occurs when an application shows text or symbols to users without clearly distinguishing between characters that look identical or very similar (called homoglyphs). Because users can't easily tell these characters apart, they might misinterpret information and accidentally perform unsafe actions, like clicking a malicious link.

Quelle est la gravité de CWE-1007 ?

MITRE évalue la probabilité d'exploitation comme Moyenne — l'exploitation est réaliste mais nécessite généralement des conditions spécifiques.

Quels langages ou plateformes sont affectés par CWE-1007 ?

MITRE lists the following affected platforms: Web Based.

Comment puis-je prévenir CWE-1007 ?

Use a browser that displays Punycode for IDNs in the URL and status bars, or which color code various scripts in URLs. Due to the prominence of homoglyph attacks, several browsers now help safeguard against this attack via the use of Punycode. For example, Mozilla Firefox and Google Chrome will display IDNs as Punycode if top-level domains do not restrict which characters can be used in domain names or if labels mix scripts for different languages. Use an email client that has strict filters…

Comment Plexicus détecte et corrige CWE-1007 ?

Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-1007 à chaque commit. Lorsqu'une correspondance est trouvée, notre agent Codex Remedium ouvre une PR de correction avec le code corrigé, les tests et un résumé d'une ligne pour le relecteur.

Où puis-je en savoir plus sur CWE-1007 ?

MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/1007.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.

Prêt quand vous l'êtes

Arrêtez de payer par développeur.
Commencez à fermer la boucle.

Plexicus est l'ASPM natif IA qui scanne, filtre, corrige, penteste et explique — de façon autonome. Développeurs illimités, dépôts illimités, actions IA à usage équitable. Vrai niveau gratuit, €269/mo annuel quand vous êtes prêt.