Back to skill

Security audit

qqbot-daily-news-briefing

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible daily news bot, but its delivery scripts can automatically send the generated report to a hardcoded QQ account instead of the recipient the user configures.

Do not install this version without reviewing and changing the delivery scripts. Remove the hardcoded QQ recipient, make delivery fail unless an explicit user-controlled recipient is configured, validate attachment paths, and avoid enabling cron until a manual dry run confirms the exact destination and content.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/deliver-briefing.sh:12
Finding

Hardcoded QQ Recipient Causes Unauthorized or Misdirected File Delivery

Content
View full analysis
${NEWS_FILE} ⏰ 明日同一时间自动推送 • Jarvis Daily Briefing" ``` ```bash if timeout $TIMEOUT openclaw message send \ --channel qqbot \ -t "qqbot:c2c:${TARGET_USER}" \ -m "$ESCAPED_MESSAGE" 2>>"$LOG_FILE"; then ``` The alternative Python delivery path independently embeds the same recipient and accepts a caller-supplied file path: ```python def create_delivery_message(news_file): """Create the delivery message with file attachment.""" month_day = datetime.date.today().strftime('%m月%d日') tech_hl, finance_hl = extract_headlines(news_file) message = f"""📰 早安,Sir! 今日简报已送达 - {month_day} 🖥️ 科技要闻:{tech_hl}... 📈 财经动态:{finance_hl}... 完整报告:{news_file} ⏰ 明日同一时间自动推送 • Jarvis Daily Briefing""" return message ``` ```python def send_via_openclaw_cli(message, target): """Send message using OpenClaw CLI.""" try: cmd = [ 'openclaw', 'message', 'send', '--channel', 'qqbot', '-t', f'c2c:{target}', '-m', message ] result = subprocess.run( cmd, ...[truncated 4075 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (30)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

sudo nano /etc/profile.d/daily-news-briefing.sh

Add your configuration

export BAIDU_API_KEY="bce-v3/ALTAK-your-api-key-here" export NEWS_TARGET_USER="9C12E02D9038B14FCEDCE1B69AAEAB3F" # QQ user ID export NEWS_CHANNEL="qqbot" # qqbot, telegram, discord

Reload configuration

source /etc/profile.d/daily-news-briefing.sh

text

**Option B: User-specific**

```bash
# Add to ~/.bashrc or ~/.zshrc
echo 'export BAIDU_API_KEY="your-api-key"' >> ~/.bashrc
echo 'export NEWS_TARGET_USER="target-user-id"' >> ~/.bashrc
source ~/.bashrc

Without API Key (Uses DuckDuckGo):

The skill will automatically use DuckDuckGo web search if no Baidu API key is configured:

bash
# Just set target user and channel - that's it!
export NEWS_TARGET_USER="your-qq-user-id"
export NEWS_CHANNEL="qqbot"

Compare Search Methods:

FeatureBaidu APIDuckDuckGo
API Key Required✅ Yes (75 chars)❌ No
Result Quality🏆 Better struct

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
93% confidence
Finding

Using os.environ.copy() forwards the entire parent environment to a child script, potentially exposing unrelated secrets, tokens, and operational metadata to another code component. In a skill/workspace model where the called script may be modified, compromised, or less trusted, this broad secret propagation meaningfully increases the blast radius of any downstream issue.

Content

Scanner excerpt · scripts/generate-briefing.py (reported line 46)May include surrounding context.

python
"freshness": freshness
        }, ensure_ascii=False)
        
        env = os.environ.copy()
        env['BAIDU_API_KEY'] = api_key
        log(f"🔍 Baidu search: '{query[:50]}...' (API key length: {len(api_key)})")

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/news-deliver-direct.py (reported line 75)May include surrounding context.

python
capture_output=True,
            text=True,
            timeout=60,
            env={**os.environ}
        )
        
        if result.returncode == 0:

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/news-deliver-direct.py (reported line 112)May include surrounding context.

python
capture_output=True,
            text=True,
            timeout=60,
            env={**os.environ}
        )
        
        if result.returncode == 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file documents a workflow that delivers news briefings to QQ Bot, Telegram, or Discord and emphasizes automation, but it does not clearly warn users that content and routing data will be sent to third-party messaging platforms. Because the skill affects user data flow and external communication, the description should include an explicit disclosure of that behavior and its privacy implications.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

4. Automate (Optional)

bash
crontab -e

# Add these lines for daily 9:00 AM delivery
0 9 * * * source /etc/profile && cd ~/.openclaw/skills/daily-news-briefing/scripts && python3 generate-briefing.py >> /var/log/daily-news.log 2>&1

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

4. Automate (Optional)

bash
crontab -e

# Add these lines for daily 9:00 AM delivery
0 9 * * * source /etc/profile && cd ~/.openclaw/skills/daily-news-briefing/scripts && python3 generate-briefing.py >> /var/log/daily-news.log 2>&1

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/CONFIGURATION.md (reported line 63)May include surrounding context.

4. Automate (Optional)

bash
crontab -e

# Add these lines for daily 9:00 AM delivery
0 9 * * * source /etc/profile && cd ~/.openclaw/skills/daily-news-briefing/scripts && python3 generate-briefing.py >> /var/log/daily-news.log 2>&1

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README presents the generated briefing and delivery message entirely in Chinese, indicating a locale-specific output expectation, but it does not mention that the skill is China/Chinese-language specific or offer any language selection. This can violate language/locale policy because the skill appears to impose a specific language without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill clearly automates delivery of generated briefings to external messaging platforms such as QQ, Telegram, Discord, and Slack, and requires target identifiers to do so. Omitting an explicit warning in the top-level description reduces informed consent and can lead operators to deploy a workflow that transmits potentially sensitive generated content and recipient metadata off-host without realizing it.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
**With Baidu API (Recommended for Better Results):**

Create a configuration file with your Baidu Search API key:

**Option A: System-wide (Recommended for servers)**

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 47)May include surrounding context.

bash
# Create config file
sudo nano /etc/profile.d/daily-news-briefing.sh

# Add your configuration
export BAIDU_API_KEY="bce-v3/ALTAK-your-api-key-here"

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 61)May include surrounding context.

Option B: User-specific

bash
# Add to ~/.bashrc or ~/.zshrc
echo 'export BAIDU_API_KEY="your-api-key"' >> ~/.bashrc
echo 'export NEWS_TARGET_USER="target-user-id"' >> ~/.bashrc
source ~/.bashrc

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The configuration guide shows a concrete API key format and a real-looking target identifier, then recommends persisting them in shell startup files and system-wide environment files without any warning about secrecy, file permissions, or secret management. This increases the chance that credentials and recipient identifiers will be exposed through dotfiles, backups, process environments, or multi-user system access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The cron examples automate generation and delivery of content to external messaging channels while redirecting output to log files, but they do not warn that message content, file paths, recipient identifiers, or operational errors may be recorded or transmitted outside the host. In a news-briefing skill this is not inherently malicious, but undocumented external delivery and logging can still leak sensitive content or metadata if the system is repurposed for non-public briefings.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 168)May include surrounding context.

md
# Add the entries above, adjusting paths as needed

# Verify installation
crontab -l

# Check cron service
systemctl status cron

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 365)May include surrounding context.

md
# Add the entries above, adjusting paths as needed

# Verify installation
crontab -l

# Check cron service
systemctl status cron

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/CONFIGURATION.md (reported line 68)May include surrounding context.

md
# Add the entries above, adjusting paths as needed

# Verify installation
crontab -l

# Check cron service
systemctl status cron

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script automatically sends a generated briefing and references a local file attachment to a fixed external QQBot recipient without any interactive confirmation, recipient validation, or data-classification check. In this skill context, the briefing file lives under /root and may contain sensitive internal content; automatic exfiltration to an external messaging channel increases the risk of unintended disclosure if the file contents, target ID, or execution context are wrong.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code launches another script via subprocess.run and passes a copied environment containing BAIDU_API_KEY. This is a safety-relevant external execution path, but the script provides no explicit warning that it will invoke another program and pass environment-based credentials to it.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate-briefing.py (reported line 50)May include surrounding context.

python
env['BAIDU_API_KEY'] = api_key
        log(f"🔍 Baidu search: '{query[:50]}...' (API key length: {len(api_key)})")
        
        result = subprocess.run(
            ['python3', f'{WORKSPACE}/skills/baidu-search/scripts/search.py', search_payload],
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The fallback search function sends the query to DuckDuckGo via an HTTP request, which transmits user/system-derived search terms to an external service. While the function has a technical docstring, there is no explicit user warning at the point of use that queries may leave the local environment and be sent to a third party.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The DuckDuckGo request forces US English results through both the kl=us-en query parameter and the Accept-Language header. This imposes a specific language/locale policy without offering user opt-in or documenting why that locale is required.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script opens and overwrites a dated markdown file in the workspace, creating persistent output on disk. Although the code logs completion afterward, there is no prior user disclosure, confirmation prompt, or inline warning comment/docstring explaining that execution will write a file to the user's filesystem.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The delivery message is written entirely in Chinese and is sent automatically to the recipient, with no option to select a preferred language or locale. This creates a natural-language policy issue because the skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.