T05 · Unauthorized Access and Privilege Escalation
- Location
entrypoint_helpers.py:22- Finding
Host secrets are loaded and inherited by untrusted benchmark agent processes
- Content
View full analysis
list[Path]: candidates: list[Path] = [] openclaw_root = os.environ.get("OPENCLAW_ROOT", "").strip() if openclaw_root: candidates.append(Path(openclaw_root) / "secrets.env") openclaw_workspace = os.environ.get("OPENCLAW_WORKSPACE", "").strip() if openclaw_workspace: candidates.append(Path(openclaw_workspace).parent / "secrets.env") if skill_root.parent.name == "skills" and skill_root.parent.parent.name == "workspace": candidates.append(skill_root.parent.parent.parent / "secrets.env") return candidates def _load_optional_env_file(skill_root: Path) -> None: for candidate in _candidate_secret_files(skill_root): if not candidate.is_file(): continue for raw_line in candidate.read_text(encoding="utf-8").splitlines(): line = raw_line.strip() if not line or line.startswith("#") or "=" not in line: continue key, value = line.split("=", 1) key = key.strip() if not key or key in os.environ: continue value = value.strip().strip("'\"") os.environ[key] = value return ``` ```python def install(self, env: dict[str, str] | None = None) -> dict[str, str]: prepared_env = dict(env or os.environ) self.bin_dir.mkdir(parents=True, exist_ok=True) wrapper_path = self.bin_dir / "bash" wrapper_path.write_text(SHIM_WRAPPER, encoding="utf-8") wrapper_path.chmod(0o755) sh_path = self.bin_dir / "sh" sh_path.write_text(SHIM_WRAPPER, encoding="utf-8") sh_path.chmod(0o755) prepared_env["GIGO_SHELL_SHIM_LOG"] = str(self.log_path) ...[truncated 2936 chars]- Remediation
View remediation
