Security is a wide field ...

You think you are already safe on the process/local execution side in the sense that no input to your program will allow remote execution of arbitrary code on your server (due to buffer overflows). Simply using -T dosen't make your program sure, because security is a way of thinking and not something you get by applying some magic command line switch to your script. But if you have gone over your script and also have looked at the calls to open() (these could allow shell code to be executed) you are believably safe.

The remaining attacks are less security-wise attacks but more attacks on your protocol and attacks on your infrastructure. Attacks on your infrastructure are Denial Of Service attacks which could flood your server or clients with many big packets, eating their bandwidth (or simply connecting many clients to your server, so that your server has to send one megabyte to all the clients for every byte sent to the server, or simply creating a loop where the server accepts itself as a client). Attacks on the infrastructure are best opposed by monitoring the system and setting the "right" ulimits. Attacks on the protocol itself (like sending bogus client addresses, making the server believe that it connects to itself etc.) must be determined by looking at your protocol (which you haven't told us about, but I guess these attacks are not really possible, as your protocol simply relies on the TCP connection being made).

Update : crazyinsomniac pointed out that I forgot to mention perlsec, the Perl security manpage. My bad indeed.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

In reply to Re: Multithread Server security by Corion
in thread MULTITHREAD SERVER by katzuma

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.