Weakness · High

CWE-1255: Comparison Logic is Vulnerable to Power Side-Channel Attacks

What it is

A device's real time power consumption may be monitored during security token evaluation and the information gleaned may be used to determine the value of the reference token.

MITRE CWE 4.19.1

Severity (our rating)
High
Likelihood of exploit
Not rated by MITRE
Introduced during
Architecture and Design, Implementation
Exploited in the wild
No CVE in CISA's catalog

In more detail

The power consumed by a device may be instrumented and monitored in real time. If the algorithm for evaluating security tokens is not sufficiently robust, the power consumption may vary by token entry comparison against the reference value. Further, if retries are unlimited, the power difference between a "good" entry and a "bad" entry may be observed and used to determine whether each entry itself is correct thereby allowing unauthorized parties to calculate the reference value.

What an attacker can do

  • Modify Memory (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Read Memory (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Read Files or Directories (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Modify Files or Directories (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Execute Unauthorized Code or Commands (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Gain Privileges or Assume Identity (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Bypass Protection Mechanism (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Read Application Data (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Modify Application Data (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)
  • Hide Activities (Confidentiality, Integrity, Availability, Access Control, Accountability, Authentication, Authorization, Non-Repudiation)

How to prevent it

Architecture and Design

  • The design phase must consider each check of a security token against a standard and the amount of power consumed during the check of a good token versus a bad token. The alternative is an all at once check where a retry counter is incremented PRIOR to the check.
  • Another potential mitigation is to parallelize shifting of secret data (see example 2 below). Note that the wider the bus the more effective the result.
  • An additional potential mitigation is to add random data to each crypto operation then subtract it out afterwards. This is highly effective but costly in performance, area, and power consumption. It also requires a random number generator.

Implementation

  • If the architecture is unable to prevent the attack, using filtering components may reduce the ability to implement an attack, however, consideration must be given to the physical removal of the filter elements.

Integration

  • During integration, avoid use of a single secret for an extended period (e.g. frequent key updates). This limits the amount of data compromised but at the cost of complexity of use.

CWE-1255 on MITRE's CWE site

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 team

T 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 free

Source: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.