# Ensure World Writable Files and Directories Are Secured

- Source: https://support.icompaas.com/support/solutions/articles/62000235408-ensure-world-writable-files-and-directories-are-secured
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Amazon Linux 2 Benchmark v3.0.0](https://support.icompaas.com/support/solutions/62000112696) › [CIS Amazon Linux 2 Benchmarks](https://support.icompaas.com/support/solutions/folders/62000169265)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

Profile Applicability:  
Level 1

Description: World writable files and directories allow any user to modify or write to them, which can lead to unauthorized data modification, privilege escalation, or system compromise.

Rationale: Securing world writable files and directories reduces the risk of unauthorized access or malicious changes, helping maintain system integrity.

**Impact:** **Pros:**

-   Protects critical system and user files from unauthorized modifications.  
    
-   Mitigates risk of privilege escalation via writable files.  
    

**Cons:**

-   Restrictive permissions may impact legitimate multi-user workflows if not managed properly.  
    

Default Value: World writable files and directories may exist due to default application configurations or misconfigurations.

Pre-requisites:

-   Root or sudo privileges to audit and modify file permissions.  
    

Remediation:

### Test Plan:

Using Linux command line:

1.  Find all world writable files:
    
    find / -xdev -type f -perm -0002 -print
    
2.  Find all world writable directories:
    
    find / -xdev -type d -perm -0002 -print
    
3.  Review and verify the necessity of these permissions.  
    

### Implementation Plan:

Using Linux command line:

1.  Remove world writable permission from files/directories where not needed:
    
    chmod o-w /path/to/file\_or\_directory
    
2.  For directories requiring sticky bit (e.g., /tmp), ensure sticky bit is set:
    
    chmod +t /path/to/directory
    
3.  Document changes and monitor permissions regularly.  
    

### Backout Plan:

Using Linux command line:

1.  Restore previous permissions from backups if needed.  
    
2.  Communicate with users if permission changes impact functionality.  
      
    

References:

-   CIS Amazon Linux 2 Benchmark v3.0.0  
    
-   [NIST SP 800-53 Revision 5 - CM-6  
      
    ](https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final#cm-6)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
