News for hackers. Stuff that matters.
Re:Ask HN: Has Hacker News been hacked/cracked? by suhail on Tuesday March 17, 2009 @01:49AM (#519473)
Almost sounds like SQL Injection, perhaps no escaping on fnid?
Re:Ask HN: Has Hacker News been hacked/cracked? by markbao on Tuesday March 17, 2009 @01:51AM (#519477)
Edit: I'm wrong, see below.

If I'm not mistaken, that had nothing to do with SQL injection. The fnid basically was the authenticator that allowed a person to edit a page, regardless of who was logged in.

What about other HN-powered Arc sites? Are they vulnerable as well? I won't name names, because I'm guessing they are indeed vulnerable.

Edit: Yes, they are.

Re:Ask HN: Has Hacker News been hacked/cracked? by pg on Tuesday March 17, 2009 @01:52AM (#519479)
Not quite. A fnid is a hash key pointing to a closure on the server.
Re:Ask HN: Has Hacker News been hacked/cracked? by markbao on Tuesday March 17, 2009 @01:56AM (#519486)
Ah, okay. Wrong guess. Everyone can downvote me now :)
Re:Ask HN: Has Hacker News been hacked/cracked? by ralph on Tuesday March 17, 2009 @08:00AM (#519749)
With hindsight, do you still feel fnids are a good way to go? They present an obvious bottleneck in that the server has to remember many closures for a period of time as opposed to having each client remember their share. I know you drastically reduced the use of fnids some time ago. I wonder if the remainder are a vestige that's OK to live with because life's too short, or there's fundamentally a strong argument for them I'm missing.
Re:Ask HN: Has Hacker News been hacked/cracked? by pg on Tuesday March 17, 2009 @12:37PM (#520089)
Sometimes these closures have more stuff in them than you could conveniently put in a url. For example, they might refer to another closure describing what to do next. When you try to do something that requires you to be logged in, for example, you're given the login page, with a fnid referring to a closure describing what you were in the middle of doing. That's why after logging in you're able to continue doing whatever you were doing.
Re:Ask HN: Has Hacker News been hacked/cracked? by dha on Tuesday March 17, 2009 @09:45PM (#520981)
Agreed. How about making the fnid a signed cache of often used environment variables(instead of a random string), which could also be looked up via a more time consuming method if needed. Depends really on your traffic profile how much data could reasonably and cost-effectively be cached, but it could be a very sizable portion saved by retrofitting the current method.
Re:Ask HN: Has Hacker News been hacked/cracked? by wlievens on Tuesday March 17, 2009 @04:35AM (#519613)
Indeed. fnid = function id
Re:Ask HN: Has Hacker News been hacked/cracked? by ambition on Tuesday March 17, 2009 @01:32PM (#520181)
I think I've found and fixed for hnacademic.com, thanks to the wonderful details here.
Re:Ask HN: Has Hacker News been hacked/cracked? by tptacek on Tuesday March 17, 2009 @08:13AM (#519757)
It's very much like the "mass assignment" bugs that hit Rails servers when people forget to limit the writeability of Active Record attributes.
Re:Ask HN: Has Hacker News been hacked/cracked? by brlewis on Tuesday March 17, 2009 @10:32AM (#519891)
Escaping is needed when you pass strings to a program that parses and interprets them. That's not part of HN's architecture AFAICT. There shouldn't be any opportunity to introduce a vulnerability similar to SQL injection.