Are there security issues with adding plaintext length to TLS packets? I have quite a big problem, because of a software implementation of TLS I had to adapt I had to create something which is now biting me.
It all comes down to this: I need to know the length of the plaintext when I want to decrypt it and the length of the ciphertext when I want to encrypt it. For the 2nd one I've made a (not so nice) workaround.
I have a workaround for the first problem, simply using TLS to encrypt the plaintext and then add a few bytes for the plaintext length and send this over.
So my question is: how big is the security risk if an attacker can see the plaintext length if i would send it in the clear together with the TLS protocol packet?
(more details here)
Not so high, the size of the plaintext should be known in advance. For all the stream cipher based cipher suites, including the ones with the newer authenticated ciphers the size of the plaintext can be directly derived from the ciphertext.

CBC mode only hides the plaintext length in the bounds of the block size - if that. You can however possibly abuse this to create a covert channel. Furthermore, you would be working out of spec - your scheme would not be compatible with TLS. You would only save up to the block size in bytes in your implementation at most, so the returns would be very small.

You may be better off choosing a cipher suite that uses a stream cipher instead. In that case the plaintext and ciphertext have the same length. Currently however that means RC4 or GCM mode encryption in TLS 1.2. In case of GCM you may have to subtract the size of the tag from your calculations of course.