Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 328013 - sys-process/bcron: non-members of cron group are allowed to submit crontabs on /var/run/bcron-spool socket
Summary: sys-process/bcron: non-members of cron group are allowed to submit crontabs o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Cron Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 22:35 UTC by Pavel Labushev
Modified: 2010-08-09 09:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
an obvious fix (bcron-spool.run.patch,307 bytes, patch)
2010-07-12 22:40 UTC, Pavel Labushev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Labushev 2010-07-12 22:35:41 UTC
Non-members of cron group are allowed to submit crontabs on /var/run/bcron-spool socket.

bcron-spool uses a unix domain socket file /var/run/bcron-spool for crontab submissions, served by unixserver from ucspi-unix package. bcron-spool identifies the crontab submitter by UNIXREMOTEEUID envvar provided by unixserver and does not place any restrictions on who may or may not submit crontabs, with no regard to whether the uid from UNIXREMOTEEUID is a member of cron group.

The existing permissions on /usr/bin/bcrontab (root:cron 750) do not prevent any user from communicating with bcron-spool directly on the socket file (for one example of many, with a custom bcrontab executable placed into user's home directory).

This behavior must be changed to comply with the common practices as described in Gentoo Linux Cron Guide: "No matter which cron package you use, if you want to allow a user to use crontab, he will first have to be in the cron group."

Please note that such behavior in some situations may be considered a security vulerability allowing an attacker to repeatedly compromise a system through invoking a malicious cron job even after the initially exploited vulnerability  has been eliminated and all the other attacker's tools has been cleaned out.

The solution is to change the ownership and permissions of /var/run/bcron-spool to root:cron 660.

Reproducible: Always

Steps to Reproduce:
1. start bcron using the stock supervise scripts
2. log in as a user who is not a member of cron group
3. use a custom bcrontab executable to submit a crontab

Actual Results:  
The crontab is submitted with no regard to the lack of cron group membership.
Comment 1 Pavel Labushev 2010-07-12 22:40:29 UTC
Created attachment 238517 [details, diff]
an obvious fix
Comment 2 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-07-13 09:26:06 UTC
The fact that arbitrary users can create cronjobs is a bug indeed, but the security content of it is questionable.

Reassigning to maintainer.
Comment 3 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2010-08-09 09:42:22 UTC
your patch is applied to bcron-0.09-r2.
sorry for the wait.

thanks for the report and fix