Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No because you don't know what you are talking about.


I see. So that whole big mass-assignment security issue that exposed GitHub a while back -- that just didn't happen? Writing code in this style is perfectly safe?


Writing code in this style is perfectly safe if you do it correctly. GitHub didn't, so the defaults were changed to make it harder to do it incorrectly.

UPDATE: editing to reply since hn won't let me reply directly because the thread is to deep, yet I'm getting downvotes

It's not a tautology. Some things are safe even if you do them wrong. Some things are unsafe no matter how you do them.

Rails changed the defaults so that now you have to deliberately decide to do things unsafely. Rails before 3.2.3 fails un-safe in this scenario, but later versions fail safe. Rails 4 uses a different solution that's even harder to screw up.


"Writing code in this style is perfectly safe if you do it correctly."

That's a tautology.

In general you can't count on code being written "correctly", so this isn't a defense. It is better to have systems that degrade gracefully in the face of humans and their idiosyncrasies, rather than those that fail-unsafe, because you can't build your security system on the assumption that your code will be written by superhumans.


Should all database use be frowned upon because injections are possible if you don't use them correctly?


I hope you realize that this is the identical argument PHP developers made whenever someone brought up how insecure the base language, libraries, and configuration were.

Users of a framework should have to go out of their way to make themselves insecure. It shouldn't be insecure by default.


This isn't a Rails issue, it can affect any web framework. And it's a security flaw every single time mass assignment is used without whitelisting.


> This isn't a Rails issue, it can affect any web framework.

Not exactly. Most web frameworks don't have a built-in "mass assignment", let alone enable it by default.


Well, true. I wonder how many people pass their models straight into a schema-less database without any checks?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: