Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Trustwave SpiderLabs Uncovers Ov3r_Stealer Malware Spread via Phishing and Facebook Advertising. Learn More

Services
Capture
Managed Detection & Response

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

twi-managed-portal-color
Co-Managed SOC (SIEM)

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

twi-briefcase-color-svg
Advisory & Diagnostics

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

tw-laptop-data
Penetration Testing

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

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

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

tw-officer
Digital Forensics & Incident Response

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

tw-network
Firewall & Technology Management

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

Solutions
BY TOPIC
Microsoft Exchange Server Attacks
Stay protected against emerging threats
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
SpiderLabs Blog

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.

Latest SpiderLabs Blogs

Welcome to Adventures in Cybersecurity: The Defender Series

I’m happy to say I’m done chasing Microsoft certifications (AZ104/AZ500/SC100), and as a result, I’ve had the time to put some effort into a blog series that hopefully will entertain and inform you...

Read More

Trustwave SpiderLabs: Insights and Solutions to Defend Educational Institutions Against Cyber Threats

Security teams responsible for defending educational institutions at higher education and primary school levels often find themselves facing harsh lessons from threat actors who exploit the numerous...

Read More

Breakdown of Tycoon Phishing-as-a-Service System

Just weeks after Trustwave SpiderLabs reported on the Greatness phishing-as-a-service (PaaS) framework, SpiderLabs’ Email Security team is tracking another PaaS called Tycoon Group.

Read More