---
title: "CWE-1224: Improper Restriction of Write-Once Bit Fields"
url: https://radicalnotion.ai/cwe/cwe-1224
type: cwe
description: "The hardware design control register \"sticky bits\" or write-once bit fields are improperly implemented, such that they can be reprogrammed by software."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1224: Improper Restriction of Write-Once Bit Fields

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The hardware design control register "sticky bits" or write-once bit fields are improperly implemented, such that they can be reprogrammed by software.

## Background

Integrated circuits and hardware IP software programmable controls and settings are commonly stored in register circuits. These register contents have to be initialized at hardware reset to define default values that are hard coded in the hardware description language (HDL) code of the hardware unit. A common security protection mechanism used to protect register settings from modification by software is to make the settings write-once or "sticky." This allows writing to such registers only once, whereupon they become read-only. This is useful to allow initial boot software to configure systems settings to secure values while blocking runtime software from modifying such hardware settings.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | Such issues could be introduced during implementation of hardware design, since IP parameters and defaults are defined in HDL code and identified later during Testing or System Configuration phases. |

## Applicable platforms

**Languages:** Verilog (Undetermined), VHDL (Undetermined)

**Technologies:** System on Chip (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability, Access Control | Varies by Context, Modify Memory | System configuration cannot be programmed in a secure way. Failure to implement write-once restrictions in hardware design can expose such registers to being re-programmed by software and written multiple times. For example, write-once fields could be implemented to only be write-protected if they have been set to value "1", wherein they would work as "write-1-once" and not "write-once". |

## Potential mitigations

### Architecture and Design

During hardware design, all register write-once or sticky fields must be evaluated for proper configuration.

## Detection methods

### Automated Analysis

Use automated tools to test that values are not reprogrammable and that write-once fields lock on writing zeros.

## Demonstrative examples

### Example 1

Consider the example design module system verilog code shown below. register\_write\_once\_example module is an example of register that has a write-once field defined. Bit 0 field captures the write\_once\_status value. This implementation can be for a register that is defined by specification to be a write-once register, since the write\_once\_status field gets written by input data bit 0 on first write.

Bad code:

```verilog
module register_write_once_example
(
input [15:0] Data_in,
input Clk,
input ip_resetn,
input global_resetn,
input write,
output reg [15:0] Data_out
);

reg Write_once_status;

always @(posedge Clk or negedge ip_resetn)
    if (~ip_resetn)
    begin
        Data_out <= 16'h0000;
        Write_once_status <= 1'b0;
    end
    else if (write & ~Write_once_status)
    begin
        Data_out <= Data_in & 16'hFFFE;
        Write_once_status <= Data_in[0]; // Input bit 0 sets Write_once_status
    end
    else if (~write)
    begin
        Data_out[15:1] <= Data_out[15:1];
        Data_out[0] <= Write_once_status;
    end
endmodule
```

Good code:

```verilog
module register_write_once_example
(
input [15:0] Data_in,
input Clk,
input ip_resetn,
input global_resetn,
input write,
output reg [15:0] Data_out
);

reg Write_once_status;

always @(posedge Clk or negedge ip_resetn)
    if (~ip_resetn)
    begin
        Data_out <= 16'h0000;
        Write_once_status <= 1'b0;
    end
    else if (write & ~Write_once_status)
    begin
        Data_out <= Data_in & 16'hFFFE;
        Write_once_status <= 1'b1; // Write once status set on first write, independent of input
    end
    else if (~write)
    begin
        Data_out[15:1] <= Data_out[15:1];
        Data_out[0] <= Write_once_status;
    end

endmodule
```

The above example only locks further writes if write\_once\_status bit is written to one. So it acts as write\_1-Once instead of the write-once attribute.

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2022-23005 | Host Boot ROM Code Vulnerability in Systems Implementing UFS Boot Feature | high | 8.7 | - | No | 2023-01-23 |

## Related attack patterns (CAPEC)

- [CAPEC-680](https://radicalnotion.ai/capec/capec-680): Exploitation of Improperly Controlled Registers

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-284](https://radicalnotion.ai/cwe/cwe-284) | Improper Access Control |

## Frequently asked questions

### What is CWE-1224?

The hardware design control register "sticky bits" or write-once bit fields are improperly implemented, such that they can be reprogrammed by software.

### What CVEs are caused by CWE-1224?

1 recorded CVE is attributed to CWE-1224: CVE-2022-23005.

### How do you prevent CWE-1224?

During hardware design, all register write-once or sticky fields must be evaluated for proper configuration.

### How is CWE-1224 detected?

Automated Analysis: Use automated tools to test that values are not reprogrammable and that write-once fields lock on writing zeros.

### What are the consequences of CWE-1224?

Exploiting CWE-1224 can lead to: Varies by Context, Modify Memory.

### Is CWE-1224 actively exploited?

1 recorded CVE is caused by CWE-1224; it is not currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1224.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1224). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
