T09 · Insecure Skill Coding Practices
- Location
scripts/lib/fulcra_annotations.py:24- Finding
Environment-Controlled Fulcra API Endpoint Can Receive Bearer Credentials
- Content
View full analysis
Vulnerability Details
File Location:
scripts/lib/fulcra_annotations.py:24, 76-84
Vulnerability Type: Unvalidated credential-bearing API destination
Risk Level: MediumVulnerable Code
python API_BASE = os.environ.get( "FULCRA_API_BASE", "https://api.fulcradynamics.com" ).rstrip("/") 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 Fulcra client obtains its API base URL directly from the
FULCRA_API_BASEenvironment variable. It does not verify that the resulting URL uses HTTPS or belongs to an approved Fulcra host before attaching the Fulcra bearer token.An attacker who can influence the process environment can therefore redirect authenticated requests to an attacker-controlled origin. The affected request function is reachable from the primary workflow:
scripts/collect.pyinvokesfulcra_read.read_annotation_events(), which invokesfulcra_annotations.request()to retrieve annotation definitions and events.This issue requires the attacker to control the environment in which the skill runs. It does not independently grant an untrusted remote party that capability.
Attack Path
- The victim has a valid
FULCRA_ACCESS_TOKENor an authenticated Fulcra CLI session. - An attacker or compromised launcher sets
FULCRA_API_BASEto an attacker-controlled HTTP or HTTPS endpoint. - The victim runs
scripts/collect.py. - The collection workflow calls `fu ...[truncated 773 chars]
- The victim has a valid
- Remediation
View remediation
Remediation Suggestions
- Default to the fixed production endpoint and reject endpoint overrides in normal operation.
- Parse the configured URL with
urllib.parse.urlparse. - Require the
httpsscheme. - Require an exact allowlisted hostname, such as
api.fulcradynamics.com, rather than using suffix or substring checks. - Reject URLs containing user information, unexpected ports, fragments, or other ambiguous components.
- If custom endpoints are necessary for development, require a separate explicit opt-in flag and test credentials that cannot access production data.
- Before adding an authorization header, verify that the final request origin is trusted.
- Ensure redirects cannot forward authorization credentials to an unapproved origin.
- Run the skill from a trusted launcher that supplies a sanitized environment.
