← Back to Baseline

MB-0001

Automated No world-writable files or directories

MB-C01 File & Folder Permissions High

No world-writable files or directories; assess only the collected Magento deployment scope.

Overview

No world-writable files or directories; assess only the collected Magento deployment scope.

Why it Matters

Any other-write permission can let an untrusted local identity alter a path, not just the familiar 0777 mode. Modified PHP or deployment configuration can turn a limited foothold into persistent application changes.

Least-privilege ownership, groups and ACLs let cache/uploads work without making the whole project writable. Review effective access as well as the permission bits covered by this predicate.

Verification Steps

Manual Verification

  1. Run the permission search as an account that can read the complete project.
  2. Inspect each result with stat and getfacl; identify whether the application needs that path to be writable.
  3. An unreadable subtree leaves the review incomplete.

Command / Review Sample

find . -perm -0002 -print
stat -c '%a %U:%G %n' app/etc/env.php
getfacl app/etc/env.php

Use the assessed Magento project and the appropriate application or read-only review account. Replace example hosts, paths and identifiers with the assessment scope; configuration and source fragments are illustrative.

Remediation / Fix Guidance

  1. Investigate and change: Review each reported path with stat and getfacl and identify the deployment owner, PHP/web user and shared groups. Remove other-write permission only from the affected path; use a dedicated writable group or ACL for var, generated and pub/media instead of chmod -R 777.
  2. Validate the change: Verify effective write access as the real web user and rerun the filesystem check; confirm uploads, cache and deployment still work.
  3. Recheck MB-0001: Verify access as the relevant runtime identity and retest the affected upload, cache or release feature after the scoped change. Rerun against the same deployment; avoid recursive permission changes unrelated to the reported paths.

Examples

Illustrative examples only. Interpret them within the current revision criterion above; missing collection evidence is unresolved, never PASS.

Fail Example

777 deploy www-data pub/media/catalog/example.jpg
# Other-write is present.

Pass Example

664 deploy www-data pub/media/catalog/example.jpg
640 deploy www-data app/etc/env.php
# No other-write bits in these illustrative paths.
# Review the rest of the assessed tree and effective access too.

Scope and Evidence Limits

Rule revision: 2. Target modes: LOCAL.

No world-writable files or directories; assess only the collected Magento deployment scope.

This check covers only the collected observation. Missing collection scope, external controls and runtime behavior require separate evidence.

Catalog coverage describes implementation capability, not a scan outcome. An incomplete manual review cannot establish that the criterion is satisfied.

References