Side-Channel attacks

Side-Channel Attacks

Overview

A side-channel attack is a type of security exploit where an attacker gathers information from the physical implementation of a system rather than exploiting weaknesses in the software or algorithm itself. These attacks focus on indirect methods of extracting secret data, such as timing information, power consumption, electromagnetic leaks, or sound produced during the execution of cryptographic algorithms or other sensitive operations.

Side-Channel Attacks in Different Environments

IoT

Attackers perform a side-channel attack by extracting information about encryption keys by observing the emission of signals, i.e., "side channels" from IoT devices. All devices emit these signals that provide information about the internal computing process, either via power consumption or electromagnetic emanations. Attackers carefully observe side-channel emissions to acquire all possible knowledge about varying power consumption so they can access and duplicate the encryption key non-evasively. The main advantage of this attack is that it is easy and requires less time to access encryption keys. Information leaked from the vulnerable devices helps the attackers to exploit other side-channel techniques, such as performing power-consuming attacks and time-based attacks.

OT

Side-Channel Attacks on OT Systems

Overview

Attackers perform a side-channel attack by monitoring physical implementation of a target system to obtain critical information. Attackers use two techniques, namely timing analysis, and power analysis to perform side-channel attacks on the target OT systems. The timing-analysis attack is based on the amount of time taken by the device to execute different computations. The power analysis attack is based on the change in power consumption during a cryptographic operation. ICS systems are often vulnerable to these two side-channel attacks.

Attack Techniques

Timing Analysis

Passwords are often transmitted through a serial channel. Attackers employ a loop strategy to recover these passwords. They use one character at a time to check whether the first character entered is correct; if so, the loop continues for consecutive characters. If not, the loop terminates. Attackers check how much time the device is taking to finish one complete password authentication process, through which they can determine how many characters entered are correct. The timing-based attacks can be easily detected and blocked.

Power Analysis

Power-analysis attacks are difficult to detect; the attacked device can operate even after being infected. Therefore, attackers often prefer to perform a power-analysis attack rather than a timing-based one to recover the sensitive information.

This attack is performed observing the change in power consumption of semiconductors during clock cycles. The oscilloscope observes the time slot between two pulses via the probe. The power profile formed by the signals can leave a clue as to in what way the data is being processed.

For instance, by observing the power profile, one character of the password can be retrieved when the correct character entered is compared with the wrong character. The cryptographic key can also be obtained using the same method. Attackers can gain physical access over the unprotected or unsupervised device. Then, they use an oscilloscope and a special hardware device that run on the analysis software to recover the cryptographic keys.

Attackers can use the retrieved keys to make changes in the configuration of analyzed devices. As these systems are mostly utilized in protecting the power grids, the configuration changes can have devastating impacts. Through these changes, attackers can hinder the system process or use it to transfer incorrect data to the operator. These devices are often distributed and handled by a centralized system. Incorrect data from one device can impact major parts of the OT network.

Figures

Figure 18.83: Illustration of side-channel attack

Cloud

Side-Channel Attacks or Cross-guest VM Breaches

Attackers can compromise the Cloud by placing a malicious virtual machine near a target cloud server and then launch a side-channel attack. The below figure show how an attacker can compromise the cloud by placing a malicious VM near a target cloud server. The attacker runs the VM on the same physical host as the target VM and takes advantage of the shared physical resources (processor cache). Then, he launches side-channel attacks (timing attack, data remanence, acoustic cryptanalysis, power monitoring attack, and differential fault analysis) to extract cryptographic keys/plain text secrets to steal the victim's credentials. Side-channel attacks can be implemented by any co-resident user and are mainly related to vulnerabilities in shared technology resources. Finally, the attacker uses the stolen credentials to impersonate the victim.

Cross-guest VM Breaches-1759777457407.webp

