Skip to content

Comment on Most Dangerous Programming Errorsparent

Comments

Could one use this list to evaluate an implementation stack? Maybe someone should evaluate LAMP, Ruby on Rails, and Django with regards to this list?

Rails: problem - who takes care of it - how

1) Input validation - programmer - validates_* and attr_accessible in the models

2) Output validation - programmer - HTML::Sanitize

3) SQL injection - rails - use ? or named_scope to construct complex queries

4) XSS - programmer - do not forget <%= h

5) Command injection - programmer - do not do it

6) Cleartext - programmer - requires_ssl module

7) CSRF - rails - uses authentication_token in all forms

8) Race conditions - rails - single threaded

9) Error info leaks - rails - use production mode

10) Memory - ruby - safe language

The rest are all on programmer - just do not do it.

First, this is like saying C takes care of buffer overflows:

1) buffer overflow - programmer - count

Conservatively, that action item cost the industry over 5 billion dollars. So, generally, "bad programming: use good programming" is not an effective answer to security.

Second:

(3) Fails on complex queries and query builders all the time; there are situations where you can't parameterize everthing that varies in a query.

(5) Would have precluded Github, which used `` expansion in its first revs to invoke git.

(8) First, Rails isn't single-threaded anymore, and second, you can end up with race conditions at the database layer if you aren't careful with transactions and isolation levels.

(9) Is only true if you not using any unaudited C extensions; quick, tell me how many of the gems you brought in have an ext/ directory with code in it?

3) Have you tried named_scope? It solves most of the query building pain for me...

I knew it!

There had to be a way to spin #8 into something positive.

spin is charged in this context

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.