Overview
The collected app/etc/env.php Unix permission bits are a subset of configured mode 0640, and its owner and group match the configured reference paths (the project root by default). This is an explicit deployment ownership policy, not proof of effective ACL or web-process access restrictions.
Why it Matters
The file app/etc/env.php stores very sensitive information. It includes database logins, encryption keys, and other secrets. If this file has weak permissions, any local user or process could read it. Attackers may then use those secrets to take over the database, steal customer data, or gain full control of the Magento store.
Strong file permissions limit access to only the web server user and trusted group. This reduces the chance that secrets leak through misconfigured hosting, shared servers, or malicious scripts running on the same machine. Protecting env.php is one of the most important steps to keep the store secure.
Verification Steps
Manual Verification
- Compare the file owner and group with the configured reference paths, normally the project root.
- Check that its permission bits are a subset of 0640; separately inspect ACLs and the PHP worker identity.
- Do not print the file contents into a ticket.
Command / Review Sample
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
- Investigate and change: Inspect app/etc/env.php ownership, mode and ACLs without printing its contents. Set its owner/group to the approved deployment model and remove permission bits outside the configured maximum; ensure PHP can still read required configuration.
- Validate the change: Compare stat/getfacl output with the finding policy and test the storefront/Admin. Do not change the entire project ownership to satisfy this single-file check.
- Rerun MB-0002 against the same release, profile and relevant file/key/package scope; compare the new evidence and inspect any independent collection gaps.
Examples
Illustrative examples only. Interpret them within the current revision criterion above; missing collection evidence is unresolved, never PASS.
Fail Example
644 deploy www-data app/etc/env.php
# Others can read: exceeds the configured 0640 mask.
Pass Example
640 deploy www-data app/etc/env.php
# Expected owner/group match the configured reference paths.
# ACL and effective worker access still need review.
Scope and Evidence Limits
Rule revision: 3. Target modes: LOCAL.
The collected app/etc/env.php Unix permission bits are a subset of configured mode 0640, and its owner and group match the configured reference paths (the project root by default). This is an explicit deployment ownership policy, not proof of effective ACL or web-process access restrictions.
The collected app/etc/env.php Unix permission bits are a subset of configured mode 0640, and its owner and group match the configured reference paths (the project root by default). This is an explicit deployment ownership policy, not proof of effective ACL or web-process access restrictions.
Catalog coverage describes implementation capability, not a scan outcome. An incomplete manual review cannot establish that the criterion is satisfied.