T09 · Insecure Skill Coding Practices
- Location
SKILL.md:84- Finding
Hard-Coded Feishu Application Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 84–85; duplicated at lines 413–416
Vulnerability Type: Plaintext application secret embedded in Skill configuration
Risk Level: HighVulnerable Code
python app_id = "cli_a929129e4278dced" app_secret = "usgK70hkHYBTQTtqMUFUMeXPPQDp35CE"The credentials are used again when requesting a tenant access token:
python app_id = "cli_a929129e4278dced" app_secret = "usgK70hkHYBTQTtqMUFUMeXPPQDp35CE" url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" req = urllib.request.Request(url, data=json.dumps({"app_id": app_id, "app_secret": app_secret}).encode(), headers={"Content-Type": "application/json"}, method="POST")Technical Analysis
The Skill embeds a reusable Feishu application ID and secret directly in a plaintext Markdown file. Anyone who can download, inspect, log, or redistribute the Skill can recover these credentials without executing it.
The application secret is sent to Feishu's internal tenant-token endpoint to obtain a bearer token. Therefore, an attacker possessing the exposed values can attempt to authenticate as the application independently of the Skill. The resulting access is controlled by the permissions granted to the Feishu application, not by the legitimate user's intended article-saving operation.
Authentication is necessary for the declared cloud-storage feature, but distributing a shared secret in the Skill is not necessary and violates least-privilege and secret-management principles. Duplicating the secret also increases its exposure surface.
Attack Path
- An attacker obtains or reads the distributed
SKILL.md. - The attacker extracts the hard-coded application ID and secret.
- The attacker submits them to
https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal. - If the credentials remain active, Feishu returns a tenant access token.
- The attacker invokes Feishu APIs using the ...[truncated 837 chars]
- An attacker obtains or reads the distributed
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed Feishu application secret immediately.
- Remove all credential values from
SKILL.md, examples, source files, logs, and repository history. - Load credentials at runtime from an approved secret manager or protected environment variables.
- Fail securely when credentials are unavailable rather than falling back to embedded values.
- Prefer per-user OAuth authorization where feasible so cloud actions are attributable to and bounded by the invoking user.
- Restrict the Feishu application to the minimum drive and messaging scopes required by the declared functionality.
- Use separate credentials for development and production environments.
- Add automated secret scanning to prevent credentials from being committed or packaged again.
- Review Feishu access and API logs for unauthorized token issuance or activity involving the exposed application.
