T08 · Insecure Dependencies
- Location
scripts/business_query.py:59- Finding
Unverified External Skill Is Executed with User Privileges
- Content
View full analysis
Vulnerability Details
File Location:
scripts/business_query.py:28-31, 59-75; related unpinned dependency declaration atmanifest.yaml:25
Vulnerability Type: Unverified third-party dependency execution
Risk Level: MediumVulnerable Code
python # scripts/business_query.py:28-31 BAIDU_SEARCH_SCRIPT = os.path.expanduser( "~/.workbuddy/skills/baidu-search/scripts/search.py" )python # scripts/business_query.py:59-75 def search(self, query: str, count: int = 8): """调用 baidu-search 执行一次检索;不可用时返回 None。""" if not self.available: return None try: proc = subprocess.run( [ sys.executable, BAIDU_SEARCH_SCRIPT, json.dumps({"query": query, "count": count}, ensure_ascii=False), ], capture_output=True, text=True, timeout=30, ) if proc.returncode == 0 and proc.stdout.strip(): return json.loads(proc.stdout)yaml # manifest.yaml:25 dependencies: - baidu-search # Optional search acceleratorTechnical Analysis
The Skill declares
baidu-searchwithout a pinned version, authoritative source, checksum, signature, or other integrity constraint. At runtime, it resolves the dependency through a fixed path under the user's home directory.The only availability check is whether that path exists. The code does not verify that the target is a regular trusted file, reject symbolic links, validate ownership or permissions, compare a cryptographic digest, or establish the installed component's provenance. It then executes the target with the current Python interpreter and the invoking user's privileges.
Using an argument array rather than a shell command prevents the supplied company name from directly causing shell-command injection. However, this does not protect against replacement or compromise of the dependency itself.
Attack Path
- An attacker installs, comp ...[truncated 1333 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
baidu-searchto an exact reviewed version and document its authoritative registry or repository. - Resolve it through a trusted package or Skill manager rather than automatically trusting a fixed user-writable path.
- Verify a digital signature or cryptographic digest before execution. Fail closed if verification is unavailable or fails.
- Require explicit user configuration of the integration path and display the resolved target before first execution.
- Canonicalize the path with
realpath, reject unexpected symbolic links, and verify that the target is a regular file with trusted ownership and non-world-writable permissions. - Execute the dependency in a restricted environment with only the filesystem and network permissions required for search.
- Prefer an authenticated, versioned API boundary over executing another Skill's source file directly.
- Treat malformed or untrusted subprocess output as data only and preserve the existing no-shell argument invocation.
- Pin
