CAPEC-463: Padding Oracle Crypto Attack

Detailed Draft 严重程度: High

CAPEC版本: 3.9

更新日期: 2023-01-24

攻击模式描述

An adversary is able to efficiently decrypt data without knowing the decryption key if a target system leaks data on whether or not a padding error happened while decrypting the ciphertext. A target system that leaks this type of information becomes the padding oracle and an adversary is able to make use of that oracle to efficiently decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). In addition to performing decryption, an adversary is also able to produce valid ciphertexts (i.e., perform encryption) by using the padding oracle, all without knowing the encryption key.

前提条件

  • The decryption routine does not properly authenticate the message / does not verify its integrity prior to performing the decryption operation
  • The target system leaks data (in some way) on whether a padding error has occurred when attempting to decrypt the ciphertext.
  • The padding oracle remains available for enough time / for as many requests as needed for the adversary to decrypt the ciphertext.

所需资源

缓解措施

Design: Use a message authentication code (MAC) or another mechanism to perform verification of message authenticity / integrity prior to decryption

Implementation: Do not leak information back to the user as to any cryptography (e.g., padding) encountered during decryption.

示例实例

An adversary sends a request containing ciphertext to the target system. Due to the browser's same origin policy, the adversary is not able to see the response directly, but can use cross-domain information leak techniques to still get the information needed (i.e., information on whether or not a padding error has occurred). This can be done using "img" tag plus the onerror()/onload() events. The adversary's JavaScript can make web browsers to load an image on the target site, and know if the image is loaded or not. This is 1-bit information needed for the padding oracle attack to work: if the image is loaded, then it is valid padding, otherwise it is not.

关键信息

CAPEC ID: CAPEC-463

抽象级别: Detailed

状态: Draft

典型严重程度: High

相关攻击模式