Description
A product's hardware-based access control check occurs after the asset has been accessed.
The product implements a hardware-based access control check. The asset should be accessible only after the check is successful. If, however, this operation is not atomic and the asset is accessed before the check is complete, the security of the system may be compromised.
Potential Impact
Access Control, Confidentiality, Integrity
Modify Memory, Read Memory, Modify Application Data, Read Application Data, Gain Privileges or Assume Identity, Bypass Protection Mechanism
Demonstrative Examples
module foo_bar(data_out, usr_id, data_in, clk, rst_n);
output reg [7:0] data_out;
input wire [2:0] usr_id;
input wire [7:0] data_in;
input wire clk, rst_n;
wire grant_access;
always @ (posedge clk or negedge rst_n)
begin
if (!rst_n)
data_out = 0;
else
data_out = (grant_access) ? data_in : data_out;
assign grant_access = (usr_id == 3'h4) ? 1'b1 : 1'b0;
end
endmodulealways @ (posedge clk or negedge rst_n)
begin
if (!rst_n)
data_out = 0;
else
assign grant_access = (usr_id == 3'h4) ? 1'b1 : 1'b0;
data_out = (grant_access) ? data_in : data_out;
end
endmoduleMitigations & Prevention
Implement the access control check first. Access should only be given to asset if agent is authorized.
Related Weaknesses
Frequently Asked Questions
What is CWE-1280?
CWE-1280 (Access Control Check Implemented After Asset is Accessed) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. A product's hardware-based access control check occurs after the asset has been accessed.
How can CWE-1280 be exploited?
Attackers can exploit CWE-1280 (Access Control Check Implemented After Asset is Accessed) to modify memory, read memory, modify application data, read application data, gain privileges or assume identity, bypass protection mechanism. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-1280?
Key mitigations include: Implement the access control check first. Access should only be given to asset if agent is authorized.
What is the severity of CWE-1280?
CWE-1280 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.