News for hackers. Stuff that matters.
Re:API Shouldn't Redirect HTTP to HTTPS by grantism on Tuesday May 28, 2024 @10:58PM (#40507980)
What's stopping the MITM just copying that header?
Re:API Shouldn't Redirect HTTP to HTTPS by gruez on Tuesday May 28, 2024 @11:29PM (#40508148)
There's complicated authentication schemes around hmac that tries to do this, but if you're putting that much effort into it you might as well give up and use https.
Re:API Shouldn't Redirect HTTP to HTTPS by dcow on Wednesday May 29, 2024 @02:10AM (#40508984)
Some of these include a nonce and/or are deployed over TLS to prevent replay attacks and avoid sending bearer tokens over the wire. AWS sig v4 and RFC7616 come to mind.
Re:API Shouldn't Redirect HTTP to HTTPS by 4death4 on Wednesday May 29, 2024 @12:59AM (#40508623)
Even if the copy the header, they can only perform a replay attack, which is an improvement over leaking an API key. Also, you could include a timestamp in the signature to limit the amount of time it could be replayed.
Re:API Shouldn't Redirect HTTP to HTTPS by dcow on Wednesday May 29, 2024 @01:53AM (#40508895)
Sign a nonce.
Re:API Shouldn't Redirect HTTP to HTTPS by amscanne on Sunday June 02, 2024 @03:18PM (#40556556)
It’s preventing the theft of the API key. The attack can, at most, replay that specific request (which you could also mitigate with a nonce and expiration).