News for hackers. Stuff that matters.
Re:"Unknown or expired link." - Why? by piinbinary on Tuesday October 11, 2011 @11:18AM (#3098899)
I would be interested to know how much state is in those closures. If it is less than 200 or so bytes, it would not be impractical to encode it (b64) in the url for the next page (rather than a reference to the state).
Re:"Unknown or expired link." - Why? by JoachimSchipper on Tuesday October 11, 2011 @11:57AM (#3099088)
You don't want to execute code from URLs. (Yes, you can use cryptography to "sign" URLs you create. Don't try that at home unless you know the difference between MACs and hashes, and how to avoid timing attacks.)
Re:"Unknown or expired link." - Why? by Dylan16807 on Tuesday October 11, 2011 @12:14PM (#3099146)
Whoa, whoa. Putting the state from the closure in the url is not the same as putting the closure in the url.
Re:"Unknown or expired link." - Why? by dspillett on Tuesday October 11, 2011 @12:29PM (#3099207)
But you are still likely to want to sign the state so you can tell if it has been corrupted (or deliberately doctored) and reject it if so.
Re:"Unknown or expired link." - Why? by Dylan16807 on Tuesday October 11, 2011 @12:39PM (#3099247)
Sign or sanity check, whichever you prefer. Personally in a simple interface like this site I'd rather sanity check the few simple parameters.
Re:"Unknown or expired link." - Why? by wnight on Tuesday October 11, 2011 @04:39PM (#3100201)
It's not a druthers kind of thing. If you need to trust that it hasn't been tampered with you must sign it.

And if you don't care you might as well not add authentication because without signing it's just a fancy CRC - ie, totally replicable by an attacker. As cookies and links are sent over TCP there should be vanishingly few errors in transmission - you're far more likely to introduce false positives with buggy code, and ...

You need to sanity check your inputs anyways. Just do it. This is also how you avoid bugs normally.

Re:"Unknown or expired link." - Why? by Dylan16807 on Tuesday October 11, 2011 @04:52PM (#3100253)
I'm not sure what your argument is.

Yes if you want to trust it you have to sign it and make sure you implement all the crypto correctly. But I don't see a need for that here.

Also TCP's checksum sucks.

Re:"Unknown or expired link." - Why? by wnight on Thursday October 13, 2011 @11:46PM (#3109834)
You said "sign or sanity check it", as if you can do whichever you want. But in the area suggested they have vast differences and security implications.

How many corrupted web pages do you see because of CRC failure in TCP?

Re:"Unknown or expired link." - Why? by JoachimSchipper on Tuesday October 11, 2011 @12:31PM (#3099216)
I wouldn't call it a closure unless it has something like a "next-instruction" field, which is probably enough to get control - and certainly enough to do nasty things (think 'debug-mode, 'restart-server, 'shutdown.)
Re:"Unknown or expired link." - Why? by holdenk on Wednesday October 12, 2011 @03:23AM (#3101868)
The PLT-Scheme (aka Racket) folks do this. Its kind of awesome, and I used it for a side project. It works pretty well except some browsers have a max url length, so you can only safely shove so much data to the client side, and then your stuck with old fashion IDs again. Still lots of fun to play with :)

In a scary way

Re:"Unknown or expired link." - Why? by apgwoz on Tuesday October 11, 2011 @02:12PM (#3099662)
Racket has support for serialization of closures and continuations, which it's web server makes extensive use of. It seems like it'd be possible to expose the relevant functions to make that happen, though I have no idea how large the closures actually are once serialized.
Re:"Unknown or expired link." - Why? by colanderman on Wednesday October 12, 2011 @12:11AM (#3101472)
I believe the Racket web server works similarly to the Arc server. At least it did last I checked (back when it was still PLT Scheme).
Re:"Unknown or expired link." - Why? by onedognight on Tuesday October 11, 2011 @03:17PM (#3099919)
> how much state is in those closures [...] to encode it (b64) in the url

I would be interested to know if this is even possible to determine from a macro which variables are bound in the closure.