Re:Hidden in plain sight: Brute-forcing Slack private files
by wtbob on Friday November 06, 2015 @08:44AM
(#10519371)
The correct answer for using URLs as capabilities (which is what a 'secret URL' really is: a capability to a resource, which can be handed out, copied &c.) is to use a 256-bit value as part of the URL. Thus, rather than 'http://example.invalid/TEAM-DOC-SHORT-RAND/' use 'http://example.invalid/w6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxT.... If you're really paranoid, double the length. I guarantee it won't be guessed, in either case.
[ Parent
| on HN ]
Re:Hidden in plain sight: Brute-forcing Slack private files
by Lazare on Friday November 06, 2015 @08:51AM
(#10519401)
Yes, exactly this. It's not rocket science; it's odd how much effort Slack put into implementing (and then reimplementing in a slightly less broken fashion) a clearly wrong solution.
Re:Hidden in plain sight: Brute-forcing Slack private files
by relaxnow on Friday November 06, 2015 @09:36AM
(#10519639)
Don't forget that it should ideally be cryptographically random. If the sequence is predictable (like based on an auto incrementing number or on time) then you might still be able to guess a 256-bit number.
Re:Hidden in plain sight: Brute-forcing Slack private files
by wtbob on Friday November 06, 2015 @11:15PM
(#10523680)
> Don't forget that it should ideally be cryptographically random.
I thought that went without saying, nut yes, it must be cryptographically random (not ideally—it must be).
Re:Hidden in plain sight: Brute-forcing Slack private files
by evancordell on Friday November 06, 2015 @10:49AM
(#10520037)
w3 has some guidelines on capability urls: http://www.w3.org/TR/capability-urls/
Re:Hidden in plain sight: Brute-forcing Slack private files
by tlb on Friday November 06, 2015 @11:47AM
(#10520387)
The guideline for unguessability in that TR just says to use a UUID. UUIDs are ugly, and quite long for the amount of randomness they contain. I prefer Slack's new 10*base36 solution.
Re:Hidden in plain sight: Brute-forcing Slack private files
by ekiru on Friday November 06, 2015 @01:33PM
(#10521065)
10 base-36 digits is only around 52 bits, compared to the 112 random bits in a UUIDv4. 2^52 might be enough for particular use-cases, but it's nowhere near a UUID in terms of randomness. Even 10 base-64 digits is only 60 bits.
Re:Hidden in plain sight: Brute-forcing Slack private files
by mikeash on Friday November 06, 2015 @12:17PM
(#10520547)
UUIDs are often guessable, too, so that recommendation is just plain wrong (or at best, woefully incomplete).
Re:Hidden in plain sight: Brute-forcing Slack private files
by bmm6o on Friday November 06, 2015 @01:11PM
(#10520910)
Right, some kinds of UUIDs achieve their uniqueness precisely by leveraging predictability. The unpredictable kind are mostly just random bits formatted in a particular (not very efficient) way.
Re:Hidden in plain sight: Brute-forcing Slack private files
by mikeash on Friday November 06, 2015 @01:33PM
(#10521070)
The random ones don't have to be unpredictable randomness, either. For example, you might seed a good RNG with the local MAC address and boot time and then use that to generate v4 UUIDs. As far as I can tell, this would be perfectly legal and should produce UUIDs that are as likely to be unique as any other, but they would also be easy for an attacker to predict.
Re:Hidden in plain sight: Brute-forcing Slack private files
by MichaelGG on Friday November 06, 2015 @02:02PM
(#10521268)
Basically the whole "version" UUIDs is a stupid fever dream. Any sane implementation should return 16 random bytes and be done. The fact that there's a spec for this and it's longer than 2 sentences is just wrong.
Re:Hidden in plain sight: Brute-forcing Slack private files
by mikeash on Friday November 06, 2015 @02:09PM
(#10521307)
I think they were just afraid of the birthday paradox. But I agree, just grabbing some random bytes really is the way to go.
Although, I'm a bit afraid of the birthday paradox, maybe we should use 20 bytes instead....
Re:Hidden in plain sight: Brute-forcing Slack private files
by MichaelGG on Friday November 06, 2015 @02:34PM
(#10521477)
The idea that a UUID should have a "version" and the random one uses 122 bits instead of 128 bits sorta makes ya wonder how concerned they were.
Re:Hidden in plain sight: Brute-forcing Slack private files
by jasonwatkinspdx on Friday November 06, 2015 @03:01PM
(#10521651)
Yeah, spot on. At least now in 2015 using 16 bytes for id's and hashes no longer seems like a lot of memory or storage.
It pains me to see people inventing weird id schemes for every app and api.