Side-Channel Attack Countermeasures

  • Implement a virtual firewall in the cloud server back-end of the cloud computing; this prevents the attacker from placing malicious VMs
  • Implement random encryption and decryption (encrypts data using RSA, 3DES, AES algorithms)
  • Lockdown OS images and application instances to prevent compromising vectors that might provide access
  • Check for repeated access attempts to local memory and to any hypervisor processes or shared hardware cache by tuning and collecting local process monitoring data and logs for cloud systems
  • Code the applications and OS components so that they access shared resources, such as memory cache, in a consistent and predictable way. This coding style prevents attackers from collecting sensitive information, such as timing statistics and other behavioral attributes

Cryptography

Side-Channel Attack A side-channel attack is a physical attack performed on a cryptographic device/cryptosystem to gain sensitive information. Cryptography is generally part of the hardware or software that runs on physical devices such as semi-conductors (resistor, transistor, and so on) that interact with and affect various environmental factors as follows:

Types of Side-Channel Information

Power Consumption

Reveals operations that take place and parameters involved. It is applicable only to hardware cryptosystems. Power consumption analysis is of two types:

Electromagnetic Field

Computer components often generate electromagnetic radiation. By measuring the variations of the electromagnetic field over the chip surface, an attacker can predict its correlation to the underlying computation and data and may be able to deduce some valuable information about this computation and data.

Light Emission

Kuhn found that the average luminosity of a cathode ray tube (CRT) diffuse reflection of a wall is sufficient to reconstruct the signal displayed on the CRT. Thus, an attacker can gather ample information by reading the signals that a trusted computing platform's optical output channels emit.

According to Loughry and Umphress, one can deduce the data a computer is processing based on the optical radiation emitted from its LED (light-emitting diode) status indicators.

Timing and Delay

Systems often compute cryptographic algorithms without time consistency owing to performance optimizations. If such computations involves secret data, then the variations in time can be used to infer the secret information. Here, the attacker analyzes the time taken by a cryptographic device to process each message to discover the secret parameters.

It is based on repeatedly measuring the exact execution times of modular exponentiation operations. The attacker tries to break the ciphertext by analyzing the time taken to execute the encryption and decryption algorithm for various inputs. In a computer, the time taken to execute a logical operation may vary based on the input given. An attacker tries to extract the plaintext by giving varying inputs.

  • A direct timing attack is carried out by measuring the time taken by the server to process a POST request. By observing these timings, attackers can deduce the existence of a username.
  • In addition, attackers perform ==character-by-character password examination and exploit the timing information to determine where the password comparison failed.== They then use this data to determine the target user’s Password.
  • Video-parsing Attack

  • Cache Storage Timing Attack

  • These attacks take advantage of browser side-channel leaks to estimate how long it takes for a browser to process a requested resource (e.g., video or cache data).

  • Attackers may use browser functionality like video parsing attacks or cache storage timing attacks to measure processing times.

The Cache API provides an interface for loading, fetching, and deleting resources from the browser’s cache. The time taken to load resources from the disk depends on the resource size.

Attackers can estimate the time taken to load a resource from the cache and, in turn, infer the size of the resource. This can lead to further exploitation of information about the stored resources.

  • A cross-site timing attack is a type of attack where attackers send crafted request packets to a website using Javascript. Unlike a direct timing attack where the attacker passes the request directly, in this attack, the attacker sends the request through the user’s browser.
  • For instance, consider a website http://xyz.com with two separate groups: /the-prompt/ and /the-anonymous-place/. Only group members have access to the data fed into these groups. If a non-member tries to access the group, an error message is generated.
  • An attacker can use malicious JavaScript injected into another webpage to find out which group the user belongs to, violating their privacy. The JavaScript can measure the time taken to access both groups and determine which one the user belongs to based on the response time.
function getMeasurement(url, callback) {
  var a = new Image();
  a.addEventListener('error', function() {
    var conclude = performance.now();
    callback(conclude - begin);
  });
  var begin = performance.now();
  a.src = url;
}

