News for hackers. Stuff that matters.
Re:API Shouldn't Redirect HTTP to HTTPS by pixl97 on Tuesday May 28, 2024 @06:14PM (#40506188)
If someone is in your path they can just fake listen to 80 and intercept, then forward your call to 443.

Probably best to listen on 80 and trash the token right then as the majority of the time there won't be a MITM and breaking the application will force the developer to change to https

Re:API Shouldn't Redirect HTTP to HTTPS by jedberg on Tuesday May 28, 2024 @07:22PM (#40506646)
> If someone is in your path they can just fake listen to 80 and intercept, then forward your call to 443.

They can do that whether or not you are listening on port 80 though.

Re:API Shouldn't Redirect HTTP to HTTPS by rocqua on Wednesday May 29, 2024 @12:33AM (#40508502)
That was OPs point. Not listening on port 80 won't help against an active MitM.
Re:API Shouldn't Redirect HTTP to HTTPS by zeroimpl on Wednesday May 29, 2024 @08:37AM (#40511294)
But listening on port 80 and revoking the key also won’t help either as the active MitM would have been smart enough to internally proxy to port 443 or return some other fake response.

The real point is to break the application during development before the first MitM. Either approach does that equally well.

Re:API Shouldn't Redirect HTTP to HTTPS by comex on Tuesday May 28, 2024 @06:53PM (#40506456)
But not listening on port 80 will also usually break the application. Though I suppose the same API key may be used by multiple applications, or multiple copies of an application configured differently.

edit: and even if there's only one application, yet for whatever reason it doesn't get taken down despite being broken, revoking the key now still prevents against a MITM later.