Fedora Account System
Red Hat Associate
Red Hat Customer
Overview ======== An unprivileged local user can supply a custom incron configuration to the setuid-root /usr/bin/incrontab program. Although incrontab prints: "insufficient privileges to use custom configuration (will use default)" it does not actually reset the configuration path to the default. It proceeds to load the attacker-controlled configuration. By making the user-table path a symbolic link to a root-owned file, incrontab follows the link while running with effective UID 0, writes the supplied table through it, and then calls chown() on the resulting path. This gives us an arbitrary root-file overwrite primitive. I demonstrated local privilege escalation by targeting /etc/passwd. This works on the stock Fedora ISO installed into a qemu VM with the only change being the installation of incron, SELinux was left enabled. * Fedora release 45 (Forty Five) * incron-0.5.12-30.fc45.x86_64 * selinux-policy-targeted-45.23-1.fc45.noarch * selinux-policy-45.23-1.fc45.noarch Root cause ========== In ict-main.cpp, the config option is initialized to the system configuration: std::string cfg(INCRON_CONFIG); When -f/--config is supplied, AppArgs::GetOption() replaces cfg with the attacker-provided path. For a non-root real UID, the code only prints a warning: if (uid != 0) { fprintf(stderr, "insufficient privileges to use custom configuration " "(will use default)\n"); } It does not return an error and does not restore cfg to INCRON_CONFIG. IncronCfg::Load(cfg) consequently loads the attacker-provided file. The attacker-controlled user_table_dir is later used to construct the output path in copy_from_file(). The setuid process saves the table to that path and then performs: chown(out.c_str(), ppwd->pw_uid, -1) Both operations follow a symbolic link placed at the attacker-selected output path. Reproducible: Always Steps to Reproduce: Reproduction ============ As root 1. Install incron. As an ordinary user: 1. Create an attacker-owned directory containing a spool directory. 2. Create a custom configuration setting user_table_dir to that spool directory and allowed_users to an attacker-controlled allow file. 3. Add the current username to the allow file. 4. Create a symbolic link named after the current user inside the spool directory, pointing to /etc/passwd. 5. Execute /usr/bin/incrontab -f ATTACKER_CONFIG TABLE_FILE Despite reporting that the custom configuration cannot be used, incrontab loads it. /etc/passwd is overwritten through the symbolic link and its owner is changed to the attacking user's UID. --- Details of PoC/steps to reproduce: mkdir /tmp/repro mkdir /tmp/repro/spool ln -s /etc/passwd /tmp/repro/spool/riv /tmp/repro/config: user_table_dir = /tmp/repro/spool allowed_users = /tmp/repro/allow /tmp/repro/allow: riv /tmp/repro/table riv:x:1001:1001::/home/riv:/bin/bash 1 placeholder /usr/bin/incrontab -f /tmp/repro/config /tmp/repro/table Expected Results: If the software is launched by a low privilege user, it should not be able to overwrite arbitrary files.
Thanks for the report. At first glance, just adding a 'exit 1' after the warning about the config being passed for a non uid 0 user would prevent this attack?
Yes, I believe that would fix it.
Can you test this scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=152155665 If that looks good I can push out updates. Do we want to ask for a CVE here? Or just get it updated as soon as possible?
Just tested it out, the scratch build [152155665] did not resolve the issue. The patch (patch 3) was not compiled into it. I'd appreciate if we can get a CVE number assigned. Thanks!
Ugh, Sorry about that, this spec needs some modernization. ;( Try: https://koji.fedoraproject.org/koji/taskinfo?taskID=152171788
Not a problem at all! That new build is working and has resolved the issue, prints "insufficient privileges to use custom configuration" when I try to do the attack.
Great. I will do builds today for everything... I'm not sure on the CVE part, but we can attach one to the updates when/if we get one.
FEDORA-2026-3f54d4b3cd (incron-0.5.12-31.fc46) has been submitted as an update to Fedora 46. https://bodhi.fedoraproject.org/updates/FEDORA-2026-3f54d4b3cd
FEDORA-2026-3f54d4b3cd (incron-0.5.12-31.fc46) has been pushed to the Fedora 46 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-db7a3ef92b (incron-0.5.12-31.fc43) has been submitted as an update to Fedora 43. https://bodhi.fedoraproject.org/updates/FEDORA-2026-db7a3ef92b
FEDORA-EPEL-2026-2ffde1f2b7 (incron-0.5.12-31.el10_4) has been submitted as an update to Fedora EPEL 10.4. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-2ffde1f2b7
FEDORA-2026-93de20052b (incron-0.5.12-31.fc45) has been submitted as an update to Fedora 45. https://bodhi.fedoraproject.org/updates/FEDORA-2026-93de20052b
FEDORA-EPEL-2026-28046962ee (incron-0.5.12-31.el8) has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-28046962ee
FEDORA-EPEL-2026-13e46770aa has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-13e46770aa See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-28046962ee has been pushed to the Fedora EPEL 8 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-28046962ee See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-93de20052b has been pushed to the Fedora 45 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-93de20052b` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-93de20052b See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-2ffde1f2b7 has been pushed to the Fedora EPEL 10.4 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-2ffde1f2b7 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-db7a3ef92b has been pushed to the Fedora 43 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-db7a3ef92b` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-db7a3ef92b See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-4b67d2e4ac has been pushed to the Fedora 44 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-4b67d2e4ac` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-4b67d2e4ac See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-2ffde1f2b7 (incron-0.5.12-31.el10_4) has been pushed to the Fedora EPEL 10.4 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-28046962ee (incron-0.5.12-31.el8) has been pushed to the Fedora EPEL 8 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-13e46770aa (incron-0.5.12-31.el9) has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-db7a3ef92b (incron-0.5.12-31.fc43) has been pushed to the Fedora 43 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-93de20052b (incron-0.5.12-31.fc45) has been pushed to the Fedora 45 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-4b67d2e4ac (incron-0.5.12-31.fc44) has been pushed to the Fedora 44 stable repository. If problem still persists, please make note of it in this bug report.