getMeasurement('http://xyz.com/the-prompt/', function(timeTF) {
  getMeasurement('http://xyz.com/the-anonymous-place', function(timeTDS) {
    if (timeTF > timeTDS) {
      alert('The prompt is alright!');
    } else {
      alert('Privacy breach!');
    }
  });
});



The Cross-site Timing Attack is a specific type of side-channel vulnerability used against web applications, relying on precise time measurements to extract sensitive information.

Here is a detailed breakdown of the attack:

🎯 Cross-site Timing Attack: Definition and Mechanism

A Cross-site Timing attack is defined as another type of timing attack in which attackers send crafted request packets to the website using JavaScript.

Mechanism

  1. Injection: The attack relies on malicious JavaScript injected by the attacker.
  2. Request Handling: Unlike a Direct timing attack (which measures the time taken by the server to process a POST request), in a Cross-site Timing attack, the attacker himself/herself parses the request to a website.
  3. Measurement: The attacker then analyzes the time consumed by the user to download the requested file.

This technique, along with Direct timing attacks and Browser-based timing attacks, falls under the category of Web-based Timing Attacks, which are a type of side-channel attack performed to retrieve sensitive information, such as passwords, by measuring the response time taken by the server.

The sources differentiate the Cross-site Timing attack from the Video-parsing Attack (another sophisticated attack) by noting that in the video-parsing attack, the estimation time begins when the event "suspend" is triggered, and the resource requested is not an intended video.

⏱️ Context: Timing Attacks as Side Channels

All timing attacks, including the Cross-site Timing attack, are classified as side-channel attacks.

A side-channel attack is an exploit based on information gained from the implementation of a computer system, rather than flaws in the algorithm itself.

  • Information Leakage: Timing information, power consumption, electromagnetic leaks, or even sound can provide an extra source of information, which can be exploited.
  • Cryptographic Exploits: In cryptography, a timing attack is based on repeatedly measuring the exact execution times of modular exponentiation operations used in encryption and decryption algorithms to break the ciphertext and extract the plaintext.
  • Wireless Exploits: Timing attacks have also been found to be vulnerabilities in certain implementations of WPA3's SAE protocol (used for wireless network security), allowing attackers to potentially recover the password by analyzing the time taken by the Dragonfly handshake to encode the password authentication process.

Timing attacks are a category of sophisticated side-channel attacks that exploit differences in the time a system takes to complete computational tasks to deduce secret information, such as passwords, cryptographic keys, or user data.

This attack relies on observing the implementation of a computer system rather than weaknesses in the algorithm itself.

I. Timing Attacks in Cryptography and Systems

In a general sense, a timing attack measures the exact execution times of operations to infer secret information.

  • Mechanism: Timing attacks are based on the principle that the time required to execute a logical operation often varies based on the input data given. By analyzing the time taken for cryptographic devices to process a message, attackers can infer secret information.
  • Cryptographic Exploitation: Attackers repeatedly measure the execution times of modular exponentiation operations, attempting to break the ciphertext by analyzing the time taken to execute the encryption and decryption algorithms for various inputs.
  • Side-Channel Context: Timing attacks fall under the umbrella of side-channel attacks, which exploit unintended information leakage from a physical system (like power consumption or sound). Timing information is one of the channels monitored.

II. Types of Timing Attacks

Timing attacks are utilized across various technological layers, including web applications, operating technologies (OT), and wireless networks.

A. Web-based Timing Attacks

Web-based timing attacks retrieve sensitive information (like passwords) from web applications by measuring the response time taken by the server to process a request. Types include:

  1. Direct Timing Attack: Attackers measure the approximate time taken by the server to process a POST request to deduce the existence of a username. Attackers also use similar timing information to determine where the password comparison failed and subsequently determine the target user's password.
  2. Cross-site Timing Attack: Attackers use JavaScript to send crafted request packets to the website. The attacker measures the time consumed by the user to download the requested file.
  3. Browser-based Timing Attack: These are sophisticated side-channel attacks where attackers estimate the time taken by the browser to process requested resources. Attackers exploit browser functionalities to launch further attacks, such as video parsing attacks and cache storage timing attacks.

