T07 · Tool Hijacking and Spoofing
- Location
scripts/find_auth_skill.py:43- Finding
Weak Authentication Helper Discovery Permits Tool Spoofing and Arbitrary Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/find_auth_skill.py:43-61, with the execution sink atscripts/run_idlink_project.py:91-99
Vulnerability Type: Untrusted local tool discovery and execution
Risk Level: MediumComplete Code Snippet
Discovery logic in
scripts/find_auth_skill.py:python # Second layer: dynamically scan all possible directories scan_dirs = [ Path.home() / ".skills", Path.home() / ".openclaw" / "workspace" / "skills", Path.home() / ".openclaw" / "skills", Path.cwd() / ".skills", ] for scan_dir in scan_dirs: if scan_dir.exists(): for skill_dir in scan_dir.iterdir(): if skill_dir.is_dir(): auth_path = skill_dir / "scripts" / "minri_dmp_api.py" if auth_path.exists(): try: with open(auth_path, 'r', encoding='utf-8') as f: content = f.read(500) if "明日DMP" in content or "mingdata" in content.lower(): return auth_path except: continueExecution sink in
scripts/run_idlink_project.py:python def call_api_via_auth(auth_script: Path, method: str, endpoint: str, body: dict, timeout=60): try: result = subprocess.run( ["python3", str(auth_script), method.upper(), endpoint, json.dumps(body, ensure_ascii=False)], capture_output=True, text=True, timeout=timeout, )Technical Analysis
When an authentication helper is not found at one of the preferred fixed paths, the Skill scans every immediate child directory under several user- and workspace-controlled skill locations. It accepts any file named
scripts/minri_dmp_api.pyif one of two easily forged keywords appears within its first 500 characters.This content check does not establish the helper's identity or integrity. It verifies neither a tru ...[truncated 2181 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the fallback that scans arbitrary sibling skill directories.
- Resolve the authentication helper only through an exact, platform-provided skill identity or an explicitly configured trusted path.
- Canonicalize the selected path with
Path.resolve()and verify that it remains inside an approved authentication-skill directory. - Verify the helper through a trusted manifest, cryptographic signature, or pinned file hash before execution.
- Validate ownership and permissions so untrusted local users or workspace content cannot replace the helper.
- Fail closed if the expected authenticated component cannot be found or verified; do not fall back to keyword-based discovery.
- Where supported, import or invoke the helper through a platform registry that enforces package identity rather than executing a discovered Python file.
- Apply the same hardened resolver to all scripts that independently locate or execute
minri_dmp_api.py, including audience and status-query helpers.
