T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Hardcoded Feishu Application Credentials Exposed in Documentation and Executable Scripts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill can operate on Feishu documents, but it ships live-looking credentials and tenant-specific scripts that upload local content to a fixed Feishu destination without clear user control.
Review carefully before installing. Do not use the bundled credentials; they should be revoked and replaced with your own securely stored Feishu credentials. Remove or ignore the tenant-specific scripts unless you explicitly intend to upload that exact local file to that exact Feishu folder, and verify any remote create, upload, import, or delete operation before running it.
SKILL.md:12Hardcoded Feishu Application Credentials Exposed in Documentation and Executable Scripts
scripts/perfect_import_egg_cake.py:8Private Workspace File Is Uploaded to a Hardcoded Tenant Destination
scripts/feishu_docx_client.py:45Feishu Resource Identifiers and API Error Bodies Are Written to Logs
The skill description promises broad creation/editing capabilities but the implementation appears to perform only a narrow preset workflow against a fixed folder/resource using embedded credentials. This discrepancy is security-relevant because it conceals the true operational scope and destination of writes, making unauthorized or unintended modification of a specific Feishu resource more likely.
The skill description promises broad creation/editing capabilities but the implementation appears to perform only a narrow preset workflow against a fixed folder/resource using embedded credentials. This discrepancy is security-relevant because it conceals the true operational scope and destination of writes, making unauthorized or unintended modification of a specific Feishu resource more likely.
The skill description promises broad creation/editing capabilities but the implementation appears to perform only a narrow preset workflow against a fixed folder/resource using embedded credentials. This discrepancy is security-relevant because it conceals the true operational scope and destination of writes, making unauthorized or unintended modification of a specific Feishu resource more likely.
The skill description promises broad creation/editing capabilities but the implementation appears to perform only a narrow preset workflow against a fixed folder/resource using embedded credentials. This discrepancy is security-relevant because it conceals the true operational scope and destination of writes, making unauthorized or unintended modification of a specific Feishu resource more likely.
The documentation contains concrete App ID and App Secret values directly in setup instructions and code examples. Embedded live-looking credentials are highly dangerous because they can be harvested for unauthorized API access, token generation, remote document manipulation, and potential abuse of the associated Feishu tenant.
The skill not only exposes credentials but also normalizes hardcoded secret usage without any warning about secure handling. This encourages insecure operator behavior, increases the chance of credential reuse and leakage, and makes accidental compromise more likely in downstream copies of the example.
The skill declares no explicit tool scope or permissions despite clearly describing network-based API access and implying file access via the referenced client script. Missing scope declarations reduce transparency and can cause an agent or user to underestimate the skill’s effective capabilities, especially when combined with other undocumented behaviors flagged here.
The skill is described as creating and editing Feishu cloud documents, which can alter user data in an external service. However, the markdown does not include any explicit warning or confirmation note that using the skill will write to remote documents and may modify existing content.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"app_id": self.app_id,
"app_secret": self.app_secret
}
res = requests.post(url, json=payload)
res.raise_for_status()
return res.json().get("tenant_access_token")
The skill description says it creates and edits Feishu docx documents, but the implementation also uploads arbitrary local files and deletes remote cloud files. This capability mismatch is dangerous because users or upstream agents may grant trust based on the narrower description, leading to unintended exfiltration of local data or destructive actions in Feishu Drive.
The upload_file method sends arbitrary local file contents to Feishu over the network without any built-in disclosure, confirmation, or restriction on what may be uploaded. In an agent skill context, this increases the risk of silent exfiltration of sensitive local files if the caller passes an unexpected path.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
}
print(f"DEBUG Payload: {json.dumps(payload)}")
res = requests.post(url, headers=headers, json=payload)
if res.status_code != 200:
print(f"DEBUG Response: {res.text}")
res.raise_for_status()
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
}
print(f"DEBUG Payload: {json.dumps(payload)}")
res = requests.post(url, headers=headers, json=payload)
if res.status_code != 200:
print(f"DEBUG Response: {res.text}")
res.raise_for_status()
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
check_url = f"https://open.feishu.cn/open-apis/drive/v1/import_tasks/{ticket}"
while True:
time.sleep(1)
check_res = requests.get(check_url, headers={"Authorization": f"Bearer {self.tenant_access_token}"})
check_res.raise_for_status()
result_data = check_res.json()["data"]["result"]
if result_data["job_status"] == 0: # 成功
The delete_file method performs a remote deletion action with no confirmation, safety interlock, or user-facing warning. In an automation or agent setting, this can cause unintended destructive changes to cloud data if a wrong token is supplied or the action is triggered unexpectedly.
The script contains a hard-coded absolute local file path and reads that file's full contents, then later uploads the content to Feishu. In the context of a reusable skill, this creates a real data exposure risk because it normalizes accessing a user's local filesystem and transferring content off-host without validation, minimization, or clear consent controls.
The script reads a local Markdown file and sends its contents to a third-party service using API credentials, but provides no user-facing disclosure or consent step before transmission. This is dangerous because sensitive local data could be exfiltrated to an external platform unintentionally, especially in an agent/skill setting where users may not realize local files are being uploaded.
The file embeds application credentials directly in source code and uses them without any disclosure or secure handling. Hard-coded secrets are highly dangerous because anyone with access to the code can reuse them to access the associated Feishu application, potentially leading to unauthorized document operations and broader data exposure.
The script uses a hard-coded absolute local path pointing to a user workspace file, which can cause unintended access to local data and makes the behavior non-transparent. In an agent skill context, hard-coded filesystem access is risky because it may exfiltrate sensitive user content without prompting and is not limited by runtime user choice.
The upload_file call sends a local file to cloud storage, which is a direct exfiltration path for potentially sensitive local data. In this skill context, that is more dangerous because the code targets a specific local file and performs the transfer automatically using embedded credentials, without any runtime consent or data classification checks.
try:
# 1. 上传文件到云端
print(f"Uploading file: {file_path}")
file_token = client.upload_file(file_path, folder_token)
print(f"File uploaded, token: {file_token}")
# 2. 发起导入任务 (Markdown -> Docx)
The script performs file upload, remote import, and remote deletion operations even though the skill description emphasizes creating and editing Feishu docx documents. That expanded behavior increases the attack surface because local content is transmitted to the cloud and then a cleanup action deletes the uploaded source object without any explicit user approval or visibility into what data is being handled.
The script automatically uploads a local file to Feishu and deletes the temporary remote source file with no user warning, consent, or confirmation step. Silent cloud operations are dangerous because users may not realize local content is being transmitted off-device or that cleanup actions are modifying remote state.
The file hardcodes a Feishu App ID and App Secret directly in source code, exposing reusable credentials to anyone who can read the repository, logs, or packaged skill. Embedded secrets are easily leaked, difficult to rotate safely, and may allow unauthorized use of the Feishu API, document creation, or access within the associated tenant.
The script sends document content to Feishu using an external API but provides no user-facing notice or consent flow, so users may unknowingly transmit data off-host. In this specific file the content is not especially sensitive, but the skill is a generic document creation/editing capability and could be reused with sensitive content, making silent exfiltration to a third-party service a real privacy and security concern.
The line states the skill allows 老大 to operate on documents, implying a fixed form of address in Chinese rather than a user-selectable language or locale-neutral phrasing. This is a natural-language policy concern because it imposes a specific linguistic convention without opt-in.
No suspicious patterns detected.