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.

Definição

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 no 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.

Como os atacantes a exploram

Trajeto do atacante passo a passo

  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.

Exemplo de código vulnerável

Vulnerable PHP

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

Vulnerável PHP
```
// $user and $pass automatically set from POST request* 
  if (login_user($user,$pass)) {
  ```
  	$authorized = true;
  }
```
...* 
  
  if ($authorized) {
  ```
  	generatePage();
  }
Exemplo 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 verificação de prevenção

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.
Sinais de deteção

How to detect CWE-1188

SAST High

Executar análise estática (SAST) na base de código à procura do padrão inseguro no fluxo de dados.

DAST Moderate

Executar testes dinâmicos de segurança de aplicações (DAST) contra o endpoint em execução.

Runtime Moderate

Monitorizar os registos em tempo de execução para traços de exceção invulgares, input malformado ou tentativas de contornar a autorização.

Code review Moderate

Revisão de código: sinalizar qualquer novo código que trate input desta superfície sem usar os ajudantes validados do framework.

Correção automática do Plexicus

O Plexicus deteta automaticamente o CWE-1188 e abre um PR de correção em menos de 60 segundos.

O Codex Remedium analisa cada commit, identifica esta fraqueza exata e entrega um pull request pronto para revisão com o patch. Sem tickets. Sem transferências.

Perguntas frequentes

Frequently asked questions

O que é o CWE-1188?

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

Qual a gravidade do CWE-1188?

A MITRE não publicou uma classificação de probabilidade de exploração para esta fraqueza. Trate-a como impacto médio até o seu modelo de ameaças provar o contrário.

Que linguagens ou plataformas são afetadas pelo CWE-1188?

A MITRE não especificou as plataformas afetadas por este CWE — pode aplicar-se à maioria das stacks de aplicações.

Como posso prevenir o 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.

Como é que o Plexicus deteta e corrige o CWE-1188?

O motor SAST do Plexicus correlaciona a assinatura de fluxo de dados do CWE-1188 em cada commit. Quando é encontrada uma correspondência, o nosso agente Codex Remedium abre um PR de correção com o código corrigido, testes e um resumo de uma linha para o revisor.

Onde posso saber mais sobre o CWE-1188?

A MITRE publica a definição canónica em https://cwe.mitre.org/data/definitions/1188.html. Pode também consultar a documentação da OWASP e do NIST para orientações adjacentes.

Pronto quando você estiver

Pare de pagar por desenvolvedor.
Comece a fechar o ciclo.

O Plexicus é o ASPM nativo de IA que verifica, filtra, corrige, pentesta e explica — de forma autónoma. Programadores ilimitados, repos ilimitados, ações de IA de utilização justa. Nível gratuito real, €269/mo anual quando estiver pronto.