Back to skill

Security audit

Daily Brief

Security checks for vulnerabilities and agentic risk

Overview

This daily brief skill is a small weather-and-news utility whose network use is purpose-aligned, but users should know it sends city/news requests to external services and renders remote text in the terminal.

Install only if you are comfortable with the skill contacting wttr.in for weather and Baidu for hot-search news. Avoid passing sensitive location details as the city argument, and prefer a future version that uses explicit HTTPS, prints remote content with printf-style inert output, and documents network providers clearly.

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

Warning
Location
daily-brief.sh:22
Finding
Untrusted Remote Content Rendered with Escape Interpretation over an Insecure Connection<![CDATA[ ## Vulnerability Details **File Location**: `daily-brief.sh`, lines 22–46 **Vulnerability Type**: Remote terminal-output injection and insecure transport **Risk Level**: Medium ### Complete Code Snippet ```bash # 获取天气 get_weather() { echo -e "${PURPLE}🌤️ 天气${NC}" local weather=$(curl -s "wttr.in/$CITY?format=3" 2>/dev/null) if [ $? -eq 0 ] && [ -n "$weather" ]; then echo -e " $weather" else echo -e " 获取失败,请检查网络" fi echo "" } # 获取百度热搜 get_news() { echo -e "${BLUE}🔥 百度热搜${NC}" local hot_data=$(curl -s "https://top.baidu.com/api/board?platform=wise&tab=realtime" 2>/dev/null) if [ $? -eq 0 ] && [ -n "$hot_data" ]; then # 解析JSON并显示前TOP_N条 local count=0 while IFS= read -r word; do if [ $count -lt $TOP_N ]; then count=$((count + 1)) echo -e " ${YELLOW}$count.${NC} $word" fi done < <(echo "$hot_data" | grep -o '"word":"[^"]*"' | sed 's/"word":"//;s/"$//') ``` ### Technical Analysis The weather request specifies `wttr.in` without an explicit URL scheme. Curl consequently initiates the request using HTTP unless transport behavior is changed externally or by a redirect. The initial plaintext request can be observed and modified by a network-positioned attacker. Both weather data and extracted news text are subsequently passed to `echo -e`. The `-e` option interprets backslash escape notation contained in the supplied text. An upstream service, compromised endpoint, or network-positioned attacker can therefore return text containing sequences such as `\e[...]`, which Bash converts into terminal control characters when displaying the response. The news endpoint uses HTTPS, reducing network interception risk, but its content remains externally controlled and is still passed through `echo -e`. The regular-expression-based JSON extraction does not remove backslashes or other dangerous terminal-oriented ...[truncated 1675 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require HTTPS and reject protocol downgrade or unexpected protocols: ```bash weather=$(curl --fail --silent --show-error \ --proto '=https' --proto-redir '=https' \ "https://wttr.in/${CITY}?format=3") ``` 2. Do not use `echo -e` for externally sourced content. Print it as inert data: ```bash printf ' %s\n' "$weather" printf ' %s\n' "$word" ``` 3. Remove unsafe control characters before rendering remote text. If line breaks are unnecessary, restrict output to printable characters and explicitly approved Unicode characters. 4. Parse the Baidu response with a real JSON parser, such as `jq`, rather than `grep` and `sed`. Parsing alone does not make terminal output safe, so sanitized output must still be printed with `printf '%s'`. 5. Capture and test Curl's status directly instead of inspecting `$?` after a command substitution declaration. For example: ```bash if weather=$(curl --fail --silent --show-error \ --proto '=https' --proto-redir '=https' \ "https://wttr.in/${CITY}?format=3"); then printf ' %s\n' "$weather" else printf ' Weather retrieval failed; check the network connection.\n' fi ``` 6. Apply connection timeouts and response-size limits to reduce availability risks from stalled or excessively large responses. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Vague Triggers

Medium
Confidence
90% confidence
Finding
The manifest description and heading describe the skill in broad, generic terms like '一键获取每日资讯' and '省时又实用', but do not specify precise invocation conditions, trigger phrases, or exclusions. For markdown files, this can make activation scope ambiguous and increase the chance of unintended invocation from everyday requests about news or weather.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill explicitly uses curl to contact a third-party service (wttr.in) and references external news sources, but it does not warn users that their queries, such as city names, will be sent off-platform. This creates a transparency and privacy risk because users may unknowingly trigger outbound requests to external services.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
User-facing strings throughout the script are in Chinese, including headings, status messages, and tips, and there is no indication that the user can select another language. This can violate language or locale policy when a skill imposes a specific language without opt-in or clear justification.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script sends the user-provided city value to wttr.in over the network without any notice, consent, or documentation that user input will be disclosed to a third party. While the city is not highly sensitive by itself, it can reveal approximate location or user interests, and the silent transmission increases privacy risk in contexts where users expect a local-only utility.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
The skill description, examples, and sample output are presented entirely in Chinese, suggesting the skill may default to or enforce Chinese-language responses. Under the language/locale policy, this is a concern when no user opt-in or language selection mechanism is documented.

Static analysis

No suspicious patterns detected.