Base · Medium

CWE-1268: Policy Privileges are not Assigned Consistently Between Control and Data Agents

The product's hardware-enforced access control for a particular resource improperly accounts for privilege discrepancies between control and write policies.

CWE-1268 · Base Level ·1 Mitigations

Description

The product's hardware-enforced access control for a particular resource improperly accounts for privilege discrepancies between control and write policies.

Integrated circuits and hardware engines may provide access to resources (device-configuration, encryption keys, etc.) belonging to trusted firmware or software modules (commonly set by a BIOS or a bootloader). These accesses are typically controlled and limited by the hardware. Hardware design access control is sometimes implemented using a policy. A policy defines which entity or agent may or may not be allowed to perform an action. When a system implements multiple levels of policies, a control policy may allow direct access to a resource as well as changes to the policies themselves. Resources that include agents in their control policy but not in their write policy could unintentionally allow an untrusted agent to insert itself in the write policy register. Inclusion in the write policy register could allow a malicious or misbehaving agent write access to resources. This action could result in security compromises including leaked information, leaked encryption keys, or modification of device configuration.

Potential Impact

Confidentiality, Integrity, Availability, Access Control

Modify Memory, Read Memory, DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands, Gain Privileges or Assume Identity, Bypass Protection Mechanism, Read Files or Directories, Reduce Reliability

Demonstrative Examples

Consider a system of seven registers for storing and configuring an AES key for encryption or decryption. Four 32-bit registers are used to store a 128-bit AES key. The names of those registers are AES_ENC_DEC_KEY_0, AES_ENC_DEC_KEY_1, AES_ENC_DEC_KEY_2, and AES_ENC_DEC_KEY_3. Collectively these are referred to as the AES Key registers. Three 32-bit registers are used to define access control for the AES-key registers. The names of those registers are AES_KEY_CONTROL_POLICY, AES_KEY_READ_POLICY, and AES_KEY_WRITE_POLICY. Collectively these registers are referred to as the Policy registers, and their functions are explained next. The preceding three policy registers encode access control at the bit level. Therefore a maximum of 32 agents can be defined (1 bit per agent). The value of the bit when set (i.e., "1") allows the respective action from an agent whose identity corresponds to the number of the bit. If clear (i.e., "0"), it disallows the respective action to that corresponding agent. For example, if bit 0 is set to "1" in the AES_KEY_READ_POLICY register, then agent 0 has permission to read the AES-key registers. Consider that there are 4 agents named Agent 1, Agent 2, Agent 3, and Agent 4. For access control purposes Agent 1 is assigned to bit 1, Agent 2 to bit 2, Agent 3 to bit 3, and Agent 4 to bit 4. All agents are trusted except for Agent 3 who is untrusted. Also consider the register values in the below table.
Bad
RegisterField description
						AES_KEY_CONTROL_POLICYControls which agents can write to READ_POLICY and WRITE_POLICY registers[31:0] Default 0x00000018
						AES_KEY_READ_POLICYControls which agents can read the AES-key registers[31:0] Default 0x00000002
						AES_KEY_WRITE_POLICYControls which agents can write to the AES-key registers[31:0] Default 0x00000004
Good
RegisterField description
					AES_KEY_CONTROL_POLICY[31:0] Default 0x00000010
					AES_KEY_READ_POLICY[31:0] Default 0x00000002
					AES_KEY_WRITE_POLICY[31:0] Default 0x00000004

Mitigations & Prevention

Architecture and DesignImplementation

Access-control-policy definition and programming flow must be sufficiently tested in pre-silicon and post-silicon testing.

Frequently Asked Questions

What is CWE-1268?

CWE-1268 (Policy Privileges are not Assigned Consistently Between Control and Data Agents) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product's hardware-enforced access control for a particular resource improperly accounts for privilege discrepancies between control and write policies.

How can CWE-1268 be exploited?

Attackers can exploit CWE-1268 (Policy Privileges are not Assigned Consistently Between Control and Data Agents) to modify memory, read memory, dos: crash, exit, or restart, execute unauthorized code or commands, gain privileges or assume identity, bypass protection mechanism, read files or directories, reduce reliability. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.

How do I prevent CWE-1268?

Key mitigations include: Access-control-policy definition and programming flow must be sufficiently tested in pre-silicon and post-silicon testing.

What is the severity of CWE-1268?

CWE-1268 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.