Summary
Crabbox versions before 0.9.0 contain a path traversal flaw in the Islo provider that allows crafted workspace paths to escape the intended /workspace directory.
When an attacker can control a .crabbox.yaml or crabbox.yaml file and sync.delete is enabled, they may trigger rm -rf and mkdir -p operations on arbitrary filesystem locations, leading to unintended file deletion or overwrite.
Affected context
This issue occurs in environments where Crabbox is used with the Islo provider and workspace paths are derived from user-supplied or repository-supplied configuration.
The vulnerability is present when:
- The Islo provider resolves workspace paths from
.crabbox.yamlorcrabbox.yaml - The resolution logic allows absolute or relative paths without enforcing confinement to
/workspace - The
sync.deleteoption is enabled, causing cleanup logic to runrm -rfandmkdir -pon the resolved workspace path
It primarily affects setups where Crabbox runs with filesystem access beyond the intended isolated workspace directory.
Exploit preconditions
- Attack surface: Configuration-driven workspace setup in Crabbox (Islo provider).
- Required access: Ability to introduce or modify
.crabbox.yamlorcrabbox.yamlin a project, repository, or path processed by Crabbox (e.g., through SCM access, pull requests, or controlling the source directory). - Trigger point: Execution of a Crabbox workflow where the Islo provider prepares the workspace and
sync.deleteis enabled, causing the cleanup/initialization logic to act on the computed path. - Why exploitation is possible: The path resolution logic accepts attacker-controlled absolute or relative paths (including traversal sequences like
../) and uses them directly inrm -rfandmkdir -pshell commands without validating or re-confining them to the intended/workspaceroot.
Why this happens
The root cause is insufficient validation of filesystem paths derived from configuration before using them in destructive file operations.
The Islo provider's workspace resolution code treats user-controlled path values from Crabbox configuration files as trusted and does not normalize and enforce that the effective path remains within the designated /workspace directory.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where relative segments and absolute paths allow an attacker to escape the intended directory boundary.
Combining this with cleanup logic that invokes rm -rf on the resolved path amplifies the impact from simple directory misplacement to arbitrary file deletion or overwrite.
Potential impact
- Deletion of arbitrary directories and files accessible to the Crabbox process on the host or container filesystem
- Overwriting of existing directories by creating new ones at attacker-chosen locations
- Disruption of CI/CD pipelines or developer environments by removing build artifacts, configuration, or source code
- Potential deletion of security-related files (logs, temporary data, or local caches), impacting observability and reliability
- In multi-tenant or shared environments, potential cross-project impact where one configuration affects another project's data
General mitigation guidance
Effective mitigation relies on constraining workspace paths and hardening file operation patterns rather than ad-hoc checks.
Structural defensive measures include:
- Enforce directory confinement: Normalize and resolve all configured workspace paths against a fixed root (e.g.,
/workspace), then verify that the resulting absolute path is a descendant of that root before using it. - Reject dangerous inputs: Disallow absolute paths and path segments like
..in user-supplied workspace configuration, or provide only a limited, enumerated set of valid workspace names. - Decouple destructive operations from untrusted input: Avoid passing raw, configuration-derived paths directly into commands such as
rm -rf. Use higher-level filesystem APIs with explicit checks that confirm the target is within an authorized directory. - Apply least-privilege filesystem access: Run Crabbox with only the minimal filesystem permissions required, so that even if a path escapes
/workspace, it cannot affect system-critical areas. - Safe defaults for deletion features: Default
sync.delete-like options to disabled or to restrictive behavior, requiring explicit, informed opt-in for destructive cleanup, especially when paths come from version-controlled configuration.
How teams detect issues like this
Potential detection approaches focus on both code-level analysis and operational monitoring:
- Static analysis and code review:
- Flag uses of configuration-derived strings in file deletion or directory creation operations (e.g.,
rm -rf,rmdir,File.delete) without prior normalization and confinement checks. - Look for path joining that does not canonicalize and validate the resulting path against a fixed root directory.
- Review provider implementations (like Islo) for assumptions that configuration paths are safe or pre-validated.
- Configuration policy enforcement:
- Implement repository or CI checks that restrict workspace-related keys in
.crabbox.yaml/crabbox.yamlto relative, simple paths without traversal segments. - Use policy-as-code tools to enforce rules on configuration files that drive build or workspace automation.
- Runtime monitoring:
- Monitor Crabbox execution environments for unexpected
rm -rfinvocations or directory deletions outside known workspace roots. - Log and periodically audit resolved workspace paths used by providers to catch anomalies or misconfigurations.
- Automated tooling:
- Integrate SAST or custom linters into the development pipeline to detect unsafe path handling patterns and highlight them during code review.

