T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:69- Finding
Direct Access to Central Feishu Credentials and Hard-Coded Report Recipient
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent report-and-Feishu workflow, but it uses central Feishu credentials and sends PDFs to a fixed recipient without adequate user control.
Review this skill before installing. It should only be used in an environment where sending technology investment reports to the hardcoded Feishu recipient is intended, and where the Feishu app credentials in /root/.openclaw/openclaw.json are safe for agent-executed code to access. Prefer a version that uses platform-managed messaging, asks the user to confirm the recipient before every send, uses HTTPS/authenticated market data, and sandboxes PDF rendering.
SKILL.md:69Direct Access to Central Feishu Credentials and Hard-Coded Report Recipient
scripts/report.py:10Stock Quotes Retrieved Over Unauthenticated Plaintext HTTP
scripts/generate_report.py:61Report Generator Uses Plaintext HTTP for Financial Market Data
scripts/to_pdf.py:6Unrestricted Resource Resolution During Markdown-to-PDF Conversion
代码与声明在核心主题上部分一致:确实抓取财联社新闻、提取部分上市公司并获取股价、生成日报文本。但声明描述了完整的“生成与推送”流程,包括通过飞书发送完整Markdown报告、生成PDF附件,以及支持cron定时任务;这些能力在提供的代码中均未体现。代码只是一个本地生成报告并输出到stdout的脚本,没有任何飞书API调用、文件导出/PDF转换、消息发送、任务调度入口或定时器配置。此外,所谓“深度分析报告”在实现上仅是新闻筛选加股价表格,缺少分析逻辑。因此描述明显高于实际行为,属于描述与代码行为不匹配。
声明描述的是一个完整的“科技行业投资日报生成与推送”技能,核心能力包括新闻抓取、股价获取、分析报告生成、飞书推送和PDF附件生成。而提供的代码片段只是一个辅助脚本,功能范围明显更窄:查询股票价格和将现成 Markdown 转成 PDF。虽然其中“获取股价”和“生成PDF附件”与声明部分吻合,但缺失了声明中的主要业务流程与对外推送能力,因此代码实际行为不能充分代表所宣称的技能用途,属于明显不匹配。
The declared description presents a full end-to-end tech investment daily report workflow: data collection, market/stock retrieval, report generation, Feishu delivery, and PDF attachment creation. The supplied code chunk implements only the PDF-generation portion by converting provided Markdown into a PDF file. PDF creation is consistent with one supporting detail in the description, but the chunk’s actual primary behavior is much narrower than the declared purpose and lacks the main advertised capabilities. Therefore, the description does not accurately represent what this specific code chunk actually does.
The skill invokes shell/Python/bash capabilities but does not declare any tool scope or allowed-tools restrictions. That makes the skill harder to sandbox and review, and increases the chance that powerful execution paths are available without explicit user or platform awareness.
The manifest description and required report template are entirely specified in Chinese and require a Chinese-formatted日报 output, but do not state that this is optional or limited to a China-specific deployment context. That creates a language/locale policy concern because the skill appears to enforce a single language without user opt-in.
The skill silently transmits generated reports and PDF attachments to a fixed Feishu recipient without prominently warning the user in the description or runtime flow. Because reports may include sensitive analysis or user-supplied content, undisclosed outbound delivery materially increases data leakage risk.
The skill instructs reading Feishu app credentials directly from a local config file and then using them to call external APIs, despite already having a safer platform message action available. This expands the secret exposure surface and enables unauthorized use of tenant credentials for outbound messaging and file upload.
This duplicate finding points to the same authentication request that exchanges local credentials for a Feishu tenant access token. While token retrieval alone is not the final leak, in this skill it is an enabling step for unauthorized outbound file and message operations.
user_id = "ou_159cbb6a3791ff5a98f3a2a4b38e7d4c"
pdf_path = "/tmp/tech-invest-YYYYMMDD.pdf"
token = requests.post(
"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
json={"app_id": app_id, "app_secret": app_secret}
).json()["tenant_access_token"]
This duplicate finding points to the same authentication request that exchanges local credentials for a Feishu tenant access token. While token retrieval alone is not the final leak, in this skill it is an enabling step for unauthorized outbound file and message operations.
user_id = "ou_159cbb6a3791ff5a98f3a2a4b38e7d4c"
pdf_path = "/tmp/tech-invest-YYYYMMDD.pdf"
token = requests.post(
"https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
json={"app_id": app_id, "app_secret": app_secret}
).json()["tenant_access_token"]
This step uploads a local PDF file to Feishu, creating direct external transmission of generated content. Because the file originates from local temporary storage and may contain sensitive user or system-derived information, the upload is a concrete data exfiltration vector.
).json()["tenant_access_token"]
with open(pdf_path, "rb") as f:
file_key = requests.post(
"https://open.feishu.cn/open-apis/im/v1/files",
headers={"Authorization": f"Bearer {token}"},
data={"file_type": "pdf", "file_name": Path(pdf_path).name},
This duplicate finding identifies the message-send API call carrying the uploaded file to an external recipient. Given the hardcoded receive_id and absence of user-visible warnings, this is a real confidentiality risk rather than a harmless integration detail.
files={"file": f}
).json()["data"]["file_key"]
requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={"receive_id": user_id, "msg_type": "file", "content": json.dumps({"file_key": file_key})}
This duplicate finding identifies the message-send API call carrying the uploaded file to an external recipient. Given the hardcoded receive_id and absence of user-visible warnings, this is a real confidentiality risk rather than a harmless integration detail.
files={"file": f}
).json()["data"]["file_key"]
requests.post(
"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={"receive_id": user_id, "msg_type": "file", "content": json.dumps({"file_key": file_key})}
This code contains natural-language docstrings and user-facing status messages entirely in Chinese, starting with the module docstring and continuing through function descriptions and console output. Because the script provides no language selection, opt-in, or documented region-specific justification, it violates the language/locale policy criteria for forced language use.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
from datetime import datetime
def fetch_url(url):
result = subprocess.run(
['curl', '-s', '-L', '--max-time', '10', url],
capture_output=True
)
The script fetches stock data over plain HTTP, so responses can be modified by a man-in-the-middle or malicious network intermediary. Because the fetched values are inserted directly into the generated investment report, an attacker could tamper with prices or symbols and cause false financial analysis or misleading outbound messages.
if not codes:
return {}
query = ','.join(codes)
raw = subprocess.run(
['curl', '-s', f'http://qt.gtimg.cn/q={query}'],
capture_output=True
).stdout.decode('gbk', errors='ignore')
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if not codes:
return {}
query = ','.join(codes)
raw = subprocess.run(
['curl', '-s', f'http://qt.gtimg.cn/q={query}'],
capture_output=True
).stdout.decode('gbk', errors='ignore')
The script silently makes an outbound network request to fetch market data without any user-facing disclosure or consent mechanism. In the context of an agent skill that auto-generates and pushes investment reports, this hidden egress can expose usage patterns and create trust, compliance, and data provenance issues, especially because it uses plain HTTP and an external subprocess.
The Markdown-to-PDF path silently executes external binaries to transform user-controlled content into a PDF. In this skill's context, reports are auto-generated and pushed to Feishu, so undisclosed execution of external converters increases attack surface and may surprise operators who do not expect local tool execution or potential file/network access by rendering engines.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
for engine in [['pandoc', md_path, '-o', output_path, '--pdf-engine=weasyprint'],
['pandoc', md_path, '-o', output_path]]:
r = subprocess.run(engine, capture_output=True)
if r.returncode == 0:
return output_path
return None
The natural-language description and usage guidance are written only in Chinese, which imposes a specific language context without offering a choice or documenting that the skill is intentionally Chinese-only. Under the policy, locale or language constraints should be optional or clearly justified.
No suspicious patterns detected.