Earlier quoted context omitted.
Every Rails AR model should have an "attr_accessible" line in it. I'd do you one better: use an initializer to monkeypatch ActiveRecord::Base and fire "attr_accessible nil", which will cause mass assignment to fail on any object you create from a class which doesn't make the assignment explicit.
That's clever. Want a job? =)
Security Lessons Learned From The Diaspora Launch
21–30 of 142 posts
Re: Security Lessons Learned From The Diaspora Launch
#22Would appreciate if more articles like this are posted on HN, useful and practical!
Re: Security Lessons Learned From The Diaspora Launch
#23"For example, if you were logged in to a Diaspora seed and knew the ID of any photo on the server, changing the URL of any destroy action from the ID of a photo you own to an ID of any other photo would let you delete that second photo." When I was working as a pen tester I would completely scold developers for letting this happen - telling them that with everything we know today about security and good programming p…
> That was 11 years ago. The problem is, these kids are from college . They don't teach you stuff like "writing a secure web application" in college, or even try to. (Not that this is unreasonable, though perhaps I'm suggesting that there should be different career paths for CS majors and people who intend to be professional programmers. (I say as a CS-educated professional programmer))
Re: Security Lessons Learned From The Diaspora Launch
#24What would be a nice one-page security guide would be a 'lil bobby tables' guide to databases - SQL injection for any database - (SQL or NoSQL) - the goal being to help developers prevent these attacks.
Re: Security Lessons Learned From The Diaspora Launch
#25I was wrong.. these aren't really security "holes" as that's not strong enough a word. I think the best way to put it is they accidentally created the first social network wiki.
Re: Security Lessons Learned From The Diaspora Launch
#26Re: Security Lessons Learned From The Diaspora Launch
#27Would appreciate if more articles like this are posted on HN, useful and practical!
Yeah - I usually come on here to find the technical sorts of articles that I learn from and have been seeing less and less of these lately.
Re: Security Lessons Learned From The Diaspora Launch
#28[1] http://guides.rubyonrails.org/security.html (Well-written, like the other guides. Totally worth reading fully).
[2] http://www.owasp.org/index.php/Top_10_2010-Main (Open Web Application Security Project's top application security risks for 2010)
Re: Security Lessons Learned From The Diaspora Launch
#29"For example, if you were logged in to a Diaspora seed and knew the ID of any photo on the server, changing the URL of any destroy action from the ID of a photo you own to an ID of any other photo would let you delete that second photo." When I was working as a pen tester I would completely scold developers for letting this happen - telling them that with everything we know today about security and good programming p…
> That was 11 years ago. The problem is, these kids are from college . They don't teach you stuff like "writing a secure web application" in college, or even try to. (Not that this is unreasonable, though perhaps I'm suggesting that there should be different career paths for CS majors and people who intend to be professional programmers. (I say as a CS-educated professional programmer))
Imagine if your nurse came out of college having never stepped foot into a hospital, having only read about how to take vitals and such, but never having done it on a live human being.
Re: Security Lessons Learned From The Diaspora Launch
#30I can probably go all night on this, but a couple things from a quick read of this (very good) post: First, mass assignment. The answer to mass-assignment bugs is "attr_accessible". Accessible attributes can be set via update/build/new; nothing else can. Every Rails AR model should have an "attr_accessible" line in it. I've met smart dev teams working under the misconception that attr_accessible means "these are the…
"Don't let users interpolate, ever" is close to truth. It isn't quite truth, but it's a lot shorter than the truth.