T09 · Insecure Skill Coding Practices
- Location
scripts/client.py:94- Finding
Caller-Controlled API Base URLs Can Exfiltrate Credentials and Customer Data
- Content
View full analysis
None: self._api_key = api_customer_key self._cb_key = cb_customer_key self.api_base = (api_base or os.environ.get("CHAMPRO_API_BASE") or API_BASE).rstrip("/") self.cb_base = (cb_base or os.environ.get("CHAMPRO_CB_BASE") or CB_BASE).rstrip("/") self.timeout = int(os.environ.get("CHAMPRO_TIMEOUT") or timeout) self._session = None ``` The CLI forwards all input properties directly to action handlers: ```python args = read_stdin_json() try: result = handler(**args) ``` Credentials are subsequently sent to the selected base URL. For example: ```python def product_info(self, product_master: str) -> dict[str, Any]: payload = self._request( "GET", f"{self.api_base}/api/Order/ProductInfo", params={"ProductMaster": product_master, "APICustomerKey": self.api_key}, ) return self._checked(payload, "ProductInfo") ``` Order requests also send the API key and full order body to the selected endpoint: ```python path = _PLACE_ORDER_PROD if production else _PLACE_ORDER_SANDBOX body = {**body, "APICustomerKey": self.api_key} payload = self._request("POST", f"{self.api_base}{path}", json_body=body) ``` ### Technical Analysis The Skill documents `api_base` and `cb_base` as mock-testing overrides, but these values are accepted from ordinary action JSON through unrestricted `**credentials` parameters. `ChamproClient` ...[truncated 2758 chars]- Remediation
View remediation
