T07 · Tool Hijacking and Spoofing
- Location
scripts/status.py:41- Finding
External Module Path Precedence Allows Tool Hijacking During Status Checks
- Content
View full analysis
dict: try: sys.path.insert(0, str(Path.home() / ".fulcra-concierge" / "lib")) import fulcra_annotations as fa tok = fa.access_token() # raises/exits if unavailable return {"available": bool(tok)} except SystemExit: return {"available": False, "reason": "no Fulcra token (run: uv tool run fulcra-api auth login)"} except Exception as exc: return {"available": False, "reason": str(exc)[:200]} ``` The bundled bootstrap logic normally prefers the library shipped with the Skill: ```python for _c in _candidates(): if (_c / "concierge_cli.py").exists() and str(_c) not in sys.path: sys.path.insert(0, str(_c)) break ``` However, `status.py` subsequently inserts `~/.fulcra-concierge/lib` at index zero immediately before importing `fulcra_annotations`, overriding the bundled-library precedence. ### Technical Analysis Python executes the top-level code of a module when it is imported. By prepending a mutable external directory to `sys.path`, the status check allows a file named `fulcra_annotations.py` in that directory to replace the reviewed implementation bundled under `scripts/lib`. The code does not verify the imported module's resolved path, ownership, permissions, integrity, or signature. Consequently, the legitimate-looking call to `fa.access_token()` can invoke attacker-controlled Python code. This is especially significant because `SKILL.md` directs the Agent to run the status command before orchestrating other concierge functionality. The vulnerable import therefore lies on a routine execution path rather than an obscure administrative path. ### Attack Path 1. An attacker or compromised local process creates: `~/.fulcra-concierge/lib/fulcra_annotations.py`. 2. The ...[truncated 1287 chars]- Remediation
View remediation
