Live data from Hacker News

A file that's both an acceptable HTML page and a JPEG (view source on it)

lcamtuf.coredump.cx

111–120 of 133 posts

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#112
post #83

Earlier quoted context omitted.

WATCH IT. This file hard-froze my machine (osx/chrome) and I now have to rebuild my dev environment.

How does a hard freeze force you to rebuild your dev env?

Someone doesn't use dotfiles, I'm guessing.

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#113
post #26

Perhaps I don't know enough about how this works, but couldn't you use this to inject runnable javascript in to a page? If this is possible it's pretty scary as it would allow you to upload a hidden payload in to an otherwise innocent looking image.

Yes, certain versions of IE can be tricked into executing javascript in images: http://www.h-online.com/security/features/Risky-MIME-sniffin...

Indeed: https://code.google.com/p/browsersec/wiki/Part2#Survey_of_co...

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#115
post #84

Earlier quoted context omitted.

I wrote up a little explanation of how it works here https://gist.github.com/3039247

Very interesting, thanks! By the way, the for loop seems to be irrelevant to the invocation, (1,eval) just returns eval. (1,console.log)("hi") looks like it should work, except it raises an error. (1,2)+3 returns 5, however, and (1,console.log) returns the log function.

it's a performance thing. i forgot the details, but if you change the `(1,eval)` to `eval`, it's all much slower. something with the scope of the code that's being eval'ed, if i recall correctly.

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#117
post #99

This is what Dropbox needs to do to get everyone to stop complaining about dropping the public folder.

You can put HTML files in public folders. Files in public folders are loaded on a separate domain.

No, I mean for new users they are doing away with the public folders. You can now get a public link to any folder in your dropbox, it's just it goes to a splash page where they let you view the pic, or download the html. Basically new users won't be able to use their dropbox public folder as a webserver because of that anymore, no hotlinking images with dropbox links.

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#118

Earlier quoted context omitted.

Nope, you have an image embedded in somebody else's web site, the script never runs. Also that's completely different than what you originally said.

Andy, you're very confused.

Look. You are the one making the claim that you can exploit this. I call bullshit. So either prove it, or drop it. Accusing me of being "confused" does not provide evidence for your claim.

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#119

Earlier quoted context omitted.

Really? I see no slowdown whatsoever. What are you running?

Yeah it locks up Chrome for me, pressing Ctrl+w closed the tab after about 10 seconds. Chrome 20 on Ubuntu 12.04 x86_64. Core 2 Duo with Intel graphics.

works fine on Win7 32bit + opera 12

Re: A file that's both an acceptable HTML page and a JPEG (view source on it)

#120
post #52

I've always wondered how the site snag.gy does something similar. Take this link, for example (you'll have to disable AdBlock if you want to see the ad): http://i.snag.gy/0obAy.jpg (ignore the image itself; it was one of the first to pop up in my history) The source is just the image, and you can embed the image, but there's an ad under the image. Also, right click -> view image or copy image location point to the sa…

Depends on the MIME type the server requests.

If your browser requests a html page, it will respond with a html page... and vice versa.

Post reply on HN