-
Notifications
You must be signed in to change notification settings - Fork 14
Description
So while reading issue #6, I noticed that the current default cache location is under /tmp, but with a fixed filename:
url_shortener_cache /tmp/DecodeShortURLs.sq3
This is vulnerable to a bunch of bad stuff, because /tmp is world-writable. For example, when the machine boots, anyone can create /tmp/DecodeShortURLs.sq3 as a symlink to something important that might later be clobbered by cache data. Or, for another example, anyone can create an empty file /tmp/DecodeShortURLs.sq3 before SpamAssassin does, and then later inject data into that file that SA will try to process.
There are more intricate attacks, of course -- it's better to avoid using /tmp entirely, if possible. Or if you'd like to default to a file in /tmp, use a "secure" filename that isn't known beforehand. I know nothing of Perl, but I'd bet File::Temp can do it. The downside to that is that the cache won't persist across reboots, so maybe it would help to include some instructions on where to put the cache permanently? Does SA have it's own secure temporary location?