← Back to Baseline

MB-0799

Automated Application worker code paths are read-only

MB-C01 File & Folder Permissions Medium

For every explicitly supplied PHP-FPM worker PID, the scanner and worker have identical effective UID/GID/groups, zero effective/permitted/ambient capabilities, matching project tree, mount namespace and Linux security context. Kernel access observations find no writable object or replaceable code root in the complete bounded configured app/vendor/lib inventory. Unsupported identity, seccomp, links or inventory gaps remain UNKNOWN.

Overview

For every explicitly supplied PHP-FPM worker PID, the scanner and worker have identical effective UID/GID/groups, zero effective/permitted/ambient capabilities, matching project tree, mount namespace and Linux security context. Kernel access observations find no writable object or replaceable code root in the complete bounded configured app/vendor/lib inventory. Unsupported identity, seccomp, links or inventory gaps remain UNKNOWN.

Why it Matters

Application write access to code can turn an exploited process into a persistent modified release. Effective worker context matters more than a nominal owner or mode.

Capabilities, namespaces and replacement rights can invalidate an otherwise reassuring permission listing, which is why collection prerequisites are strict.

Verification Steps

Manual Verification

  1. Bind every configured worker PID to the assessed deployment.
  2. Compare effective UID/GID/groups, capabilities, mount namespace and Linux security context, then verify kernel access observations over the complete bounded app/vendor/lib tree.
  3. Unsupported identity, seccomp or collection conditions remain unresolved.

Command / Review Sample

ps -eo pid,user,group,args
# For each approved worker, review status, mount/security context and complete kernel access evidence.
# Do not substitute a different CLI account for the verified worker identity.

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. Identify the exact reported writable code path and whether access comes from file ownership, runtime group, ACL or writable parent. Separate deployment ownership from the PHP-FPM runtime identity; restrict that runtime identity from writing app/vendor/lib and their replaceable parents while preserving required writable var/generated/pub paths for the deployment architecture. Do not recursively remove write permissions from every Magento path.
  2. Configure current worker_pids in .magebean/production-checks.json, run the scanner as their exact unprivileged identity and namespace, and rerun the kernel access check. Confirm deployment/upgrade procedures still work under their separate deployment identity.
  3. Rerun MB-0799 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

A verified worker can write code or replace a code root through its parent.

Pass Example

All supplied workers satisfy the binding/context prerequisites and have no assessed writable/replaceable code object.

Scope and Evidence Limits

Rule revision: 1. Target modes: LOCAL.

For every explicitly supplied PHP-FPM worker PID, the scanner and worker have identical effective UID/GID/groups, zero effective/permitted/ambient capabilities, matching project tree, mount namespace and Linux security context. Kernel access observations find no writable object or replaceable code root in the complete bounded configured app/vendor/lib inventory. Unsupported identity, seccomp, links or inventory gaps remain UNKNOWN.

Run scanner as the actual unprivileged worker identity; root or differing identity is unsupported rather than a violation. All worker PIDs to be assessed must be explicitly supplied; no discovery-completeness claim. Unsupported worker mode, nonzero seccomp filters, sticky parent rules, external links or missing /proc permissions yield UNKNOWN. No code writes or privilege changes are performed. Original historical criterion and ID remain in the engineering backlog; this new ID records only its exact supported observation.

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

References