Better HN
topnewbestaskshowjobs
Log inSign up

coderrr

292 karma · joined Mar 24, 2008 (18y ago) · 119 submissions

Submissions

comment 15y ago · link · parent

I'm pretty sure you can't set the Origin header yourself. That would kindof defeat the purpose of it. If anything they'd only allow you to specify whether or not to include the header. But I doubt any browser even lets you do that: $.ajax({url:'http:// asdf.com/1,beforeSend:function(xhr,set){xhr.setRequestHeader('Origin', 'http:// realorigin.com)}}) Refused to set unsafe header "Origin"

So since you can't force an Origin header to be on all of your legit API requests, you won't be able to differentiate them (using the Origin header) from an attacker with a <script> tag.

comment 15y ago · link · parent

Ah sorry, I was only checking same domain XHRs, which doesn't seem to send the Origin header. That combined with the fact that Origin isn't sent for <script> tags seems like it can't be used to prevent CSRFs.

comment 15y ago · link · parent

But how many browsers actually send the Origin header currently? I just checked Firefox and Chrome and neither sent it on a <script> or XHR request.

comment 15y ago · link · parent

It seems to me the suggestion to require the 'X-Requested-With:XMLHttpRequest' header to be set is the best way to handle this, much better than some JS tweaking. It doesn't make any assumptions about javascript syntax or implementations. And the only way I can think to get around it is some http request splitting exploit via a proxy.

If you only return data to XHRs then you're protected by same origin policy and all <script> tags will get no data.

-EDIT-

When I first read "a better option is to require custom XMLHttpRequest headers" I thought this is what they were talking about. After a second look they probly mean setting a custom header yourself using the XHR object. This would work too but now I'm wondering if there's some way around my solution. Because why would they advocate a custom header if checking the X-Request-With header alone is enough?

- EDIT -

Was just in the shower and remembered why they probly don't advise to just check the X-Requested-With header. There are ways for an attacker to get around the XHR same origin policy with dns pinning/rebinding attacks. If you required a custom header with a session cookie which the attacker didn't have access to this would mitigate that kind of attack. EDIT: Nevermind, as long as you're checking the Host header a dns rebinding attack wouldn't matter.

comment 16y ago · link · parent

interesting UI issue/inconsistency (in Chrome)... when pressing tab, it can either complete the current word/phrase or move to the X, so <enter> can either do nothing or clear the search box

comment 16y ago · link · parent

cool, i'd be interested in hearing more on your setup, do you have your routing scripts up anywhere?

comment 16y ago · link · parent

Yea I've never even tried this on windows, if I wanted to use windows with it I'd set it up on a linux box and route my windows machine through that in which case you wouldn't have the issue you described. EDIT: Ah I just realized what you meant about windows and packet reordering. It's actually not an issue with tunnel splitter because all packets will come in order. Tunnel splitter uses N standard TCP connections to tunnel through. The actual data will come to tunnel splitter out of order and it will deal with reconstructing the data, not the OS.

As for the 6 15Mbps connections those were just arbitrary numbers I picked. I'm currently stuck with sucky slower connections which is what I'm using it with. And DSL not cable. I'm not sure what you say about cable is true though since most cable modem speed cap is on the modem itself not at the ISP. At least that used to be the case. Also if you were using different ISPs that wouldn't be an issue, as long as they aren't sharing their network.

In terms of the pure linux routing solution, that is pretty interesting... Does it require that the remote machine has two physical interfaces or could you do the same with virtual interfaces like eth0:0 and eth0:1. Either way there are a few drawbacks with that solution. It will send 100% of your traffic through it rather than being able to selectively proxy. Also it only round robins so there is no intelligent load balancing as there is in tunnel splitter.

comment 16y ago · link · parent

yea it does look similar, can't get their source downloads to work... have any links?

69.

Tunnel Splitter: Accelerating a single TCP connection over multiple ISPs(coderrr.wordpress.com ↗)

27 points · by coderrr · 16y ago · 8 comments

70.

Compatibility between the iPhone App Store and the LGPL(multinc.com ↗)

4 points · by coderrr · 17y ago · 2 comments

comment 17y ago · link · parent

"Secret History of Silicon Valley" Google Tech Talk: http://www.youtube.com/watch?v=hFSPHfZQpIQ

comment 17y ago · link · parent

I had to make changes to ruby's em-http-request for this

http://github.com/coderrr/em-http-request/commit/8e6444fe472...

comment 17y ago · link · parent

anti anti frame busting here:

http://coderrr.wordpress.com/2009/06/18/anti-anti-frame-bust...

comment 17y ago · link · parent

summarized:

http://news.ycombinator.com/item?id=523775

75.

Summary: state of the solid state drive world(huyzing.com ↗)

4 points · by coderrr · 17y ago · discuss

comment 17y ago · link · parent

Here's another way around it: http://coderrr.wordpress.com/2009/02/13/preventing-frame-bus...

comment 17y ago · link · parent

and one way around this is http://keepitlocked.net/archive/2008/11/07/preventing-clickj...

comment 17y ago · link · parent

this might be a way around it in IE

http://code.google.com/p/browsersec/wiki/Part3#Microsoft_Int...

comment 17y ago · link · parent

This wasn't CSRF, but clickjacking, aka UI redressing. CSRF protection does nothing against it. There are some ways to attempt to defend against it but I don't think there is any 100% reliable way yet.

http://code.google.com/p/browsersec/wiki/Part2#Arbitrary_pag...

comment 17y ago · link · parent

I agree, flash cookies should be cleared with this feature as long as firefox is shipping with flash.

comment 17y ago · link · parent

how about something like this:

http://news.ycombinator.com/item?id=467739

comment 17y ago · link · parent

Something that would probably help is using javascript to track how many people have actually had your comment viewable in their browser. Then take the ratio of views to votes.

Eventually you might also find that you can determine the average # of views of your comment purely based on the location of it on the page, in which case the javascript tracking would no longer be necessary. Although it's also possible that the characteristics of comment viewing are too complex to be able to simplify it to that.

Also, maybe instead of a fixed score required to be orange, take a distribution of all users and only make the top X percent qualify.

comment 17y ago · link · parent

Here's a crazy hack they could do to use ajax queries while preserving the current referer url:

Whenever the ajax search is performed an invisible iframe is loaded at: http://google.com/search?q=search+term&donothing=true.

The donothing=true tells Google's webserver to perform no actual query and return a blank page. This should happen extremely quickly. (It could be performed after the ajax results have been fully loaded as to not affect response time)

Then when a user clicks a search result, Google does a javascript redirect from the iframe (use javascript to add a new <script> tag with a window.top.location= in it) and you get a referer just like you would before... with a negligible performance hit.

comment 17y ago · link · parent

Query for content inside of <script> or other similar tags which Google and all other search engines I have encountered ignore.

comment 17y ago · link · parent

Why did the associate damage his thumb? Because his thumb got caught in the conveyor.

Why did his thumb get caught in the conveyor? Because he was chasing his bag, which was on a running conveyor.

Why did he chase his bag? Because he placed his bag on the conveyor, but it then turned-on by surprise

Why didn't he hit the off button on the conveyor instead of chasing it? Because he wans't near the off button?

Why don't we have multiple off buttons so you're never far from one? That's expensive, let's buy some tables instead.

86.

Contributing to open source can be hard and frustrating(coderrr.wordpress.com ↗)

2 points · by coderrr · 17y ago · discuss

comment 18y ago · link · parent

The question I'd like to know the answer to is...

How much would you be willing to pay for a solution to this?

1234