banner

Attack: How to break XML Encryption

This article is aimed to high technical skill.

I have found one excellent technical article, it's about XML Encryption and how you can break it. A long of article you can know What and Why is used XML Encryption.

Why XML are implemented?

The author of article, propouse us the following case of use:

The one upshot of this XML ... -- were supposed to help application developers process data in a reliable and secure way. One of those standards is SOAP, which is used to transport data in web services frameworks, and the other standard is the W3C XML Encryption Standard, which was dropped like a log in 2002 and doesn't seem to have been updated since. 

XML are used in SOAP (Simple Object Access Protocol), is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on Extensible Markup Language (XML) for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

Obviously XML encryption is the way of protected the information into the XML structure, and is used by SOAP to establish secure comunications between applications.

Finally, a very common implementation of both standards can be found in the Apache Axis2 web services framework and in the RedHat JBoss framework. These are probably the most common open-source SOAP frameworks.

What are the typical XML Ecryption used?

The protection choosed by XML is the W3C standard recommends what encrypt messages using a block cipher configured using (our old friend) CBC-mode.

 
There are two basic things you need to know about CBC mode, and ought to know if you ever plan to use it.
  • First: CBC requires that every plaintext be an even multiple of the block size. In the case of AES, this means 16 bytes.
  • Second: CBC ciphertexts are malleable. This means that you can modify a CBC-encrypted ciphertext such that your modifications will carry through decryption, and have a meaningful effect on the resulting decrypted plaintext
 But all of this are analyzed in the original article, and I recomended you read it.

How you can Attack to XML Encryption?

You need two things:

  1. Know how XML messages are formatted.
  2. Know how to aplied the Tibor Jager and Juraj Somorovsky's method.
All of this you can find it better explain than me in the original article and the Somorovky method, but esentially the method is base on the following steps:

Imagine that you've intercepted a legitimately-encoded, encrypted XML message (IV, C1, ..., CN) and you want to know what it say ....
  • Step 1: Truncate the ciphertext
  • Step 2: Tweak the padding.
  • Step 3: Squish the bug(s).
  • Step 4: Learn the last byte of the block.
  • Step 5: Learn everything else. 
  • Step 6: Finish it.     

The complete text is into the "How to Break XML Encryption Whitepaper", and a little overview is in this post.

How  Can I prevent of this?

These attacks can almost always be prevented with proper authentication of the ciphertexts. If the decryptor checks that the ciphertexts are valid before decrypting them, the attacker can't tamper with them. Hence, no useful information should leak out to permit these attacks at all.

Fuentes http://www.team-cymru.org/ | http://practicalcrypto.blogspot.com/ | How To Break XML Ecryption

No hay comentarios :

Publicar un comentario en la entrada