 If the server returns an "invalid padding" error instead of a generic "decryption failed" error, the attacker can use the server as a padding oracle to decrypt (and sometimes encrypt) messages.The mathematical formula for CBC decryption is

As depicted above, CBC decryption XORs each plaintext block with the previous ciphertext block.As a result, a single-byte modification in block formula_3 will make a corresponding change to a single byte in formula_4.