CWE-1311 Base Brouillon

Improper Translation of Security Attributes by Fabric Bridge

This vulnerability occurs when a hardware bridge incorrectly converts security attributes between different fabric protocols, potentially changing a transaction's identity from trusted to untrusted…

Définition

What is CWE-1311?

This vulnerability occurs when a hardware bridge incorrectly converts security attributes between different fabric protocols, potentially changing a transaction's identity from trusted to untrusted or vice versa during protocol translation.
Hardware systems often integrate components that use different communication protocols (like AHB, AXI, or OCP), requiring bridges to translate between them. These protocols use dedicated signals (such as HPROT, AxPROT, or MReqInfo) to carry critical security metadata—including the initiating controller's hardware identity, privilege level, and transaction type. The bridge must accurately preserve this security context during conversion. When the bridge misinterprets or incorrectly maps these security attributes, it can fundamentally alter a transaction's trust level. An untrusted initiator might be incorrectly labeled as trusted, or vice versa, leading to severe consequences like privilege escalation, access control bypass, or denial of service by allowing unauthorized access to protected system resources.
Impact réel

Real-world CVEs caused by CWE-1311

Aucune référence CVE publique n'est liée à ce CWE dans le catalogue MITRE pour le moment.

Comment les attaquants l'exploitent

Parcours de l'attaquant étape par étape

  1. 1

    Identifier un chemin de code qui traite des entrées non fiables sans validation.

  2. 2

    Élaborer une charge utile qui exploite le comportement non sécurisé — injection, traversal, débordement ou abus de logique.

  3. 3

    Délivrer la charge utile via une requête normale et observer la réaction de l'application.

  4. 4

    Itérer jusqu'à ce que la réponse divulgue des données, exécute le code de l'attaquant ou élève les privilèges.

Exemple de code vulnérable

Vulnerable Verilog

The bridge interfaces between OCP and AHB end points. OCP uses MReqInfo signal to indicate security attributes, whereas AHB uses HPROT signal to indicate the security attributes. The width of MReqInfo can be customized as needed. In this example, MReqInfo is 5-bits wide and carries the privilege level of the OCP controller. The values 5'h11, 5'h10, 5'h0F, 5'h0D, 5'h0C, 5'h0B, 5'h09, 5'h08, 5'h04, and 5'h02 in MReqInfo indicate that the request is coming from a privileged state of the OCP bus controller. Values 5'h1F, 5'h0E, and 5'h00 indicate untrusted, privilege state. Though HPROT is a 5-bit signal, we only consider the lower, two bits in this example. HPROT values 2'b00 and 2'b10 are considered trusted, and 2'b01 and 2'b11 are considered untrusted. The OCP2AHB bridge is expected to translate trusted identities on the controller side to trusted identities on the responder side. Similarly, it is expected to translate untrusted identities on the controller side to untrusted identities on the responder side.

