T09 · Insecure Skill Coding Practices
- Location
helpers/video_analysis.py:19- Finding
Unrestricted outbound HTTP requests permit server-side request forgery
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Douyin analysis skill matches its stated purpose, but it needs review because it automatically fetches and processes media with weak scoping and under-disclosed third-party data flows.
Install only if you are comfortable with the agent fetching Douyin pages, downloading videos, writing temporary media files, extracting frames, and potentially using third-party parsing or vision services. Prefer running it in a sandbox, require explicit consent before external uploads, restrict requests to known Douyin/media hosts, limit file sizes and duration, and delete downloaded videos and frames after analysis.
helpers/video_analysis.py:19Unrestricted outbound HTTP requests permit server-side request forgery
helpers/video_analysis.py:94Caller-selected local files can be uploaded to an external vision service
The declared purpose is analysis of why a Douyin video became popular, but the implementation expands into metadata extraction, media downloading, and possible upload to third-party analysis services. This mismatch is dangerous because users may consent to content analysis without realizing their provided links, media, or derived data may be transmitted externally or stored locally.
The changelog documents capabilities to download videos, extract frames, and analyze visual content, but it does not mention consent, retention limits, or privacy safeguards. In a skill that auto-activates on shared Douyin links, this increases the risk of users not understanding that third-party content may be fetched and processed, creating privacy, copyright, and data-handling concerns.
The README states that the bot will automatically download remote video content, extract frames, and invoke ffmpeg/image tooling, but it does not disclose or constrain the resulting network access, local file creation, and external program execution. In an agent setting, silent automatic retrieval and processing of untrusted URLs increases the risk of SSRF-like access patterns, disk/resource abuse, and unsafe handling of hostile media files, especially when triggered just by sending a link.
The skill instructs the agent to perform network requests and shell-based media processing, but it declares no explicit tool scope or permission boundaries. This increases the chance of overbroad execution, because a simple video-analysis trigger can lead to fetching remote content and creating local files without clear least-privilege constraints.
The skill references third-party parsing APIs and online parsing sites without clearly warning that user-provided video URLs and related metadata may be shared with external services. This creates privacy and trust risks, especially because such services may log, retain, or further process the submitted links and extracted data.
The skill directs the agent to download user-supplied Douyin videos and write local files for frame extraction, but it does not clearly warn users that network retrieval and filesystem activity will occur. This is dangerous because it can surprise users, increase exposure to untrusted remote content, and create local artifacts without informed consent.
The skill broadens from video-performance analysis into harvesting comments and commenter metadata, which introduces collection of additional user-generated data unrelated to the core advertised function. This is risky because it expands surveillance and data processing scope without clear necessity, notice, or minimization.
Collecting commenter IP labels is not necessary for explaining why a video went viral and can expose coarse location metadata about third parties. Even if publicly surfaced by the platform, aggregating and processing this metadata creates avoidable privacy risk and exceeds the principle of data minimization.
The short-link resolution logic follows redirects for a user-supplied URL based only on a substring check for 'v.douyin.com'. This can be bypassed with crafted URLs containing that string in the path or query, leading the agent to make arbitrary outbound requests and follow attacker-controlled redirects, which is a classic SSRF pattern.
"""从抖音URL提取视频ID"""
# 处理短链接
if 'v.douyin.com' in url:
resp = requests.get(url, headers={
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15'
}, allow_redirects=True)
url = resp.url
The function performs a server-side HTTP request to a user-controlled URL without validating the scheme, host, or destination. In an agent context, this creates an SSRF primitive that can be abused to reach internal services, cloud metadata endpoints, or other unintended network targets, especially because the skill is supposed to process Douyin links but does not enforce that restriction.
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15'
}
resp = requests.get(url, headers=headers)
html = resp.text
# 从HTML中提取_ROUTER_DATA
The manifest describes a Douyin video breakdown/analysis skill triggered by a video link, focused on popularity, audience reach, and behavioral psychology. This code adds a separate capability to transmit a downloaded cover image to a third-party multimodal API for generic image analysis, which is not clearly justified by the stated skill purpose and broadens the skill into external content offloading.
The function reads a local image file, base64-encodes it, and sends it along with an API credential to a third-party service without any in-code disclosure, consent, or minimization. In an agent skill, silent transmission of user-derived or locally stored content to an external AI provider is a real privacy and data-governance risk even if the destination is legitimate.
The code sends data and authentication material to a third-party endpoint, creating a real external data-exfiltration path if misused or called on sensitive files. Although the endpoint appears legitimate, the lack of user notice, data classification checks, and scope limitation makes this a meaningful privacy/security issue in an agent environment.
image_base64 = base64.b64encode(f.read()).decode()
# 调用视觉模型
resp = requests.post(
"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
headers={
"Authorization": f"Bearer {api_key}",
The code sends data and authentication material to a third-party endpoint, creating a real external data-exfiltration path if misused or called on sensitive files. Although the endpoint appears legitimate, the lack of user notice, data classification checks, and scope limitation makes this a meaningful privacy/security issue in an agent environment.
image_base64 = base64.b64encode(f.read()).decode()
# 调用视觉模型
resp = requests.post(
"https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
headers={
"Authorization": f"Bearer {api_key}",
The user-facing changelog entries are written in Chinese, and there is no indication that the skill offers a language choice or that it is intentionally limited to a Chinese-speaking or region-specific context. Under SQP-3, forcing a specific language without user opt-in can be a natural-language policy violation.
The natural-language content of the skill is fully Chinese, including the title, description, and operating instructions, with no opt-in or alternative locale guidance. The policy rule calls for flagging language or locale constraints when a skill effectively forces a specific language without user choice or explicit justification.
The module docstring and most user-facing messages are written only in Chinese, with no indication that language can be selected or changed. This can violate language/locale policy when a skill imposes a single language without offering user choice or documenting a justified regional constraint.
No suspicious patterns detected.