T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/openclaw_troubleshooting.py:291- Finding
Recursive Permission Repair Exposes the Entire OpenClaw Workspace
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real troubleshooting tool, but its repair paths can automatically install software and loosen permissions across the OpenClaw workspace without clear user confirmation.
Review this skill before installing on a shared or sensitive machine. Use diagnostic commands first, avoid quick_start.py and fix all unless you have reviewed the exact effects, back up the OpenClaw workspace, and prefer running dependency repairs in an isolated virtual environment rather than allowing system or user-level pip changes.
scripts/openclaw_troubleshooting.py:291Recursive Permission Repair Exposes the Entire OpenClaw Workspace
scripts/openclaw_troubleshooting.py:256Runtime Installation of Unpinned Packages Through Untrusted Pip Configuration
The documented purpose is troubleshooting and optimization, but the detected behavior includes modifying skill metadata/files, running version upgrade flows, invoking external subprocesses for publishing, and publishing skills to ClawHub. That is a substantial privilege and behavior expansion beyond user-expected troubleshooting, creating a risk of unauthorized code/package changes or supply-chain actions under the guise of repair. A description-behavior mismatch is especially dangerous because it defeats informed consent and makes risky actions easier to hide.
The document repeatedly promotes 'automatic diagnosis, repair, and optimization' and later acknowledges 'data loss risk' and other high-risk outcomes, but it does not warn users to review changes, take backups, or require explicit confirmation before impactful actions. In a troubleshooting skill, this omission is dangerous because users are primed to trust automated fixes that may alter system state, permissions, dependencies, or files without informed consent.
The documentation advertises automatic repair capabilities such as dependency installation, permission repair, and workspace optimization without clearly warning that these actions may modify the local environment, install software, or alter filesystem permissions. In a troubleshooting skill, users are likely to trust and run these actions directly, which increases the chance of unintended system changes or data loss.
The listed commands include broad fix operations such as 'fix all', 'fix dependencies', and 'fix permissions' with no visible caution, scope limitation, or backup advice. Commands that alter dependencies or permissions can have security and availability consequences if run blindly, especially in a developer workstation context.
The README advertises automatic diagnosis and repair actions such as installing dependencies, fixing permissions, and repairing paths/workspace state, but it does not warn users that these actions can change their system or require confirmation. In a troubleshooting skill, undocumented modification behavior increases the risk of unintended package installs, permission changes, or filesystem alterations triggered by a user seeking simple diagnostics.
The invocation example uses a broad natural-language trigger ('我遇到了OpenClaw的问题,帮我诊断一下') that is close to an ordinary support request rather than a clearly scoped command. In an agent environment, this can cause the skill to activate unexpectedly during general conversation and potentially lead into automated troubleshooting or repair flows with side effects.
The skill advertises automated diagnosis, repair, optimization, and reporting, which strongly implies use of powerful capabilities such as shell, filesystem, environment access, and possibly network access. However, the manifest does not declare any tool scope or permissions boundaries, so users and the platform cannot verify or constrain what the skill may do at runtime. In a troubleshooting skill that may modify configs, install dependencies, and clear caches, missing scope declarations materially increases the risk of overreach or unintended destructive actions.
The skill promises automated repairs, dependency installation, path/permission fixes, and cache cleanup without warning that these actions may change system state. In a troubleshooting context, such actions can alter environments, remove cached data, or affect other applications, so omission of warnings increases the chance of accidental disruption and unsafe user trust. The danger is amplified because 'automatic fix' language encourages execution without careful review.
Log analysis and report generation can process sensitive information such as file paths, usernames, tokens, hostnames, stack traces, and proprietary content. Without any privacy or data-handling notice, users may unknowingly expose sensitive data to storage, summaries, or external transmission, particularly if reports are shared or uploaded. In a troubleshooting skill, this is a real confidentiality risk because logs commonly contain secrets and operational details.
This code file contains user-facing natural-language strings and docstrings exclusively in Chinese, including the module description and runtime output. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in, and no alternative language option or justification is provided here.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
machine = platform.machine()
if system == 'Darwin':
mac_version = subprocess.check_output(['sw_vers', '-productVersion'], text=True).strip()
return {
"system": system,
"version": mac_version,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"full_version": platform.version()
}
elif system == 'Linux':
distro = subprocess.check_output(['lsb_release', '-d'], text=True).strip().split(':')[1].strip()
return {
"system": system,
"version": version,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
version = platform.python_version()
interpreter = sys.executable
pip_version = subprocess.check_output([sys.executable, '-m', 'pip', '--version'], text=True).strip()
return {
"version": version,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
missing_packages = []
try:
pip_output = subprocess.check_output([sys.executable, '-m', 'pip', 'list'], text=True)
for package in required_packages:
if re.search(rf'\b{re.escape(package)}\b', pip_output, re.IGNORECASE):
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
missing_packages = []
try:
pip_output = subprocess.check_output([sys.executable, '-m', 'pip', 'list'], text=True)
for package in required_packages:
if re.search(rf'\b{re.escape(package)}\b', pip_output, re.IGNORECASE):
The skill modifies the Python environment by automatically running package installs, including forced system-level installs with --break-system-packages. This is dangerous because it can execute unreviewed package code, break managed environments, and create persistence or dependency-confusion risk under the guise of troubleshooting.
Automatic package installation without warning or confirmation removes an important safety checkpoint before executing code-fetching and environment-modifying operations. In a troubleshooting skill, this raises the chance that users will trigger risky changes unintentionally while expecting safe diagnostics.
This installs Python packages automatically and even uses --break-system-packages, which can modify protected system environments and override package-management safeguards. In a troubleshooting skill, this is more dangerous because users may run it expecting diagnostics, but it can perform high-impact environment changes that destabilize the host or introduce unreviewed code from package repositories.
# Try to install with --break-system-packages flag
try:
for package in missing_packages:
subprocess.check_output([sys.executable, '-m', 'pip', 'install', package, '--break-system-packages'])
print("✅ 依赖项安装完成")
return True
This fallback path still performs automatic package installation, albeit in user mode. While less severe than system-level installation, it still executes package-management changes without review and can pull arbitrary third-party code into the runtime environment.
# Try to install with --user flag
try:
for package in missing_packages:
subprocess.check_output([sys.executable, '-m', 'pip', 'install', package, '--user'])
print("✅ 依赖项安装完成")
return True
The skill recursively changes filesystem permissions over the workspace and skills directories. Broad recursive permission changes can unintentionally expose data, weaken local access controls, and damage the integrity of project files, especially when the path is derived from relative directory traversal.
The recursive chmod operation changes permissions without explicit safety messaging or confirmation. That is dangerous because permission changes are high-impact, potentially irreversible at scale, and may weaken confidentiality or integrity protections across the workspace.
This recursively changes permissions on the computed workspace directory to 755, which can broaden access to all files and subdirectories under that tree. In a troubleshooting skill, automatically mass-changing permissions is dangerous because it may expose sensitive workspace contents or alter security assumptions without confirmation.
try:
# Fix workspace permissions
if os.path.exists(self.workspace_dir):
subprocess.check_output(['chmod', '-R', '755', self.workspace_dir])
# Fix custom skills directory permissions
custom_skills_dir = os.path.join(self.workspace_dir, 'custom-skills')
This performs another recursive chmod 755 on the custom-skills directory, potentially making skill contents broadly readable and executable. If that directory contains private code, tokens, or configuration files, the permission widening can create unintended exposure or facilitate tampering by local users.
# Fix custom skills directory permissions
custom_skills_dir = os.path.join(self.workspace_dir, 'custom-skills')
if os.path.exists(custom_skills_dir):
subprocess.check_output(['chmod', '-R', '755', custom_skills_dir])
print("✅ 权限修复完成")
return True
This code presents its top-level description in Chinese and consistently emits Chinese user-facing status/error messages throughout the script, indicating a fixed language choice. The file provides no opt-in, locale selection, or justification that this is a region-specific tool, which conflicts with the policy against forcing a specific language without user choice.
The script launches external test and publishing subprocesses that are unrelated to end-user troubleshooting scope, broadening the behavior of the skill package beyond its stated purpose. This increases attack surface and trust risk because users or reviewers expecting diagnostic tooling may inadvertently run release-oriented commands with network or account implications.
No suspicious patterns detected.