T09 · Insecure Skill Coding Practices
- Location
scripts/jmap_client.py:95- Finding
JMAP bearer token can be transmitted to an untrusted network endpoint
- Content
View full analysis
Dict[str, str]: return {"Authorization": f"Bearer {self.token}", "Content-Type": "application/json"} def session(self) -> JmapSession: if self._session: return self._session url = self.base_url + JMAP_SESSION_PATH req = urllib.request.Request(url, headers=self._headers()) try: with urllib.request.urlopen(req, timeout=30) as r: data = json.loads(r.read()) except Exception as e: raise FastmailError(f"Failed to fetch JMAP session: {e}") api_url = data.get("apiUrl") if not api_url: raise FastmailError("JMAP session response missing apiUrl") if self._account_id_override: account_id = self._account_id_override else: accounts = data.get("accounts") or {} if not accounts: raise FastmailError("JMAP session response has no accounts") account_id = list(accounts.keys())[0] self._session = JmapSession(api_url=api_url, account_id=account_id) return self._session def call(self, method_calls: List[list], *, using: Optional[List[str]] = None) -> Dict[str, Any]: sess = self.session() for mc in method_calls: if isinstance(mc, list) and len(mc) >= 2 and isinstance(mc[1], dict): ...[truncated 2442 chars]- Remediation
View remediation
