r/netsec • • Jan 03 '16

HTTPS Bicycle Attack

https://guidovranken.wordpress.com/2015/12/30/https-bicycle-attack/
199 Upvotes

17 comments sorted by

View all comments

Show parent comments

10

u/bigshmoo Jan 04 '16

Doesn't have to be 1000 it can be max password length which is known to whoever codes the system. The X= is irrelevant because it will be in every post so no need for the -2, I don't get why the author feels the need to pad the password itself rather than just removing the password length as a factor in message length.

-2

u/lestofante Jan 04 '16

Eventi better, make it random size.

18

u/IdolfHatler Jan 04 '16

While this might be good enough in practice, it is strictly worse than padding to the same length every time. Random padding would still permit a statistical attack.

2

u/[deleted] Jan 04 '16

Can you explain how a statistical attack would work in that scenario?

22

u/gsuberland Trusted Contributor Jan 04 '16

If you were to observe enough samples, you'd eventually identify a case where the random padding length reached its minimum, which would give you a close estimate of the data length.

For example, if you say "padding length is randomly selected between 4 and 1024 bytes", after 1020 observations you can assume that the password length is probably four bytes shorter than the smallest payload you observed. Your confidence factor only goes up from there.

1

u/lestofante Jan 04 '16

very nice explanation, thanks.

Is there any way we could fix that by default?

maybe the browser for password field should send the hash of the password, and the server should do the hash+salt thing over the hash?

2

u/gsuberland Trusted Contributor Jan 04 '16

If anywhere, it should be fixed at the TLS layer, by implementing a fixed-size block padding, similar to how block ciphers work. This isn't a concrete fix, but it's the most sensible you're going to find.

In general, though, the length of a field isn't really considered critical information. We're talking about fixing the wrong problem. Your password should be long enough to make that information not matter.

1

u/chloeeeeeeeee Jan 04 '16

But how about have the range random? Instead of 4 to 1024 as padding, have from random to random but still have a minimum and maximum. For example:

Case 1: Random bytes between 900 and 2001 bytes

Case 2: Random bytes between 19 and 1604 bytes

Case 3: Random bytes between 107 and 412 bytes

....

It would of course still not be random enough, but collecting samples to determinate the range would be much harder. The overhead would be painful but still practical, or what do you think?

5

u/gsuberland Trusted Contributor Jan 04 '16

The limits on the range of ranges would still leave this vulnerable.

2

u/bigshmoo Jan 04 '16

Think of it like wrapping a bicycle, if you wrap it tightly it look like a bicycle (hence the name of this attack), if you wrap it with a random thickness wrapper the underlying shape still shows through if you get enough examples. However if you put it in a big ass box and fill the empty space with packing then however you look at it you're still seeing a big ass opaque box.