CWE-1304: Improperly Preserved Integrity of Hardware… | Glexia
CWE-1304 (Improperly Preserved Integrity of Hardware Configuration State During a Power Save/Restore Operation) weakness overview with consequences, detection…
Glexia's Take · Automated analysis
CWE-1304: Improperly Preserved Integrity of Hardware Configuration State During a Power Save/Restore Operation
Improperly Preserved Integrity of Hardware Configuration State During a Power Save/Restore Operation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Confidentiality,Integrity: DoS: Instability,DoS: Crash, Exit, or Restart,DoS: Resource Consumption (Other),Gain Privileges or Assume Identity,Bypass Protection Mechanism,Alter Execution Logic,Quality Degradation,Unexpected State,Reduce Maintainability,Reduce Performance,Reduce Reliability
Developer Pattern
CWE-1304 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Automation confidence
high confidence from CWE-1304, 4.20.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Official CWE Definition
CWE-1304: Improperly Preserved Integrity of Hardware Configuration State During a Power Save/Restore Operation
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.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- The following pseudo code demonstrates the power save/restore workflow which may lead to weakness through a lack of validation of the config state after restore. The following pseudo-code is the proper workflow for the integrity checking mitigation:,It must be noted that in the previous example of good pseudo code, the memory (where the hash of the config state is stored) must be trustworthy while the hardware is between the power save and restore states.
Remediation
- 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.
- Integration: 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.
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.
