←back to thread

125 points nan60 | 1 comments | | HN request time: 0.202s | source
Show context
bsuvc ◴[] No.44537604[source]
It sounds like there were two separate problems:

The first was that 123456 was the credentials for the admin panel.

The second was an insecure direct object reference, where the lead_id querystring parameter can be changed on an API call to retrieve another applicant's data.

replies(3): >>44537968 #>>44538121 #>>44538299 #
hardwaresofton ◴[] No.44537968[source]
A third problem that senior engineers might recognize: using numeric IDs on an outward facing object. UUIDs would have made this impossible as well
replies(3): >>44538043 #>>44538169 #>>44538538 #
jszymborski ◴[] No.44538538[source]
Ok, this is probably a stupid, very bad, no good idea considering I've not heard of people doing this, but can't you retain many of the benefits of numerical IDs but also the secrecy of UUIDs by using an HMAC ?

With HMAC, you can still ask for some sequential IDs

SipHash128(0, KEY) = k_0

SipHash128(1, KEY) = k_1

You get the same number of bits as a UUID.

You can't, however, sort by IDs to get their insertion sequence, however. For that you'd need something like symmetric encryption but this is already a bad idea, no reason to make it worse.

replies(1): >>44538597 #
hardwaresofton ◴[] No.44538597[source]
You could also "just" have an internal-use only numeric ID, or use a UUIDv7.
replies(2): >>44540116 #>>44542843 #
sam_lowry_ ◴[] No.44540116[source]
or ULIDs or any other partially sortable ids.
replies(2): >>44541706 #>>44543546 #
sebazzz ◴[] No.44541706[source]
ULID are not necessarily sortable, just UUIDs consensed in a shorter string by using more characters than 0-9A-F
replies(1): >>44542234 #
1. sam_lowry_ ◴[] No.44542234[source]
ULID = Unique Lexicographically sortable IDentifier ;-)