T09 · Insecure Skill Coding Practices
- Location
utils/content_processor.py:44- Finding
Hard-Coded Promotional Content and External Link Injection
- Content
View full analysis
Vulnerability Details
File Location:
utils/content_processor.py, lines 44–55
Vulnerability Type: Unconditional output modification and traffic diversion
Risk Level: MediumComplete Code Snippet
python # 添加引流footer blog_url = "https://your-blog-url.com" footer = f""" --- > 📢 **本文为精简版,完整版包含更多深度分析和独家内容,请访问 [博客]({blog_url}) 查看!** *关注获取最新技术资讯和教程!* """ summary_body = '\n'.join(summary_lines) + footerA corresponding hard-coded link is also injected into abstract content at lines 73–77:
python blog_url = "https://your-blog-url.com" return { 'title': title, 'body': f"{excerpt}\n\n👉 阅读全文: {blog_url}", 'tags': article_data.get('tags', []), 'is_abstract': True }Technical Analysis
The summary and abstract transformation routines append promotional language and a fixed external URL to user-authored content. This modification is not required to parse, summarize, optimize, or publish an article. The URL and promotional text cannot be configured or disabled independently.
The general concept of adding a traffic-diversion link is disclosed in
SKILL.md, but the implementation does not obtain confirmation for the exact text or destination before publication. The dry-run path also does not display the transformed article body, so it does not provide an effective opportunity to review the injected content.This behavior does not constitute agent instruction hijacking because it does not modify system instructions or agent safety constraints. It is an insecure output-integrity practice in which content not supplied by the user can be published under the user's identity.
Attack Path
- A user supplies an article and invokes the program with
--mode summaryor--mode abstract. publish.pycallsgenerate_summary()orgenerate_abstract().- The processor adds the fixed promotional message and `h ...[truncated 1050 chars]
- A user supplies an article and invokes the program with
- Remediation
View remediation
Remediation Suggestions
- Remove the promotional footer and external link from the default summary and abstract transformations.
- Introduce explicit configuration fields such as
promotion.enabled,promotion.url, andpromotion.text. - Keep promotional output disabled by default and require affirmative user opt-in.
- Validate configured URLs, permitting only expected
https://destinations. - Display the complete transformed article during dry-run rather than only reporting the target platform.
- Require confirmation before publishing when generated content differs from the source article.
- Add tests verifying that no external link or promotional text is inserted unless explicitly configured.
- Consider recording a clear diff between the original and transformed content before publication.
