Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: Attack on Perl or Perl's need better PR (again)

by Anonymous Monk
on Nov 30, 2005 at 20:57 UTC ( [id://513107]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Attack on Perl or Perl's need better PR (again)
in thread Attack on Perl or Perl's need better PR (again)

SQL Injection attacks are impossible to do against a Perl application ... so long as you use DBI's placeholders.
Hmm... Let's rephrase that a tad...
Buffer overflow attacks are impossible to do against a C application ... so long as you use malloc and free properly.
...
Ruby is the exact same way - there's even a section on it in the Ruby on Rails book. It says (and I paraphrase) "Use DBI placeholders to make SQL Injection attacks impossible."
But Ruby and SQL don't take a language level approach to security, right? I'm only wondering if there is any evidence to back up the OP's claim that security isn't a language issue (which I read as "security can't be a language issue"). Maybe you can pinpoint your stance on the issue...
  1. Security hasn't been incorporated into a popular lanugage yet, so it must be hard or impossible (let's ignore things like Java applets for now).
  2. Language based security isn't possible for theoretical reasons X, Y, and Z. (As found out by the creators of lanugages Foo, Bar, and Baz when they crashed and burned. See their research papers).
  3. Language based security is possible, but it is really hard or makes a language cumbersome to use (See also the experiences from the Foo Project)
  4. Language enabled security is too expensive for some reason. It is almost always cheaper to fix it when it breaks.
  5. Other
...of course, I pretty much think that any idea could be made into a language issue, if so desired. See also: The Role of the Study of Programming Languages in the Education of a Programmer.
  • Comment on Re^5: Attack on Perl or Perl's need better PR (again)

Replies are listed 'Best First'.
Re^6: Attack on Perl or Perl's need better PR (again)
by dragonchild (Archbishop) on Nov 30, 2005 at 21:58 UTC
    Let me rephrase. Yes, you can incorporate security into a language as features. For example, buffer overflows are impossible to do in Perl. But, integrated memory management wasn't incorporated into Perl for security reasons - it was added for programmer productivity. As a side benefit, an class of security issues is now avoided.

    Many security issues, such as SQL injection and cross-site scripting, have to do with the interfaces between components. SQL injection occurs when a legitimate SQL statement is hijacked to do something that is legal and often useful SQL, but disastrous for the application depending on that SQL. The bug isn't in the database, SQL, or the application. The bug is in how the application constructs SQL based on user input. The same goes for cross-site scripting for how the application constructs URLs based on user input.

    I would put forward that 90% of all security issues are in how one deals with outside input. SQL injection, XSS, and buffer overflows all fall into that category. Dealing with outside input isn't a language issue, it's a design (or process) issue. Language features can help (tainting, automated memory management, placeholders, HTML escaping, etc), but not only can every safety feature be disabled, but they have to be used to be of benefit.

    Or, put another way, a computer language cannot be designed to safely deal with all outside input, in large part due to the Halting problem. I would love to see an argument against that statement, but I don't think one can be made.


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      Well, since the E language has been mentioned above, I'll instead ask what you think of CaPerl and Safer Scripting Through Precompilation.
      CaPerl is a system that implements capability discipline in Perl. It does this by introducting a few extra language constructs, and by restricting what untrusted code is allowed to do. The CaPerl language is compiled into standard Perl which can then be run by a completely standard Perl interpreter. However, untrusted code is prevented from doing anything its trusted (or untrusted) wrapper did not intend it to do.
      ...also these papers on capabilities, etc. might be of interest.
        Very interesting. I don't think it will work in Perl5, but I just suggested adding it into Perl6.

        My criteria for good software:
        1. Does it work?
        2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513107]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found