The easiest way to harden a cgi-bin program is to make the assumption that you cannot trust user input.  Most exploits come from buffer over-flows, so you need to ensure that you avoid that.  I can't remember the exact C routines, but one type of read just reads the entire input (which is bad), the other allows you to specify the maximum number of bytes to read (which is good).  You have to do extensive checking of the input to ensure that (1) the user hasn't tried to embed an executable command, and (2) that the user hasn't tried to embed such a command in a string that's so large that it overflows your buffer.
 
Ben
----- Original Message -----
Sent: Thursday, July 03, 2003 1:13 AM
Subject: cgi-bin hardening

Hi
 
can any body help me in hardening cgi-bin application.
 
regards
 
Prashant.

Reply via email to