T09 · Insecure Skill Coding Practices
- Location
feishu_publisher.py:152- Finding
Feishu Credentials and Access Tokens Can Be Sent to an Arbitrary or Plaintext Endpoint
- Content
View full analysis
FeishuCredentials: """Resolve app credentials from args > env > openclaw.json.""" app_id = self.app_id or os.getenv("FEISHU_APP_ID", "").strip() app_secret = self.app_secret or os.getenv("FEISHU_APP_SECRET", "").strip() domain = self.domain or os.getenv("FEISHU_DOMAIN", "").strip() if not app_id or not app_secret or not domain: ocfg = self._read_openclaw_feishu_config() app_id = app_id or str(ocfg.get("appId") or "").strip() app_secret = app_secret or str(ocfg.get("appSecret") or "").strip() domain = domain or str(ocfg.get("domain") or "").strip() if not app_id or not app_secret: raise FeishuPublishError( "Missing Feishu app credentials. Set FEISHU_APP_ID/FEISHU_APP_SECRET " "or configure channels.feishu.appId/appSecret in openclaw.json" ) return FeishuCredentials( app_id=app_id, app_secret=app_secret, domain=domain or "feishu", ) @staticmethod def _default_openclaw_config_path() -> Path: openclaw_home = os.getenv("OPENCLAW_HOME", "").strip() if openclaw_home: return Path(openclaw_home).expanduser().resolve() / "openclaw.json" return Path.home().resolve() / ".openclaw" / "openclaw.json" @staticmethod def _domain_to_api_base(domain: str) -> str: value = (domain or "feishu").strip().lower().rstrip("/") if value.startswith("http://") or value.startswith("https://"): return value if value == "lark": return "https://open.larksuite.com" return "https://open.feishu.cn" def _get_tenant_access_token( self, *, api_base: str, app_id: str, app_secret: str ) -> str: if self._tenant_access_token: ret ...[truncated 2005 chars]- Remediation
View remediation
