Back to skill

Security audit

LMFiles

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward lmfiles.com file-hosting helper, with expected public uploads and credential use that users should handle carefully.

Install only if you intend to use lmfiles.com as a public file host. Confirm every file before upload, do not upload secrets or private data, keep LMFILES_API_KEY and LMFILES_BOOTSTRAP_TOKEN out of command lines and logs, and double-check file IDs before deletion because the helper script does not ask for confirmation.

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:4
Finding

Bootstrap Credential Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/register.sh, lines 4–15
Vulnerability Type: Credential exposure through process arguments
Risk Level: Medium

Vulnerable Code

bash
if [[ $# -lt 1 ]]; then
  echo "Usage: $0 <username> [bootstrap_token]" >&2
  exit 1
fi

USERNAME="$1"
BOOTSTRAP_TOKEN="${2:-${LMFILES_BOOTSTRAP_TOKEN:-}}"

if [[ -z "$BOOTSTRAP_TOKEN" ]]; then
  echo "Error: provide bootstrap token as arg2 or set LMFILES_BOOTSTRAP_TOKEN" >&2
  exit 1
fi

Technical Analysis

The registration helper explicitly supports passing LMFILES_BOOTSTRAP_TOKEN as its second command-line argument. Secrets supplied through process arguments may be exposed through shell history, process-monitoring utilities, operating-system audit records, terminal session logging, or automation logs.

Although the token is subsequently sent only to the declared lmfiles.com registration endpoint, accepting it through argv unnecessarily broadens its local exposure. The environment-variable fallback does not mitigate the issue when users follow the documented argument-based interface.

Exploitation requires local process-observation capability, access to relevant logs or shell history, or monitoring software that records command lines.

Attack Path

  1. A user runs bash scripts/register.sh my-bot <bootstrap-token>.
  2. The shell, operating system, audit tooling, or process-monitoring software records or exposes the complete command line.
  3. A local attacker or unauthorized log reader obtains the bootstrap token.
  4. The attacker submits the captured token to the lmfiles.com account-registration endpoint.
  5. If the token remains valid and reusable, the attacker may register unauthorized accounts under the authority granted by that bootstrap credential.

Impact Assessment

Successful exploitation exposes the bootstrap registration credential, not the primary LMFILES_API_KEY. The attacker may gain whatever account-creat ...[truncated 385 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove support for supplying the bootstrap token as a positional argument.
  2. Accept the credential only through LMFILES_BOOTSTRAP_TOKEN, or request it interactively without terminal echo using read -r -s.
  3. Change the usage and error messages so they no longer encourage command-line secret entry.
  4. Avoid printing the token or enabling shell tracing while processing it.
  5. Document that credentials must not be placed in shell history, command lines, CI job parameters, or verbose logs.
  6. Rotate any bootstrap token that may previously have been exposed through command-line invocation.
  7. Where supported by the service, configure bootstrap tokens as short-lived, single-use credentials with narrowly scoped registration permissions.

A safer implementation would resemble:

bash
if [[ $# -lt 1 ]]; then
  echo "Usage: $0 <username>" >&2
  exit 1
fi

USERNAME="$1"
BOOTSTRAP_TOKEN="${LMFILES_BOOTSTRAP_TOKEN:-}"

if [[ -z "$BOOTSTRAP_TOKEN" ]]; then
  read -r -s -p "Bootstrap token: " BOOTSTRAP_TOKEN
  echo >&2
fi

if [[ -z "$BOOTSTRAP_TOKEN" ]]; then
  echo "Error: bootstrap token is required" >&2
  exit 1
fi
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 (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill includes shell-based execution examples and helper scripts but does not declare any tool scope restrictions such as allowed-tools or permissions. In an agent setting, this increases the chance that a model may invoke shell access more broadly than intended, especially when handling file paths, credentials, and network operations to a third-party service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill instructs the agent to send data, including a bootstrap credential, to an external service over the network. Although this is central to the skill's purpose, it still creates a real exfiltration and trust-boundary risk because users may upload sensitive files or transmit secrets to a public third-party host, and the public-link model makes accidental disclosure more likely.

Content

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

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"'"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script performs an irreversible DELETE request against the lmfiles API using only a positional file ID, with no confirmation prompt, dry-run mode, or secondary safeguard. In an agent or CLI context, a mistaken ID, automation bug, or prompt-influenced invocation could cause unintended permanent deletion of user files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script reads a bootstrap token from LMFILES_BOOTSTRAP_TOKEN, which is credential-like sensitive data, and then uses it for registration. There is no user-facing disclosure, prompt, or explanatory comment warning that sensitive environment variable contents will be consumed and transmitted.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/register.sh (reported line 17)May include surrounding context.

sh
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}\"}"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script performs an HTTP POST that transmits user-provided account data and a bootstrap token to a remote service, but there is no confirmation prompt, warning message, or explanatory comment describing that network transmission. For code files, outbound transmission of user or system data should have some visible disclosure unless the warning is provided elsewhere in accompanying markdown, which is not present in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script sends an arbitrary local file to a third-party remote service and returns a public upload result, but it provides no interactive warning, confirmation, or disclosure at execution time that the file is leaving the local environment. In a skill context where an agent may invoke this on behalf of a user, that omission increases the risk of accidental exfiltration of sensitive files, especially because the service is explicitly for public file sharing.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.