T09 · Insecure Skill Coding Practices
- Location
feishu-config.env:1- Finding
Live Feishu application credentials committed to the project
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is broadly consistent with creating Feishu documents, but it packages real-looking Feishu credentials and uses persistent tokens, remote code installation, and document permission changes that need careful review.
Review before installing. Rotate the packaged Feishu app secret if it was real, remove credential files from the package, pin or vendor any remote code, restrict API domains to official Feishu hosts, store tokens in a protected secret store, and require explicit confirmation before adding collaborators or transferring document ownership.
feishu-config.env:1Live Feishu application credentials committed to the project
scripts/check_config.py:77Unvalidated API domain permits credential, OAuth code, token, and content exfiltration
original-skill/feishu-doc-creator-with-permission/scripts/auto_auth.py:25OAuth state is generated but not validated by the callback handler
错误: {error}
请检查授权 URL 中的权限范围是否正确
""".encode('utf-8')) auth_code = f"ERROR: {error}" server_running = False return # 获取授权码 if 'code' in query_params: auth_code = query_params['code'][0] print(f"[OK] 收到授权码: {auth_code[:20]}...") ``` A state value is generated and sent, but not retained or checked by the callback: ```python scope = 'drive:drive docs:doc docx:document docs:permission.member:create offline_access' state = secrets.token_urlsafe(16) redirect_uri = config.get('FEISHU_OAUTH_REDIRECT_URI', 'http://localhost:8080/callback') port = int(redirect_uri.split(':')[-1].split('/')[0]) auth_url = ( f"https://accounts.feishu.cn/open-apis/authen/v1/authorize?" f"client_id={config['FEISHU_APP_ID']}" f"&redirect_uri={urllib.parse.quote(redirect_uri)}" f"&scope={urllib. ...[truncated 1749 chars]original-skill/feishu-doc-creator-with-permission/scripts/auto_auth.py:139User access and refresh tokens are stored in plaintext without restrictive permissions
scripts/install_skill.py:23Unpinned remote repository is cloned and its Python code is executed
original-skill/feishu-doc-orchestrator/scripts/orchestrator.py:85Unvalidated workflow run name allows path traversal and writes outside the workflow directory
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
Cloning remote repositories, copying directories from workspace, creating files in the user's home directory, and performing interactive installation are materially different from converting Markdown to Feishu documents. These actions modify the local environment and can introduce supply-chain, persistence, or integrity risks if hidden behind a broadly described productivity skill.
The fallback access to .claude/feishu-config.env reaches into an agent/application config directory that may contain sensitive credentials outside the skill's own working data boundary. In a skill ecosystem, reading from agent config paths is high risk because it enables implicit secret harvesting and use of broader-scoped credentials without clear user intent.
"""加载飞书配置"""
config_path = Path(__file__).parent.parent.parent.parent / "feishu-config.env"
if not config_path.exists():
config_path = Path(".claude/feishu-config.env")
config = {}
if config_path.exists():
The script explicitly reads from the agent configuration area (.claude/feishu-config.env), which is a sensitive directory likely to contain app secrets. In a skill context, access to agent-managed config is more dangerous because it crosses from document processing into credential retrieval, and could expose FEISHU_APP_SECRET or related secrets to any code path that reuses this helper.
config_path = project_root / ".claude" / "feishu-config.env"
if not config_path.exists():
config_path = Path(".claude/feishu-config.env")
config = {}
if config_path.exists():
The script prints the first 30 characters of the access token to stdout after successful authorization. Even partial credential disclosure is sensitive because terminal logs, shell history capture, CI logs, screen recordings, or shared consoles can leak reusable token material and aid token theft or correlation with other exposed data.
print("=" * 70)
print("授权成功!")
print("=" * 70)
print(f"Access Token: {token_data['access_token'][:30]}...")
print(f"有效期: {token_data['expires_at'] - int(time.time())} 秒")
print(f"权限范围: {token_data['scope']}")
print()
The script accesses files under the agent's .claude directory to read configuration and later reads stored tokens from .claude/feishu-token.json. In an agent-skill setting, access to the agent config directory is sensitive because it may expose secrets and account credentials beyond the immediate task, and the skill uses those secrets to perform authenticated actions against an external service.
project_root = Path(__file__).parent.parent.parent.parent.parent
config_path = project_root / ".claude" / "feishu-config.env"
if not config_path.exists():
config_path = Path(".claude/feishu-config.env")
config = {}
if config_path.exists():
The fallback read from .claude/feishu-config.env accesses the agent configuration area, which commonly stores sensitive tokens and secrets outside the skill's own declared inputs. In a skill ecosystem, reaching into agent config directories is dangerous because it broadens secret access and may bypass normal consent and scoping expectations.
"""加载飞书配置"""
config_path = Path(__file__).parent.parent.parent.parent / "feishu-config.env"
if not config_path.exists():
config_path = Path(".claude/feishu-config.env")
config = {}
if config_path.exists():
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
如果需要重新登录(如登录过期):
# 删除登录状态
rm -rf .claude/playwright_state
# 再次运行验证器,会提示重新扫码
python .claude/skills/feishu-doc-verifier/scripts/doc_verifier.py <doc_info.json>
The script reads secrets and tokens from the agent's .claude directory, including app credentials and user access tokens, which are highly sensitive. In a skill environment, accessing agent-local config/token stores increases the blast radius: if the skill is triggered unexpectedly or repurposed, it can use standing credentials to modify external resources without fresh user authorization.
project_root = Path(__file__).parent.parent.parent.parent
config_path = project_root / ".claude" / "feishu-config.env"
if not config_path.exists():
config_path = Path(".claude/feishu-config.env")
config = {}
if config_path.exists():
This script can transfer ownership of an existing Feishu document to another user, which goes beyond the stated skill purpose of Markdown-to-document conversion and collaborative document creation. In an agent/skill context, this is sensitive privilege-changing behavior that could reassign control of user content if invoked on arbitrary document IDs, especially since the script accepts target IDs directly from CLI input and performs no authorization or scope checks tied to user intent.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
cmd.append("--verbose")
# 设置环境变量
env = os.environ.copy()
config_file = load_config()
if config_file:
# 设置配置路径环境变量
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
cmd.append("--verbose")
# 设置环境变量
env = os.environ.copy()
config_file = load_config()
if config_file:
# 设置配置路径环境变量
The manifest describes a skill for converting Markdown into Feishu documents with block and permission support, but this file contains a fully authored UI/UX design specification for an "AgentForge" web interface, including design system, component lists, and export recommendations. That behavior/content is semantically different from Markdown conversion and suggests the skill is being used to generate unrelated design deliverables rather than orchestrating Feishu document creation.
The skill advertises significant capabilities involving environment access, file I/O, shell execution, and network calls, but it does not declare any tool scope or permission boundaries. This weakens user and platform visibility into what the skill can do and increases the risk of over-privileged execution, especially because the workflow handles secrets and remote APIs.
The activation language is broad enough to match general document-sharing or collaboration requests, which can cause the skill to run in situations beyond its safe intended scope. Given the presence of credential, permission, filesystem, and network capabilities, overbroad auto-invocation increases the chance of unnecessary privileged actions.
Ambiguous trigger conditions without negative examples make it harder for the agent to distinguish between safe conversion requests and broader document-related tasks. In this context, that ambiguity is dangerous because the skill appears capable of authentication, permission changes, local writes, and network activity that should not be auto-triggered casually.