A jailed environment will certainly help prevent them from breaking
root, but keep in mind that the server side scripts already need to
have read (and probably write) access to much of the data associated
with the web site in order to operate the web site. You can do only
so much.
The real problem here is the CGI script / server-side design allowing
the breakin in the first place.
The KISS principle applies. Good programming practices (such as using
the likes of asprintf() and snprintf() instead of sprintf() in C),
and code auditing, pretty much removes the chance of an exploit. For
C based CGI's you need only do a few things to reduce the errors down
into nothing more then null-pointer derferences which generally
cannot be exploited. It means not making any assumptions whatsoever
on the size or content of input data, even if you have client-side
javascript 'restricting' the content of the input data.
It also means properly escaping all POST data so when someone
types '<B>fubar</B>' into an input field the worst that happens is for
it to show up as '<B>fubar</B>' in any HTML output rather
then FUBAR (bolded 'fubar'). How often have you typed a single quote
into an sql-database-backed web page input field and gotten a fault?
A backslash? Punctuation? Hmm.... proper escaping is absolutely
mandatory.
It also means not trusting input data... properly massaging it before
using it for things like, oh, command line arguments to exec'd programs,
and stupid things like that.
Some languages are less likely to be exploitable then others, but never
assume that the scripting / programming language will protect you. After
all, again, if the backend needs to access the data to drive the site
then exploits can potentially also access the data, no matter what kind
of security measures are taken in the language imlementation. If
the backend needs to store persistent state, then exploits can also
potentially modify that state.
-Matt
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message