Vulnérable Verilog
module ocp2ahb
 ( 

```
   ahb_hprot, 
   ocp_mreqinfo 
 ); 
 output [1:0] ahb_hprot; // output is 2 bit signal for AHB HPROT
 input [4:0] ocp_mreqinfo; // input is 5 bit signal from OCP MReqInfo
 wire [6:0] p0_mreqinfo_o_temp; // OCP signal that transmits hardware identity of bus controller
 wire y;
 reg [1:0] ahb_hprot;
 // hardware identity of bus controller is in bits 5:1 of p0_mreqinfo_o_temp signal
 assign p0_mreqinfo_o_temp[6:0] = {1'b0, ocp_mreqinfo[4:0], y};
 always @*
 begin
   case (p0_mreqinfo_o_temp[4:2])
  	 000: ahb_hprot = 2'b11; // OCP MReqInfo to AHB HPROT mapping
  	 001: ahb_hprot = 2'b00;
  	 010: ahb_hprot = 2'b00;
  	 011: ahb_hprot = 2'b01;
  	 100: ahb_hprot = 2'b00;
  	 101: ahb_hprot = 2'b00;
  	 110: ahb_hprot = 2'b10;
  	 111: ahb_hprot = 2'b00;
   endcase
 end
 endmodule
Exemple de code sécurisé

Secure pseudo

Sécurisé 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.
Liste de contrôle de prévention

How to prevent CWE-1311

  • Architecture and Design The translation must map signals in such a way that untrusted agents cannot map to trusted agents or vice-versa.
  • Implementation Ensure that the translation maps signals in such a way that untrusted agents cannot map to trusted agents or vice-versa.
Signaux de détection

How to detect CWE-1311

SAST High

Exécuter une analyse statique (SAST) sur le code source à la recherche du motif non sécurisé dans le flux de données.

DAST Moderate

Exécuter des tests de sécurité applicative dynamique (DAST) contre le point de terminaison en ligne.

Runtime Moderate

Surveiller les journaux runtime pour détecter des traces d'exception inhabituelles, des entrées malformées ou des tentatives de contournement d'autorisation.

Code review Moderate

Revue de code : signaler tout nouveau code qui traite les entrées de cette surface sans utiliser les helpers du framework validés.

Correction automatique Plexicus

Plexicus détecte automatiquement CWE-1311 et ouvre une PR de correction en moins de 60 secondes.

Codex Remedium analyse chaque commit, identifie cette faiblesse précise et livre une pull request prête à être relue avec le correctif. Pas de tickets. Pas de transferts.

Questions fréquentes

Frequently asked questions

Qu'est-ce que CWE-1311 ?

This vulnerability occurs when a hardware bridge incorrectly converts security attributes between different fabric protocols, potentially changing a transaction's identity from trusted to untrusted or vice versa during protocol translation.

Quelle est la gravité de CWE-1311 ?

MITRE n'a pas publié de note de probabilité d'exploitation pour cette faiblesse. Traitez-la comme un impact moyen jusqu'à ce que votre modèle de menace prouve le contraire.

Quels langages ou plateformes sont affectés par CWE-1311 ?

MITRE lists the following affected platforms: Verilog, VHDL, Not Technology-Specific.

Comment puis-je prévenir CWE-1311 ?

The translation must map signals in such a way that untrusted agents cannot map to trusted agents or vice-versa. Ensure that the translation maps signals in such a way that untrusted agents cannot map to trusted agents or vice-versa.

Comment Plexicus détecte et corrige CWE-1311 ?

Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-1311 à chaque commit. Lorsqu'une correspondance est trouvée, notre agent Codex Remedium ouvre une PR de correction avec le code corrigé, les tests et un résumé d'une ligne pour le relecteur.

Où puis-je en savoir plus sur CWE-1311 ?

MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/1311.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.

Faiblesses associées

Weaknesses related to CWE-1311

CWE-284 Parent

Improper Access Control

The software fails to properly limit who can access a resource, allowing unauthorized users or systems to interact with it.

CWE-1191 Frère

On-Chip Debug and Test Interface With Improper Access Control

This vulnerability occurs when a hardware chip's debug or test interface (like JTAG) lacks proper access controls. Without correct…

CWE-1220 Frère

Insufficient Granularity of Access Control

This vulnerability occurs when a system's access controls are too broad, allowing unauthorized users or processes to read or modify…

CWE-1224 Frère

Improper Restriction of Write-Once Bit Fields

This vulnerability occurs when hardware write-once protection mechanisms, often called 'sticky bits,' are incorrectly implemented,…

CWE-1231 Frère

Improper Prevention of Lock Bit Modification

This vulnerability occurs when hardware or firmware uses a lock bit to protect critical system registers or memory regions, but fails to…

CWE-1233 Frère

Security-Sensitive Hardware Controls with Missing Lock Bit Protection

This vulnerability occurs when a hardware device uses a lock bit to protect critical configuration registers, but the lock fails to…

CWE-1252 Frère

CPU Hardware Not Configured to Support Exclusivity of Write and Execute Operations

This vulnerability occurs when a CPU's hardware is not set up to enforce a strict separation between writing data to memory and executing…

CWE-1257 Frère

Improper Access Control Applied to Mirrored or Aliased Memory Regions

This vulnerability occurs when a hardware design maps the same physical memory to multiple addresses (aliasing or mirroring) but fails to…

CWE-1259 Frère

Improper Restriction of Security Token Assignment

This vulnerability occurs when a System-on-a-Chip (SoC) fails to properly secure its Security Token mechanism. These tokens control which…

Prêt quand vous l'êtes

Arrêtez de payer par développeur.
Commencez à fermer la boucle.

Plexicus est l'ASPM natif IA qui scanne, filtre, corrige, penteste et explique — de façon autonome. Développeurs illimités, dépôts illimités, actions IA à usage équitable. Vrai niveau gratuit, €269/mo annuel quand vous êtes prêt.