Back to skill

Security audit

LMfiles.com file hosting

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward lmfiles.com file-hosting helper, but users should treat uploads as public and handle its API tokens carefully.

Install only if you intend to use lmfiles.com as an external file host. Confirm before uploading because returned links are public, avoid uploading secrets, prefer LMFILES_BOOTSTRAP_TOKEN over passing bootstrap tokens on the command line, and verify the target file_id before deleting because the helper script has no dry run or confirmation prompt.

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
scripts/register.sh:5
Finding
Bootstrap Token Exposed Through Command-Line Arguments## Vulnerability Details **File Location**: `scripts/register.sh`, lines 5 and 10 **Vulnerability Type**: Credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```bash echo "Usage: $0 <username> [bootstrap_token]" >&2 BOOTSTRAP_TOKEN="${2:-${LMFILES_BOOTSTRAP_TOKEN:-}}" ``` ### Technical Analysis The registration script explicitly supports passing the bootstrap token as its second positional argument. Secrets supplied through command-line arguments can be exposed through shell history, process inspection utilities, operating-system audit records, terminal logging, and process-monitoring systems. The environment-variable fallback does not eliminate the issue because the usage interface explicitly advertises and the implementation accepts the insecure positional-argument mechanism. No remote exploitation is established; exploitation requires access to command histories, process metadata, or associated logs on the system where the script runs. ### Attack Path 1. A user runs the documented interface: ```bash bash scripts/register.sh my-bot secret-bootstrap-token ``` 2. The shell may save the complete command in its history. While the command runs, the token may also appear in process metadata. 3. A local user, administrator, audit collector, monitoring service, or party with access to retained logs obtains the token. 4. The exposed token is submitted to the lmfiles.com account-registration endpoint. 5. If the token remains valid and permits additional registrations, the party can register an unauthorized account. ### Impact Assessment Successful exploitation discloses the bootstrap credential. Its practical scope is limited to the permissions and lifetime assigned to that token, principally unauthorized account registration. This issue does not directly expose `LMFILES_API_KEY`, grant local code execution, or provide operating-system privilege escalation. Rotation or invalidation of the bootstrap t ...[truncated 28 chars]
Remediation
## Remediation Suggestions 1. Remove support for receiving the bootstrap token as a positional command-line argument. 2. Require the token through `LMFILES_BOOTSTRAP_TOKEN`, or read it interactively without terminal echo using `read -rs`. 3. Update the usage message so it does not advertise command-line secret submission. 4. Do not include real tokens in examples, shell history, logs, or diagnostic output. 5. Document immediate token rotation if exposure is suspected. 6. Where feasible, configure bootstrap tokens as single-use, narrowly scoped, and short-lived credentials. Example hardened approach: ```bash if [[ -z "${LMFILES_BOOTSTRAP_TOKEN:-}" ]]; then read -rsp "Bootstrap token: " BOOTSTRAP_TOKEN printf '\n' >&2 else BOOTSTRAP_TOKEN="$LMFILES_BOOTSTRAP_TOKEN" fi ``` Additionally, construct the registration request with a JSON-aware encoder, such as `jq -n --arg`, rather than direct string interpolation, so usernames or tokens containing quotes and control characters cannot produce malformed JSON.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill includes shell-based operational instructions but does not declare any tool scope or allowed-tools restrictions. In an agent environment, this increases the chance the skill will be invoked with broader shell access than intended, enabling file upload, deletion, and credential-bearing network calls without explicit policy boundaries.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
export LMFILES_BOOTSTRAP_TOKEN="<bootstrap-token>"

curl -sS -X POST https://lmfiles.com/api/v1/accounts/register \
  -H "Content-Type: application/json" \
  -d '{"username":"my-bot","bootstrap_token":"'"$LMFILES_BOOTSTRAP_TOKEN"'"}'
Confidence
82% confidence
Finding
The skill instructs the agent to transmit a bootstrap credential to an external service using curl. Although this is part of legitimate account registration, it is still a sensitive external transmission path: if triggered in the wrong context, the agent could exfiltrate secrets to a third-party host or expose credentials through shell history, process inspection, or logs.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script performs an irreversible DELETE request against the lmfiles API using only a positional file ID and an API key, with no confirmation prompt, dry-run mode, or guardrail. In an agent skill context, this increases the chance of accidental or unauthorized destructive actions if the tool is invoked on the wrong file ID or triggered by ambiguous user input.

External Transmission

Medium
Category
Data Exfiltration
Content
exit 1
fi

curl -sS -X POST https://lmfiles.com/api/v1/accounts/register \
  -H "Content-Type: application/json" \
  -d "{\"username\":\"${USERNAME}\",\"bootstrap_token\":\"${BOOTSTRAP_TOKEN}\"}"
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The script makes a POST request to an external service and includes a bootstrap token in the request body, but there is no confirmation prompt, visible disclosure, or explanatory comment warning the user that credentials will be sent over the network. Because this is a code file, network transmission of potentially sensitive data should have some explicit user-facing warning unless it is clearly disclosed in the file.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script uploads an arbitrary local file to a third-party remote service and does so with no inline warning, confirmation, or disclosure beyond the generic skill description. In an agent-skill context, this increases the chance that sensitive local files could be exfiltrated if the tool is invoked with an unsafe path or used by another component without clearly surfacing the external data transfer.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The script performs a network call to an external API and transmits an authentication credential in the request header, but the file contains no comment, logging, or other user-facing disclosure describing this behavior. For code files, network calls that transmit user or system data should have some visible warning unless clearly documented elsewhere, which is not evident in this file.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script reads LMFILES_API_KEY from the environment to authenticate the upload, but offers no comment or user-facing notice that a credential is required and will be used for a remote request. Access to sensitive environment variables in code files should include some visible disclosure unless already documented in accompanying markdown.

Static analysis

No suspicious patterns detected.