liveBook · Manning

Whole-value substitution attack

As explained in 100 SQL Server Mistakes and How to Avoid Them

A whole-value substitution attack is an attack in which an attacker replaces one encrypted record value with a ciphertext copied from another record to cause unauthorized plaintext substitution.

A whole-value substitution attack replaces one encrypted database value with a ciphertext copied from another record. Encryption can remain intact while the attacker causes an unauthorized plaintext substitution. section 14.6 section 14.8

Robin Round’s salary increase

Robin Round can read and update Employees rows without understanding encrypted salaries. He copies Bob Walford’s encrypted salary into his own row, then both decrypt to $96,000. The substitution succeeds because the ciphertext is accepted without being bound to its original record. section 14.6.2

Reduce the attack surface with these rules:

  • Use cell-level encryption sparingly; it can cause serious performance degradation and substantial storage bloat. section 14.6
  • Encrypt an authenticator alongside the sensitive value, commonly the row’s primary key, and supply that authenticator during decryption. section 14.6.2

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Demonstrates the attack, measures its decrypted effect, and applies an authenticator column to stop mismatched substitutions.
Examples
Uses encrypted employee salaries, Bob Walford and Robin Round, substitution updates, and authenticated decryption queries.
What it assumes
Assumes basic security terminology and familiarity with encrypted database columns, symmetric keys, and decryption.
What you can do after
Diagnose substitution exposure and configure authenticated cell-level encryption using a row-specific authenticator.
How it connects
Connects cell-level encryption with authenticators, symmetric keys, certificates, primary keys, and credit card fraud.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.