---
title: "HOST-FS-021 Shell Profile Sets a Permissive File Creation Mask"
canonical: https://openvapt.com/checks/HOST-FS-021.html
html: https://openvapt.com/checks/HOST-FS-021.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-FS-021 Shell Profile Sets a Permissive File Creation Mask

Checks that system-wide shell start-up files do not set a umask that leaves new files readable by every user.

- Domain: Server
- Severity: Low
- 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:L/I:N/A:N`
- CIS Controls v8: 3.3
- NIST CSF 2.0: PR.AA-05, PR.DS-01
- CWE: CWE-276
- NIST SP 800-53 Rev. 5: AC-6, CM-6
- Benchmark topic: Default user umask in shell start-up files (CIS Controls v8 3.3) (topic only, no benchmark text)

## Why It Matters

A umask line in /etc/profile or /etc/bash.bashrc overrides the login.defs default for every interactive shell. Many distributions still ship  umask 022  there, which makes every file an administrator creates readable by all local accounts.

## How It Detects

Reads /etc/profile, /etc/bash.bashrc, /etc/bashrc, /etc/zsh/zshrc and /etc/profile.d/*.sh and finds lines of the form  umask NNN. A value that leaves the 'other' read bit open (022, 002, 000) fails; 027 or stricter passes. Files that exist but could not be read fully make the check incomplete; when no shell file sets a umask the check is skipped (HOST-FS-009 covers login.defs).

## How to Fix

Change every  umask 022  line in the listed files to  umask 027, or remove the line so the login.defs value applies. Users start a new login shell to pick it up.

## How to Verify

```
grep -rn '^[[:space:]]*umask' /etc/profile /etc/bash.bashrc /etc/bashrc /etc/profile.d/ 2>/dev/null
```

## Learn the Theory

- [P1 Linux Server Hardening](https://openvapt.com/academy/p1.md)
- [P17 Kernel, Filesystem and Boot Hardening](https://openvapt.com/academy/p17.md)

## References

- [umask(2), Linux man-pages](https://man7.org/linux/man-pages/man2/umask.2.html)
- [login.defs(5), Linux man-pages](https://man7.org/linux/man-pages/man5/login.defs.5.html)

## Source Code

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

Run it: `openvapt scan --only HOST-FS-021`. Read it offline: `openvapt explain HOST-FS-021`.

---

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-FS-021.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