B. Timing Attacks in SQL Injection

Timing attacks are a key component of Blind/Inferential SQL Injection when error messages are unavailable to the attacker.

  • Time-based SQL Injection: This method evaluates the time delay that occurs in response to true or false queries sent to the database.
    • Mechanism: Attackers use statements like WAITFOR DELAY (in Microsoft SQL Server) or BENCHMARK() and sleep() (in MySQL) to intentionally pause the database execution for a specified amount of time (e.g., 10 seconds) if a condition (the query) is true.
    • Deduction: If the attacker observes the specified delay in the HTTP response, they confirm that the query was TRUE, allowing them to extract information like the database name character by character.
  • Heavy Queries: When time delay functions are disabled, attackers use heavy queries (e.g., executing multiple joins on system tables) to retrieve a massive amount of data, causing a long execution time that substitutes the delay function in a time-based attack.
  • Double-Blind SQL Injection: This exploitation technique heavily depends on time-delay analysis to infer successful injection where no error messages or direct output are available.

C. Timing Attacks in Wireless and OT Systems

Timing attacks are used to exploit time-sensitive cryptographic processes in network protocols and operational technology (OT) systems.

  • WPA3: Certain implementations of Simultaneous Authentication of Equals (SAE), also known as the Dragonfly handshake, used in WPA3 wireless security, are vulnerable to timing attacks.
    • Mechanism: The attacker analyzes the time taken by the Dragonfly handshake to encode a password authentication process. By observing the iterations of the encoding process, the attacker can short-list possible passwords to launch further attacks.
  • OT Systems: In OT systems (such as SCADA), Timing Analysis is used to monitor the amount of time a device takes to finish a complete password authentication process. The attacker uses a loop strategy to recover the password one character at a time: if the correct character is entered, the loop continues for consecutive characters, but if the wrong character is entered, the loop terminates. This determines how many characters are correctly entered.
  • Honeypot Detection: Attackers analyze the response time of network services to detect honeypots, as these deceptive systems often exhibit slower or inconsistent response times due to additional logging and monitoring layers. This process is measured using tools like Ping, Traceroute, and Nmap.

IV. Mitigation and Countermeasures

To mitigate timing attacks, cryptographic algorithms and system implementations must be designed to eliminate predictable timing variations.

  • Code Consistency: Code applications and OS components should be designed to access shared resources, such as memory cache, in a consistent and predictable way.
  • Timing Variations: Implement cryptographic algorithms and protocols in constant-time to eliminate timing variations that can be exploited by timing attacks.
  • Data-Independent Delays: Use fixed-time algorithms and fixed-time properties to reduce side-channel leakage, especially regarding key updates.
  • Key Stretching: Implement key stretching algorithms (a function that expends considerable effort to generate an enhanced key) to slow down brute-force attackers by ensuring each guess takes a similar amount of time to process.

Sound

Acoustic attacks exploit the sound produced during a computation. These acoustic emissions are from keyboards and computing components (e.g., CPU, memory)

Attack Methodology

In a side-channel attack, an attacker monitors these channels (environmental factors) and tries to acquire useful information for cryptanalysis. The information thus acquired is termed as side-channel information. Side-channel attacks are different from traditional/theoretical forms of attacks such as brute-force attacks. The side-channel attack depends on the way in which systems implement cryptographic algorithms rather than the algorithm itself.

Side-Channel Attack Scenario

Assume that encrypted data are to be decrypted and displayed as plaintext inside a trusted zone. At the time of decryption in a cryptosystem, physical environmental factors, such as timing and power dissipation, acting on the components of a computer are recorded by an attacker. The attacker then analyzes this information to gain useful information for cryptanalysis.

Mitigation Techniques for Side-Channel Attacks