Lurker News
Back to discussion

Comment by misterbwong

misterbwong1 reply#
The difference is that the contents of this website can be crafted by the attacker directly via the URL without having to do anything to the host.
anamexis2 replies#
How is that a meaningful attack vector, unique from webpages in general?
Syntaf2 replies#
1. Find existing smol being shared around

2. Modify the parameters to hijack any relevant content
3. Reshare the smol site with your changes under the guise it’s the original link

anamexis4 replies#
That’s not novel. You could say the same thing for a GitHub Pages page, or a Code Sandbox, or an S3 static site, or really anything.

The only reason that would be a threat is if you implicitly trusted smolsite.zip, which would be an odd thing to do.

Continue this thread — 4 replies

rmbyrro#
That's a known attack vector called phishing, no? Any website can be phished, not just smolsites
ddtaylor2 replies#
In this exact context it's likely not a problem, but essentially this is a ready to go XSS attack. As far as I can tell there is no CORS or domain level protections, so an "attacker" here could easily do anything else with any client-side data being used by any other "site" on the domain.

Let's say I make a little chat app that stores some history or some other data in local browser storage or cookies. Any other site can just as easily access all of that information. An "attacker" could link you to a modified version of the chat site that relays all of your messages to their server while still making it otherwise look like it's just the normal chat. It would also retain any client side information you had previously entered like your nick name or chat history, since it's stored in local storage.
Most of the time sanitizing input, like ensuring users don't have HTML in their names or comments, combined with domain-level separation and CORS policies ensures that one site can't do things that "leak" into another. It's the reason most of the time no matter how bad people mess things up Facebook getting hacked in your browser doesn't compromise your Google account.

rainonmoon2 replies#
Intrepid web developers reading this comment, please note that CORS is not, in fact, a protection mechanism. It's a way to relax the Same Origin Policy which is actually the protection relevant here. You don't need a CORS policy to protect a site from cross-site attacks, you need no CORS policy. Go ahead and make your little chat app, you're not at risk of having your messages stolen because of a lack of CORS headers.

Continue this thread — 2 replies

rmbyrro1 reply#
But then the attacker URL will be different.

That doesn't look like a new attack vector, this is called phishing, isn't it?
XSS means you can inject and persist code in a webpage maintaining the same URL accessed by other users.
If you create a bigbank-fake.com and copy a manipulated version of bigbank.com's HTML, this is not XSS.

Continue this thread — 1 reply