CWE-422 Variante Borrador

Unprotected Windows Messaging Channel ('Shatter')

This vulnerability, often called a 'Shatter' attack, occurs when a Windows application running with high privileges accepts messages from the Windows messaging system without verifying their source.…

Definición

What is CWE-422?

This vulnerability, often called a 'Shatter' attack, occurs when a Windows application running with high privileges accepts messages from the Windows messaging system without verifying their source. This allows a less-privileged or malicious application to send commands directly to the privileged application, potentially hijacking its functionality.
At its core, this flaw exploits the trust that elevated Windows applications place in the standard messaging system (like SendMessage or PostMessage). Since these messages are not authenticated, any program—including one run by a standard user—can craft and send requests. If the privileged application doesn't check which process sent the message, it will execute the command with its own high-level permissions, letting a low-privilege attacker perform actions they shouldn't be allowed to do. To prevent this, developers must treat incoming Windows messages from untrusted sources with the same suspicion as network data. Implement strict message validation by checking the sender's process ID or using secure communication channels for sensitive operations. Relying solely on User Interface Privilege Isolation (UIPI) on modern systems is not enough; the application's own logic must actively guard its message-handling routines to block unauthorized cross-process communication.
Impacto en el mundo real

Real-world CVEs caused by CWE-422

  • Bypass GUI and access restricted dialog box.

  • Gain privileges via Windows message.

  • A control allows a change to a pointer for a callback function using Windows message.

  • Product launches Help functionality while running with raised privileges, allowing command execution using Windows message to access "open file" dialog.

  • Attacker uses Shatter attack to bypass GUI-enforced protection for CVE-2003-0908.

  • User can call certain API functions to modify certain properties of privileged programs.

Cómo lo explotan los atacantes

Ruta del atacante paso a paso

  1. 1

    Identifica una ruta de código que maneje entrada no confiable sin validación.

  2. 2

    Crea un payload que ejercite el comportamiento inseguro — inyección, traversal, overflow o abuso de lógica.

  3. 3

    Envía el payload a través de una solicitud normal y observa la reacción de la aplicación.

  4. 4

    Itera hasta que la respuesta filtre datos, ejecute código del atacante o escale privilegios.

Ejemplo de código vulnerable

Vulnerable pseudo

MITRE no ha publicado un ejemplo de código para esta CWE. El patrón siguiente es ilustrativo — consulta Recursos para referencias canónicas.

Vulnerable pseudo
// Example pattern — see MITRE for the canonical references.
function handleRequest(input) {
  // Untrusted input flows directly into the sensitive sink.
  return executeUnsafe(input);
}
Ejemplo de código seguro

Secure pseudo

Seguro 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.
Lista de prevención

How to prevent CWE-422

  • Architecture and Design Always verify and authenticate the source of the message.
Señales de detección

How to detect CWE-422

SAST High

Ejecuta análisis estático (SAST) sobre el código buscando el patrón inseguro en el flujo de datos.

DAST Moderate

Ejecuta pruebas dinámicas de seguridad de aplicaciones (DAST) contra el endpoint en vivo.

Runtime Moderate

Vigila los logs en tiempo de ejecución para detectar trazas de excepción inusuales, entradas malformadas o intentos de bypass de autorización.

Code review Moderate

Revisión de código: marca cualquier código nuevo que maneje entrada desde esta superficie sin usar los helpers validados del framework.

Auto-corrección de Plexicus

Plexicus detecta automáticamente CWE-422 y abre un PR de corrección en menos de 60 segundos.

Codex Remedium escanea cada commit, identifica esta debilidad concreta y entrega un pull request listo para revisión con el parche. Sin tickets. Sin traspasos.

Preguntas frecuentes

Frequently asked questions

¿Qué es CWE-422?

This vulnerability, often called a 'Shatter' attack, occurs when a Windows application running with high privileges accepts messages from the Windows messaging system without verifying their source. This allows a less-privileged or malicious application to send commands directly to the privileged application, potentially hijacking its functionality.

¿Qué gravedad tiene CWE-422?

MITRE no ha publicado una calificación de probabilidad de explotación para esta debilidad. Trátala como de impacto medio hasta que tu modelo de amenazas demuestre lo contrario.

¿Qué lenguajes o plataformas se ven afectados por CWE-422?

MITRE no ha especificado plataformas afectadas para esta CWE — puede aplicar a la mayoría de los stacks de aplicaciones.

¿Cómo puedo prevenir CWE-422?

Always verify and authenticate the source of the message.

¿Cómo detecta y corrige Plexicus CWE-422?

El motor SAST de Plexicus detecta la firma de flujo de datos para CWE-422 en cada commit. Cuando hay coincidencia, nuestro agente Codex Remedium abre un PR de corrección con el código corregido, las pruebas y un resumen de una línea para el revisor.

¿Dónde puedo aprender más sobre CWE-422?

MITRE publica la definición canónica en https://cwe.mitre.org/data/definitions/422.html. También puedes consultar la documentación de OWASP y NIST para guías relacionadas.

Listo cuando tú lo estés

Deja de pagar por desarrollador.
Empieza a cerrar el bucle.

Plexicus es el ASPM nativo de IA que escanea, filtra, corrige, pentestea y explica — de forma autónoma. Desarrolladores ilimitados, repos ilimitados, acciones de IA de uso justo. Nivel gratuito real, €269/mo anual cuando estés listo.