CWE-1222 Variante Incompleto

Insufficient Granularity of Address Regions Protected by Register Locks

This vulnerability occurs when a hardware design uses a single lock bit to protect a large, coarse block of memory addresses. This lack of granularity creates a conflict: the system needs to lock…

Definição

What is CWE-1222?

This vulnerability occurs when a hardware design uses a single lock bit to protect a large, coarse block of memory addresses. This lack of granularity creates a conflict: the system needs to lock critical configuration settings early for security, but software also needs to write to other parts of that same address region during normal operation, which the lock incorrectly prevents.
In many systems, a trusted boot process (like the BIOS or bootloader) sets a hardware lock bit to permanently freeze critical configuration registers, preventing malware or errors from altering them later. This lock typically protects an entire predefined address region, not individual registers. However, if this protected region is too large and not finely segmented, it becomes a security and functionality trade-off. Setting the lock too early can block legitimate software from updating necessary settings within that same region, while not setting it leaves the system vulnerable. Fixing this conflict after manufacturing requires a hardware redesign, as the lock granularity is baked into the silicon.
Impacto no mundo real

Real-world CVEs caused by CWE-1222

Ainda não há referências CVE públicas associadas a este CWE no catálogo da MITRE.

Como os atacantes a exploram

Trajeto do atacante passo a passo

  1. 1

    Identificar um caminho de código que trata input não confiável sem validação.

  2. 2

    Criar um payload que explora o comportamento inseguro — injeção, traversal, overflow ou abuso de lógica.

  3. 3

    Entregar o payload através de um pedido normal e observar a reação da aplicação.

  4. 4

    Iterar até que a resposta exponha dados, execute código do atacante ou escale privilégios.

Exemplo de código vulnerável

Vulnerable Other

For example, consider a hardware unit with a 32 kilobyte configuration address space where the first 8 kilobyte address contains security sensitive controls that must only be writable by device bootloader. One way to protect the security configuration could be to define a 32 bit system configuration locking register (SYS_LOCK) where each bit lock locks the corresponding 1 kilobyte region.

Vulnerável Other
| Address | Register | 
| --- | --- |
| 0x0000 | SYS_LOCK: 32 bit system configuration lock register, each bit is write-1-once  |
| 0x0004 | SECURITY_FEATURE_ENABLE: 32 bit register controlling enabling of security features  |
| ... |    |
| 0x0310 | SW_MODE: 32 bit Software Mode indication register   |

  | Address region | Lock bit | 
| --- | --- |
| 0x0000 - 0x03FF | SYS_LOCK[0]  |
| 0x0400 - 0x07FF | SYS_LOCK[1]  |
| ... |    |
| 0x7C00 - 0x7FFF | SYS_LOCK[31]  |
Exemplo 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 verificação de prevenção

How to prevent CWE-1222

  • Architecture and Design The defining of protected locked registers should be reviewed or tested early in the design phase with software teams to ensure software flows are not blocked by the security locks. As an alternative to using register lock control bits and fixed access control regions, the hardware design could use programmable security access control configuration so that device trusted firmware can configure and change the protected regions based on software usage and security models.
Sinais de deteção

How to detect CWE-1222

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

This vulnerability occurs when a hardware design uses a single lock bit to protect a large, coarse block of memory addresses. This lack of granularity creates a conflict: the system needs to lock critical configuration settings early for security, but software also needs to write to other parts of that same address region during normal operation, which the lock incorrectly prevents.

Qual a gravidade do CWE-1222?

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

MITRE lists the following affected platforms: Not OS-Specific, Not Architecture-Specific, System on Chip.

Como posso prevenir o CWE-1222?

The defining of protected locked registers should be reviewed or tested early in the design phase with software teams to ensure software flows are not blocked by the security locks. As an alternative to using register lock control bits and fixed access control regions, the hardware design could use programmable security access control configuration so that device trusted firmware can configure and change the protected regions based on software usage and security models.

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

O motor SAST do Plexicus correlaciona a assinatura de fluxo de dados do CWE-1222 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-1222?

A MITRE publica a definição canónica em https://cwe.mitre.org/data/definitions/1222.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.