4 ms·
>(“using the API of local services” seems to be an ongoing theme, one of my favourite things is to use secret undocumented APIs where you need to copy your cook
by TrapLord_Rhodo 5y ago
>(“using the API of local services” seems to be an ongoing theme, one of my favourite things is to use secret undocumented APIs where you need to copy your cookies out of the browser to get access to them)
Would love more information about this one
- jrkatz 5y agoA basic step for securing a resource intensive API from DDOS attacks and some user impersonation attacks is to rely on a security token in a cookie set in the response to an earlier request. For example, a user may land on a web page and receive a unique, encrypted, short-lived security token cookie that is marked http only (inaccessible to javascript), plus a copy of the token in cleartext. When the user agent later polls an expensive API, it must send the cleartext token as part of the request. Server-side, that's compared to the encrypted copy (received from the cookie) and the expensive call is terminated early if they do not match. A DDOS attack that relies on a malicious ad or web page directing user agents to poll your expensive API in a loop will no longer work as well, because those user agents will not have the correct security token cookie value, and the attacker is unable to figure out what the correct value is for any given user agent running their malicious code. More sophisticated/expensive attacks are still available, but anything is an improvement. There are a few ways to skin this cat, so don't refer to the above as a how-to-guide - find a more authoritative voice on best practices than me, please, if you try to implement security like this. Anyhow, if you want to use an API implementing security like this, you copy the cookies out of your browser and feed them to your program so it can add them to the calls.
- bloqs 5y agoThis is something I could never grasp. How on earth do you discover those things?