Description
The bridge incorrectly translates security attributes from either trusted to untrusted or from untrusted to trusted when converting from one fabric protocol to another.
A bridge allows IP blocks supporting different fabric protocols to be integrated into the system. Fabric end-points or interfaces usually have dedicated signals to transport security attributes. For example, HPROT signals in AHB, AxPROT signals in AXI, and MReqInfo and SRespInfo signals in OCP. The values on these signals are used to indicate the security attributes of the transaction. These include the immutable hardware identity of the controller initiating the transaction, privilege level, and type of transaction (e.g., read/write, cacheable/non-cacheable, posted/non-posted). A weakness can arise if the bridge IP block, which translates the signals from the protocol used in the IP block endpoint to the protocol used by the central bus, does not properly translate the security attributes. As a result, the identity of the initiator could be translated from untrusted to trusted or vice-versa. This could result in access-control bypass, privilege escalation, or denial of service.
Potential Impact
Confidentiality, Integrity, Access Control
Modify Memory, Read Memory, Gain Privileges or Assume Identity, Bypass Protection Mechanism, Execute Unauthorized Code or Commands
Demonstrative Examples
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
endmoduleMitigations & Prevention
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.
Related Weaknesses
Frequently Asked Questions
What is CWE-1311?
CWE-1311 (Improper Translation of Security Attributes by Fabric Bridge) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The bridge incorrectly translates security attributes from either trusted to untrusted or from untrusted to trusted when converting from one fabric protocol to another.
How can CWE-1311 be exploited?
Attackers can exploit CWE-1311 (Improper Translation of Security Attributes by Fabric Bridge) to modify memory, read memory, gain privileges or assume identity, bypass protection mechanism, execute unauthorized code or commands. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.
How do I prevent CWE-1311?
Key mitigations include: The translation must map signals in such a way that untrusted agents cannot map to trusted agents or vice-versa.
What is the severity of CWE-1311?
CWE-1311 is classified as a Base-level weakness (Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.