Skip to content
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

Suggestion. scripts - file permissions #189

Open
m6a4 opened this issue Sep 7, 2022 · 1 comment
Open

Suggestion. scripts - file permissions #189

m6a4 opened this issue Sep 7, 2022 · 1 comment

Comments

@m6a4
Copy link

m6a4 commented Sep 7, 2022

REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER:

  • iRedMail version (check /etc/iredmail-release): 1.5.2
  • Deployed with iRedMail Easy or the downloadable installer? downloadable inst.
  • Linux/BSD distribution name and version: Debian 10
  • Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
  • Web server (Apache or Nginx): NginX
  • Manage mail accounts with iRedAdmin-Pro? no
  • [IMPORTANT] Related original log or error message is required if you're experiencing an issue.

Hi,

there are several scripts executed by root via cron.
The scripts themselves are owned by normal users:
e.g.
in: opt/www/iredadmin/tools:

  • cleanup-amavisd_db.py
  • cleanup_db.py
  • delete_mailboxes.py

are owned by iredadmin

This setting can be used for privilege escalation to root for this user.
Setting the shell to nologin doesn’t mitigate this completely.

Suggestion:
set the file owner for the scripts in root’s crontab to root:root,
remove ability to be written by user/world for them.

Sincerely,

Michael

@iredmail
Copy link
Owner

iredmail commented Sep 8, 2022

Suggestion accepted. Will change this soon.

cleanup_amavisd_db.py and cleanup_db.py could be moved to "iredadmin" user's cron job since they are pure sql operations, but delete_mailboxes.py must be ran as root (or "vmail") user since it requires the privilege to remove files under /var/vmail/vmail1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants