Back to skill

Security audit

减肥打卡记录

Security checks for vulnerabilities and agentic risk

Overview

This weight tracker has a coherent purpose, but it needs review because it can expose private weight data through an unauthenticated local web server and has unsafe handling of stored page values.

Install only if you are comfortable storing weight history in local plaintext JSON. Run the web server bound to localhost only, avoid LAN sharing unless you add access controls, and treat imported or shared config/history files as untrusted.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
assets/jianfei.html:215
Finding

Stored DOM Cross-Site Scripting Through Unvalidated Weight Configuration

Content
View full analysis
"$SCRIPT_DIR/config.json" << EOF { "title": "$TITLE", "language": "$LANG", "port": $SELECTED_PORT, "startWeight": $START_WEIGHT, "targetWeight": $TARGET_WEIGHT, "startDate": "$START_DATE", "endDate": "$END_DATE", "startDateLabel": "$START_LABEL", "endDateLabel": "$END_LABEL" } EOF cat > "$SCRIPT_DIR/weight_history.json" << EOF { "records": [ {"date": "$INIT_DATE", "weight": $INIT_WEIGHT} ] } EOF ``` The resulting configuration values are subsequently inserted into the document through `innerHTML`: ```javascript document.getElementById('startWeightDisplay').innerHTML = START_WEIGHT + t.kg + '
' + startLabel + ''; document.getElementById('targetWeightDisplay').innerHTML = TARGET_WEIGHT + t.kg + '
' + endLabel + ''; ``` ### Technical Analysis The setup script treats `START_WEIGHT`, `TARGET_WEIGHT`, and `INIT_WEIGHT` as trusted numeric values, but it does not enforce their type, range, or syntax. Direct interpolation into a heredoc allows an input to become a JSON string instead of a number while still producing syntactically valid JSON. After `config.json` is fetched and parsed, `startWeight` and `targetWeight` are assigned to `START_WEIGHT` ...[truncated 2238 chars]
Remediation
View remediation
0 && value <= 1000) }' } ``` 2. Validate the selected port as an integer from 1 through 65535 and validate dates against a strict `YYYY-MM-DD` format. 3. Generate JSON using a real serializer such as Python or `jq` rather than shell heredoc interpolation. For example, pass values as arguments to Python and use `json.dump()`. 4. Treat values loaded from JSON as untrusted. Explicitly convert and validate them in JavaScript: ```javascript const startWeight = Number(config.startWeight); if (!Number.isFinite(startWeight) || startWeight <= 0 || startWeight > 1000) { throw new Error('Invalid startWeight'); } ``` 5. Eliminate the `innerHTML` sinks. Build the elements with `textContent`: ```javascript const display = document.getElementById('startWeightDisplay'); display.replaceChildren(); const value = document.createTextNode(START_WEIGHT + t.kg); const br = document.createElement('br'); const small = document.createElement('small'); small.textContent = startLabel; display.append(value, br, small); ``` 6. Apply the same validation and safe serialization controls to `INIT_WEIGHT`, dates, the title, language, and port fields. 7. Add a restrictive Content Security Policy as defense in depth, for example by disallowing inline scripts and event handlers. This should supplement, not replace, output encoding and validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
assets/setup.sh:379
Finding

Unauthenticated Exposure of Personal Weight Data on Network Interfaces

Content
View full analysis
python3 -m http.server ``` ```powershell # Windows cd python -m http.server ``` ```bash # Linux cd python3 -m http.server ``` The setup wizard prints the same insecure command: ```bash echo " python3 -m http.server $SELECTED_PORT" ``` The README also recommends the unrestricted server and explicitly describes access from other LAN hosts: ```bash cd python3 -m http.server 8080 ``` ```text Multiple users can access it through http://:/jianfei.html. ``` ### Technical Analysis Python's built-in `http.server` listens on all available interfaces by default when no `--bind` address is provided. Consequently, the documented command does not create a localhost-only service even though the primary workflow presents the tracker as a local application. The served directory contains both the application and its personal data files: - `weight_history.json` - `config.json` The built-in server provides no authentication or authorization. A reachable network peer can request these files directly without loading the user interface. The configured port does not act as a security boundary because it is displayed to the user, may use common values such as 8000 or 8080, and can be discovered through routine network scanning. ### Attack Path 1. A user follows the setup output or documentation and runs `python3 -m http.server ` from the assets directory. 2. Python binds the service to externally r ...[truncated 1138 chars]
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill’s declared purpose is simple weight logging, but the documented behavior expands into local setup, port probing, file creation/modification, and running a local HTTP server. That mismatch is security-relevant because users and host agents may grant trust based on the description while the skill performs additional system-facing actions that increase attack surface and can surprise users.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match ordinary conversation about weight, which can cause the skill to activate unexpectedly and perform local file reads/writes or launch workflow steps without clear user intent. In an agent environment, accidental invocation is dangerous because it can lead to unintended persistence of sensitive health data or execution of local setup/server instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The workflow states that the AI will read and write local JSON data files, but the skill description does not clearly warn users that personal health data will be stored and modified on disk. This reduces informed consent and can expose sensitive weight history to accidental retention, syncing, backup leakage, or other local access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly recommends sharing jianfei.html, config.json, and weight_history.json over a LAN so multiple people can access the tracker, but it does not warn that this exposes personal health data and likely serves it without authentication or access controls. Because weight history and goal data are sensitive personal information, users may unintentionally disclose private data to others on the network or to anyone who can reach the host if the service is misconfigured or the network is not trusted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The config sets the skill language to "en" with no indication that users can opt into another language or that the English-only restriction is required for a region-specific purpose. This is a natural-language policy concern because it hard-codes a locale choice rather than offering flexibility or documenting the limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The page binds a global keydown handler so pressing 'W' immediately exports the user's weight history to a downloadable JSON file without any confirmation, focused-control check, or clear user notice. In a health-tracking skill, this can cause accidental disclosure of sensitive personal data if the user presses the key unintentionally or while screen-sharing / using a shared device.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script creates and overwrites config.json and weight_history.json containing the user's title, language, dates, port, and weight data. Although the script prompts for the values and later prints the filenames, there is no prior disclosure or warning that sensitive personal health information will be persisted to disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

When an unsupported or missing language is provided, the interface falls back to Chinese (i18nData.zh), and initialization also defaults config.language to zh. This imposes a specific language choice unless the user or configuration explicitly overrides it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The initialization logic sets var lang = config.language || 'zh';, which makes Chinese the default interface language whenever the configuration omits a language. This is a natural-language locale policy issue because users are not offered a language choice before a specific locale is imposed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The language-selection logic sets LANG to 'en' for any input other than '2', including empty or invalid input. This means the skill forces a specific language unless the user actively selects Chinese, rather than requiring an explicit language choice or clearly documenting the default as an opt-in behavior.

Content

No source excerpt is available for this finding.