[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preventing Symlink Attacks...



On Mon, 18 Sep 2006 21:37:21 +0100, Conall O'Brien wrote:

> Hello,
> 
> 
> As suggested by Joey Shulze, I'd like input from people here on how to
> deal with potential symlink attacks for my queuegraph package now in
> sid.
> 
> 
> Queuegraph is a simple script. It has a shell script which works out
> Postfix queue statistics, then saves them in an rrd DB (in
> /var/lib/queuegraph/ ). Seperately, a perl CGI script (in
> /usr/lib/cgi-bin/ ) processes the rrd DB when called to generate RRD
> graphs. I've made modifications to the tmp path in the CGI script to
> store the generated .png graphs in /var/tmp/queuegraph/
> 
> 
> What is the best way for me to protect from symlink attacks? Or should I
> change this path to say /var/cache/queuegraph/ (as done in the bindgraph
> package, which has similarities to my package)
> 
> 
> Suggestions & thoughts welcome.  

It sounds like the easiest solution would be to avoid using a shared
directory entirely, and instead create a dedicated directory at
/var/cache/queuegraph.

<http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html#TEMPORARY-FILES>
has hints and pointers for doing stuff securely in shared directories such
as /tmp and /var/tmp.

-- 
Sam Morris
http://robots.org.uk/

PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078



Reply to: