Weakness · High
CWE-1304: Improperly Preserved Integrity of Hardware Configuration State During a Power Save/Restore Operation
What it is
The product performs a power save/restore operation, but it does not ensure that the integrity of the configuration state is maintained and/or verified between the beginning and ending of the operation.
- Severity (our rating)
- High
- Likelihood of exploit
- Not rated by MITRE
- Introduced during
- Architecture and Design, Integration
- Exploited in the wild
- No CVE in CISA's catalog
In more detail
Before powering down, the Intellectual Property (IP) saves current state (S) to persistent storage such as flash or always-on memory in order to optimize the restore operation. During this process, an attacker with access to the persistent storage may alter (S) to a configuration that could potentially modify privileges, disable protections, and/or cause damage to the hardware. If the IP does not validate the configuration state stored in persistent memory, upon regaining power or becoming operational again, the IP could be compromised through the activation of an unwanted/harmful configuration.
What an attacker can do
- DoS: Instability (Confidentiality, Integrity)
- DoS: Crash, Exit, or Restart (Confidentiality, Integrity)
- DoS: Resource Consumption (Other) (Confidentiality, Integrity)
- Gain Privileges or Assume Identity (Confidentiality, Integrity)
- Bypass Protection Mechanism (Confidentiality, Integrity)
- Alter Execution Logic (Confidentiality, Integrity)
- Quality Degradation (Confidentiality, Integrity)
- Unexpected State (Confidentiality, Integrity)
- Reduce Maintainability (Confidentiality, Integrity)
- Reduce Performance (Confidentiality, Integrity)
- Reduce Reliability (Confidentiality, Integrity)
How to prevent it
Architecture and Design
- Inside the IP, incorporate integrity checking on the configuration state via a cryptographic hash. The hash can be protected inside the IP such as by storing it in internal registers which never lose power. Before powering down, the IP performs a hash of the configuration and saves it in these persistent registers. Upon restore, the IP performs a hash of the saved configuration and compares it with the saved hash. If they do not match, then the IP should not trust the configuration.
Integration
- Outside the IP, incorporate integrity checking of the configuration state via a trusted agent. Before powering down, the trusted agent performs a hash of the configuration and saves the hash in persistent storage. Upon restore, the IP requests the trusted agent validate its current configuration. If the configuration hash is invalid, then the IP should not trust the configuration.
- Outside the IP, incorporate a protected environment that prevents undetected modification of the configuration state by untrusted agents. Before powering down, a trusted agent saves the IP's configuration state in this protected location that only it is privileged to. Upon restore, the trusted agent loads the saved state into the IP.
H2 Security
Found it in your code?
We review where it appears, fix it with your team, and check it was not already used against you.
Talk to our teamT Academy
Stop writing it in the first place
Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.
Start freeSource: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.