Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

CBC-R: It's not just for padding oracles!

This is the short, technical version of a technique that I'll be writing more about in a few days. This blog post is geared towards readers already familiar with current topics in cryptanalysis.

In Rizzo and Duong's paper on practical padding oracle attacks, the section on CBC-R states "CBC-R turns decryption oracles into encryption oracles." They describe their technique as an extension of what Vaudenay wrote in his 2002 Eurocrypt paper on security flaws induced by CBC padding. However, as I describe below, Rizzo and Duong's technique is also applicable to decryption oracles operating in CBC mode. This application was not described in their paper and I'm not sure if Rizzo and Duong realized its potential for decryption oracles, but so far I have not been able to find any public documentation on the use of CBC-R apart from discussion on padding oracle attacks.

 

CBC-R applied to decryption oracles

When performing CBC-R attacks using padding oracles as described by Rizzo and Duong, the first step is to discover the plaintext using Vaudenay's attack. Since we already have a mechanism for obtaining the plaintext of the entire message, we can construct our own message.

From here on, blocks will be referred to using C or P to indicate ciphertext or plaintext, a number to indicate the position of the block, ^ as an XOR operation, and ' to indicate that the block is the version of the block as it exists in the final message we are constructing.

If we have a message with two blocks and the IV included, we start by running the message through our decryption oracle. We now have the plaintext and ciphertext for each block. C2 remains the same, thus C2 = C2'. We calculate C1' as (C1 ^ P2 ^ P2').

We now submit the following, concatenated, to the decryption oracle: IV, C1', C2. This provides us with the new P1, which is garbled because we tampered with C1. We now calculate IV' as (IV ^ P1 ^ P1').

We now have the ciphertext for our newly constructed message: IV', C1', C2.

This technique, when applied to a decryption oracle, allows for encryption with far fewer requests to the oracle: only one per block!

 

Implications

This makes the discovery of a decryption oracle potentially far more dangerous. Being able to decrypt the contents of any message using the same key and cipher is bad enough, but when you can use the same oracle as an encryption oracle, the layer of encryption may as well not exist. In addition, this technique requires no requests to the oracle that result in decryption-related errors. By contrast, CBC-R as an extension to Vaudenay's attack requires up to 255 errors per decrypted byte and 256 requests per byte, making it relatively easy to spot in server logs since the traffic is so unusual.

As in the case of the original description of CBC-R, this technique does not require the use of any specific block cipher. Unlike the original description of CBC-R, this technique does not require a specific type of padding. This attack requires only a decryption oracle operating in CBC mode.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo