T09 · Insecure Skill Coding Practices
- Location
scripts/lib/fulcra_annotations.py:24- Finding
Configurable Fulcra API Endpoint Can Exfiltrate the Access Token and Personal Data
- Content
View full analysis
str: env_token = os.environ.get("FULCRA_ACCESS_TOKEN") if env_token: return env_token.strip() env = os.environ.copy() env["HOME"] = DEFAULT_HOME command = os.environ.get("FULCRA_CLI_COMMAND", "uv tool run fulcra-api") candidates = [[*shlex.split(command), "auth", "print-access-token"]] for cmd in candidates: try: token = subprocess.check_output( cmd, env=env, text=True, stderr=subprocess.DEVNULL, timeout=45, ).strip() except (FileNotFoundError, subprocess.CalledProcessError, subprocess.TimeoutExpired): continue if token: return token fail("No Fulcra token available. Set FULCRA_ACCESS_TOKEN or run Fulcra CLI auth login.") def request(method: str, path: str, payload: Any | None = None) -> tuple[int, str]: data = None headers = {"Authorization": f"Bearer {access_token()}"} if payload is not None: data = json.dumps(payload).encode() headers["Content-Type"] = "application/json" req = urllib.request.Request(API_BASE + path, data=data, headers=headers, method=method) try: with urllib.request.urlopen(req, timeout=30) as response: body = response.read() return response.status, body.decode() if body else "" ``` ### Technical Analysis The destination receiving the Fulcra bearer token is selected directly from the `FULCRA_API_BASE` environment variable. There is no validation of the URL scheme, hostname, port, or redirect destination. Every request attaches the Fulcra ...[truncated 1802 chars]- Remediation
View remediation
