CWE-67 Variante Incompleto High likelihood

Improper Handling of Windows Device Names

This vulnerability occurs when an application builds file paths from user input but fails to properly recognize or handle Windows reserved device names like AUX, CON, or COM1. Attackers can exploit…

Definición

What is CWE-67?

This vulnerability occurs when an application builds file paths from user input but fails to properly recognize or handle Windows reserved device names like AUX, CON, or COM1. Attackers can exploit this by submitting these special names, which typically causes the application to crash, hang, or leak sensitive information when it tries to access them as regular files.
Windows reserves certain filenames like AUX, CON, PRN, COM1, and LPT1 for internal device access. When an application accepts user-controlled input for filenames or paths without filtering these names, it may attempt to open a system device instead of a file. This often triggers unexpected errors, leading to application denial of service or revealing internal error details in logs or web responses. Beyond crashes, this flaw can bypass security filters. If an application's validation logic doesn't block these reserved names, an attacker might upload a malicious file disguised as a device name, or inject a device path into a URL parameter. This can disrupt file processing routines, expose stack traces or configuration data, and in some cases, be combined with other weaknesses to execute arbitrary commands.
Impacto en el mundo real

Real-world CVEs caused by CWE-67

  • Server allows remote attackers to cause a denial of service via a series of requests to .JSP files that contain an MS-DOS device name.

  • Server allows remote attackers to cause a denial of service via an HTTP request for an MS-DOS device name.

  • Product allows remote attackers to use MS-DOS device names in HTTP requests to cause a denial of service or obtain the physical path of the server.

  • Server allows remote attackers to cause a denial of service via a URL that contains an MS-DOS device name.

  • Server allows a remote attacker to create a denial of service via a URL request which includes a MS-DOS device name.

  • Microsoft Windows 9x operating systems allow an attacker to cause a denial of service via a pathname that includes file device names, aka the "DOS Device in Path Name" vulnerability.

  • Server allows remote attackers to determine the physical path of the server via a URL containing MS-DOS device names.

  • Product does not properly handle files whose names contain reserved MS-DOS device names, which can allow malicious code to bypass detection when it is installed, copied, or executed.

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-67

  • Implementation Be familiar with the device names in the operating system where your system is deployed. Check input for these device names.
Señales de detección

How to detect CWE-67

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-67 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-67?

This vulnerability occurs when an application builds file paths from user input but fails to properly recognize or handle Windows reserved device names like AUX, CON, or COM1. Attackers can exploit this by submitting these special names, which typically causes the application to crash, hang, or leak sensitive information when it tries to access them as regular files.

¿Qué gravedad tiene CWE-67?

MITRE califica la probabilidad de explotación como Alta — esta debilidad se explota activamente en la práctica y debe priorizarse para su remediación.

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

MITRE lists the following affected platforms: Windows.

¿Cómo puedo prevenir CWE-67?

Be familiar with the device names in the operating system where your system is deployed. Check input for these device names.

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

El motor SAST de Plexicus detecta la firma de flujo de datos para CWE-67 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-67?

MITRE publica la definición canónica en https://cwe.mitre.org/data/definitions/67.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.