4 ms·
Why on earth would you do that? If you want to prevent users from altering their time use your server and do a time compare with your server. NTP can be easil
by sschueller 10y ago
Why on earth would you do that?
If you want to prevent users from altering their time use your server and do a time compare with your server.
NTP can be easily intercepted and altered so it would make a lot more sense to do this via a encrypted certificate pinned communication path increasing my work load drastically to alter the time.
I snapchat going to pay for the DDOS they created?
- sleepychu 10y agoThe way they achieved their goal was misguided but what you've described skips over large parts of the problem. Why would the server time and phone time be in sync?
- jstanley 10y agoThey could just use their own canonical time (from their server) instead of hammering NTP. It doesn't say anything about synchronisation between phone and server. EDIT: In fact it is easier to implement it this way than using NTP. I've implemented something similar and I found it easier to add an API endpoint that returns time() than to ship an NTP client...
- Diamons 10y agoBut then you need to manage a server and ensure that the time is running accurately. Why add such a large level of responsibility for little to no gain?
- jstanley 10y agoHow is that extra responsibility? Do you think Snapchat aren't already running servers? And you don't care whether the time on the server is running accurately if you're just using it to generate tokens which are checked against the time on the server. It just needs to be consistent, it could be an arbitrary counter and would still work fine as long as it counted up reliably at consistent intervals.
- Fnoord 10y agoBecause instead of depending on a 3rd party, you depend on yourself (and in this case you'd hammer your own server, and notice). It is not far fetched; Windows and OS X work this way. By default, they use their own NTP servers. OS X even has separate servers for different regions (Europe, Asia, and Americas).
- mulmen 10y agoThey could at least be good citizens and use their success to beef up the NTP pool.
- paulgear 10y agoBecause that's the point of NTP; internally both operating systems use UTC, and in practice most clients can be in sync to within 1 ms or so of the true time, given reasonable connection speed and quality.
- CaptSpify 10y agoStupid decision by SC for sure, but is there a reason there is no rate-limiting on the NTP servers? I'm not up to date on their structure. Maybe it's just not feasible because they don't synchronize clients?
- dfox 10y agoEven without thinking about storing some context, replying to NTP request is probably similarly expensive as evaluating whether it should be rate limited.
- coderholic 10y agoYeah exactly this. Rate limiting isn't free. It's almost certainly more expensive to rate limit than to statelessly respond with the time.
- paulgear 10y agoNTP does store context for a limited number of clients (600 by default). https://www.eecis.udel.edu/~mills/ntp/html/miscopt.html https://www.eecis.udel.edu/~mills/ntp/html/miscopt.html
- devicenull 10y agoThe NTP servers are all run by random members of the community. There's no real coordination between them (outside of being part of the pool), so you can't really rate limit between servers. The library was only doing a couple request per NTP server, so rate limiting really wouldn't have helped.
- paulgear 10y agoNTP has rate limiting built into the protocol (https://www.eecis.udel.edu/~mills/ntp/html/accopt.html https://www.eecis.udel.edu/~mills/ntp/html/accopt.html), but Snapchat appear to be using a large list of servers. Also, NTP runs on UDP rather than TCP, and it only requires one packet from each party to exchange time, so it's harder to rate-limit it without making your server unreliable.