CWE-1188 Base Incompleto

Initialization of a Resource with an Insecure Default

This vulnerability occurs when software uses an insecure default setting or value for a resource, assuming an administrator will change it later.

Definición

What is CWE-1188?

This vulnerability occurs when software uses an insecure default setting or value for a resource, assuming an administrator will change it later.
Developers often set open, permissive defaults to make a product easy to install and use right away. The security model relies entirely on the administrator remembering to change these defaults to a more secure configuration, which is a risky assumption. This creates an 'out-of-the-box' vulnerability where the system is insecure from the moment it's installed. The resulting security gap remains until an admin takes action, leaving a window of exposure that attackers can easily discover and exploit.
Impacto en el mundo real

Real-world CVEs caused by CWE-1188

  • insecure default variable initialization in BIOS firmware for a hardware board allows DoS

  • A generic database browser interface has a default mode that exposes a web server to the network, allowing queries to the database.

Cómo lo explotan los atacantes

Ruta del atacante paso a paso

  1. 1

    This code attempts to login a user using credentials from a POST request:

  2. 2

    Because the $authorized variable is never initialized, PHP will automatically set $authorized to any value included in the POST request if register_globals is enabled. An attacker can send a POST request with an unexpected third value 'authorized' set to 'true' and gain authorized status without supplying valid credentials.

  3. 3

    Here is a fixed version:

  4. 4

    This code avoids the issue by initializing the $authorized variable to false and explicitly retrieving the login credentials from the $_POST variable. Regardless, register_globals should never be enabled and is disabled by default in current versions of PHP.

Ejemplo de código vulnerable

Vulnerable PHP

This code attempts to login a user using credentials from a POST request:

Vulnerable PHP
```
// $user and $pass automatically set from POST request* 
  if (login_user($user,$pass)) {
  ```
  	$authorized = true;
  }
```
...* 
  
  if ($authorized) {
  ```
  	generatePage();
  }
Ejemplo de código seguro

Secure PHP

Here is a fixed version:

Seguro PHP
$user = $_POST['user'];
  $pass = $_POST['pass'];
  $authorized = false;
  if (login_user($user,$pass)) {
  	$authorized = true;
  }
```
...*
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-1188

  • Architecture Use safe-by-default frameworks and APIs that prevent the unsafe pattern from being expressible.
  • Implementation Validate input at trust boundaries; use allowlists, not denylists.
  • Implementation Apply the principle of least privilege to credentials, file paths, and runtime permissions.
  • Testing Cover this weakness in CI: SAST rules + targeted unit tests for the data flow.
  • Operation Monitor logs for the runtime signals listed in the next section.
Señales de detección

How to detect CWE-1188

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

This vulnerability occurs when software uses an insecure default setting or value for a resource, assuming an administrator will change it later.

¿Qué gravedad tiene CWE-1188?

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

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

Use safe-by-default frameworks, validate untrusted input at trust boundaries, and apply the principle of least privilege. Cover the data-flow signature in CI with SAST.

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

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

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