-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insecure default url_shortener_cache path #7
Comments
An external call to For single-user operation where SA is always run as a particular user, whether from spamd or the SA perl script, then it would be sufficient to create a directory solely available to that user (e.g., This could/should be placed in the README/instructions. Of course, for single-user operation as above, issue #6 isn't an issue, since that only manifests with per-user operation. For per-user operation, if point 2 in issue #6 is fixed, this issue becomes moot by default, assuming the default ("global" user) location is either disabled or similarly secured. For per-user ops, the DBs should be stored in user directories. If stored in |
It looks like most other plugins (Bayes, TxRep, Hashcash,...) are using a file in If those things happen by default, it might be safe to use |
It looks like there are other calls to |
Two single-user data points: on our mail server, if I delete |
If amavis is your SA glue then likely spamd is running as user amavis, is my guess. |
In this case I checked to make sure that spamd was run with |
So while reading issue #6, I noticed that the current default cache location is under
/tmp
, but with a fixed filename: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 betFile::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?The text was updated successfully, but these errors were encountered: