---
title: "HOST-CRON-002 World-Writable Directory in Cron's PATH"
canonical: https://openvapt.com/checks/HOST-CRON-002.html
html: https://openvapt.com/checks/HOST-CRON-002.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# HOST-CRON-002 World-Writable Directory in Cron's PATH

Checks the PATH that system cron jobs search for commands for world-writable or relative entries.

- Domain: Server
- Severity: High
- Control category: Access Control
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CIS Controls v8: 3.3
- NIST CSF 2.0: PR.AA-05, PR.DS-01
- CWE: CWE-426, CWE-427
- NIST SP 800-53 Rev. 5: CM-6, AC-6, CM-7
- Benchmark topic: Root PATH integrity (topic only, no benchmark text)

## Why It Matters

A cron job that calls backup-db rather than /usr/local/sbin/backup-db runs whichever file of that name PATH finds first. If a folder on that PATH is world-writable, or the PATH contains an empty or relative entry, any user can plant a program that root runs on schedule (PATH interception).

## How It Detects

Reads PATH= from /etc/crontab (default /usr/bin:/bin when absent), /etc/cron.d/* and /etc/environment, stats every folder (metadata only) and fails on a world-writable folder without the sticky bit or on an empty, '.' or relative entry. Folders that cannot be stat'ed make the result incomplete.

## How to Fix

Remove the writable folder from PATH in /etc/crontab (or chmod o-w it), delete relative entries, and call programs in cron jobs by absolute path.

## How to Verify

```
grep ^PATH /etc/crontab /etc/cron.d/* ; for d in $(grep ^PATH /etc/crontab | cut -d= -f2 | tr : ' '); do stat -c '%a %n' $d; done
```

## Learn the Theory

- [P20 Secrets, Cron and Account Hygiene](https://openvapt.com/academy/p20.md)

## References

- [MITRE ATT&CK T1574.007, Hijack Execution Flow: Path Interception by PATH Environment Variable](https://attack.mitre.org/techniques/T1574/007/)
- [crontab(5), Linux man-pages](https://man7.org/linux/man-pages/man5/crontab.5.html)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/host/hygiene.go

Run it: `openvapt scan --only HOST-CRON-002`. Read it offline: `openvapt explain HOST-CRON-002`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/HOST-CRON-002.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
