I recently came across the OWASP project:

The Open Web Application Security Project (OWASP) is a 501c3 not-for-profit worldwide charitable organization focused on improving the security of application software. Our mission is to make application security visible, so that people and organizations can make informed decisions about true application security risks. Everyone is free to participate in OWASP and all of our materials are available under a free and open software license.

I was however quite disappointed to see that there was nothing about perl on it. Come on brothers! OWASP was founded in 2001, and perl in 1987. So why not? Anyway I dived in and started a page: http://www.owasp.org/index.php/Perl. And I am posting this to try and drum some interest.

As far as I can see Catalyst is never run under taint mode. I hit similar problems with CGI::Application::Plugin::Authentication, until I persuaded Cees Hek to grant me co-maintainer status. Of course taint mode could be rendered useless by simply having the framework detaint everything - that defeats the purpose of taint mode. A more proactive and holistic and systematic approach is required, which is why I think we should be getting involved in this.

Edit: Okay the thread has gone in a different (though still useful direction). Let me rephrase the post. I think perl should be a bigger part of OWASP. What do the monks think is the best way of going about this?

  • Comment on Could we get a more systematic approach to security in perl?

Replies are listed 'Best First'.
Re: Could we get a more systematic approach to security in perl?
by moritz (Cardinal) on Mar 28, 2010 at 16:48 UTC

    Call me naive, but I never considered Perl's taint mode to be very important for programming secure web applications.

    I use it for my CGI scripts, but so far I don't think it ever prevented any malicious actions.

    That's probably because my scripts don't work much with the file system, but instead they access a database. (If they do access the file system, it's always with a white listing approach). With DBI's placeholders there's no malicious value an intruder might enter to compromise the database.

    For output I use HTML::Template::Compiled with the default_escape => 'HTML' option, so even for "malicious" values (containing HTML meta characters) I don't any HTML injected.

    So the "classical" security bugs don't really threaten my CGI scripts - it's more a possible forgotten authentication check or so (or maybe XSRF) that might threaten them - but for those taint mode doesn't really buy me anything at all.

    Perl 6 - links to (nearly) everything that is Perl 6.

      I absolutely understand that taint mode does not capture everything but it does capture a lot, and as far as I know has no drawbacks save the fact that too many modules were not written with it in mind. I believe it to be a useful tool.

      Actually I my emphasis was not actually on taint, but can people take more interest in a systematic approach to security and learn form security practices in other languages as described in OWASP? One OWASP principle is "Defence in depth". As such why through away one possible line of defence?

      Which means you already do all the things tainting would try to force you to without the need to be bugged by it. Good for you but ... the fact that you decided to drive safely, slow down in villages and towns, etc. etc. etc. doesn't mean other people do not need to be forced to slow down. You would not notice there's a speed limit, because you already drive below without being told. Others need to be told.

      BTW, default_escape => 'HTML'? What if the value needs to end up in some JavaScript? Or a URL?

      Update: s/willages/villages/, thx marto.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

        BTW, default_escape => 'HTML'? What if the value needs to end up in some JavaScript? Or a URL?
        You would declare the escape type in the template:
        <a href="/foobar/<TMPL_VAR myurl ESCAPE=URI">...</a>

        You can also use ESCAPE=NONE inside the template if you consciously want to interpolate HTML. The point is just that if you don't think of escaping at all, there's a safe default which does not lead to XSS holes.

        Perl 6 - links to (nearly) everything that is Perl 6.
Re: Could we get a more systematic approach to security in perl?
by educated_foo (Vicar) on Mar 29, 2010 at 16:32 UTC
    I think perl should be a bigger part of OWASP.
    It seems like a waste of time to me. Some random guy had the free time to register a 501(c)3, buy a domain name, put up a wiki, and thereby create an entity with the word "Open" in its name. I could probably create the Best Internet Alliance for Technology, Creativity, and Holiness for a few hundred dollars, but there would still be no reason for anyone interested in any of those good things to pay attention.

    This is not to say that Perl web-app security isn't important -- it is -- but these various Alliance for Mom and Apple Pie outfits are pretty silly.

      That sounds like an argument against all human endeavor. Of course some ventures do fail, but the successful ones probably had denigrators too.
        That sounds like an argument against all human endeavor.
        Not at all -- just an argument against people creating phony "alliances" or "movements." In politics, it's called "astroturf." In the tech industry, it's called "PR," and usually starts with as "FooCorp, the leader in blah blah."
Re: Could we get a more systematic approach to security in perl?
by JavaFan (Canon) on Mar 29, 2010 at 14:23 UTC
    I was however quite disappointed to see that there was nothing about perl on it.
    Hmmm. The A in OWASP stands for Application, while the W stands for Web. First of all, Perl (uppercase P) isn't an application - it's a language. And while perl (lowercase p) can be seen as an application, it's not a web application.
      There are OWASP projects for Java and .NET etc. Also the wiki rules had specific requirements on capitalization, so I may have got confused by the convention shift when coming back to perlmonks (if I ever desperately cared about it anyway).
Re: Could we get a more systematic approach to security in perl?
by scorpio17 (Canon) on Mar 29, 2010 at 15:55 UTC
    I only use taint mode while developing/debugging - never in production code. I wouldn't want a framework to force it "on" all the time.