Back to skill

Security audit

Lemma

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Lemma platform-building purpose, but it handles tokens and project setup in ways that deserve careful review before installation.

Install only if you trust the Lemma workspace and package sources, use short-lived least-privilege test tokens, avoid running the bundle script on untrusted projects, review generated .env.local before sharing or committing anything, clean up browser localStorage after testing, and be aware that the scaffold currently depends on mutable npm packages.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T08 · Insecure Dependencies

Error
Location
modules/lemma-desks/scripts/init-artifact.sh:647
Finding

Unpinned npm Dependencies Permit Mutable Remote Code Execution

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
modules/lemma-desks/scripts/bundle-artifact.sh:17
Finding

Dotenv Files Are Executed as Arbitrary Shell Code

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
modules/lemma-desks/scripts/print-browser-auth-setup.sh:11
Finding

Authentication Token Is Disclosed Through Process Arguments and Terminal Output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
modules/lemma-desks/scripts/init-artifact.sh:112
Finding

Broadly Exposed Development Server Is Used with a Browser-Readable Bearer Token

Content
View full analysis
"); ``` ### Technical Analysis The generated development and preview servers bind to all network interfaces and accept every host value through `allowedHosts: true`. This is broader than necessary for local development and disables Vite's host validation protection. At the same time, the testing workflow stores a bearer token in `localStorage`. Any JavaScript executing in that origin can read the token. This includes code introduced through an application cross-site scripting flaw, compromised dependency, malicious development plugin, or other same-origin script injection. The combination increases exposure in remote workspace environments: the server may be reachable through a public preview route while an authenticated browser stores a reusable token in script-readable storage. Binding to `0.0.0.0` is operationally useful for workspace previews, but it should be paired with explicit host restrictions and preview access controls rather than unrestricted host acceptance. ### Attack Path 1. A developer starts the generated Vite server, which listens on every interface and accepts arbitrary host headers. 2. The service is made reachable through a workspace preview URL or anoth ...[truncated 1193 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as a broad Lemma platform entrypoint for designing and routing across many component types (pods, datastores, integrations, workflows, desks, assistants, etc.). The supplied code does not implement routing, guidance, provisioning, testing orchestration, or multi-module entrypoint behavior. Instead, it is a narrowly scoped build script for desk projects that installs dependencies if needed, loads env files, validates required URLs and pod ID, runs npm run build, and creates a single-file bundle.html by inlining CSS and JS from the build output. That is a materially different primary purpose, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a broad orchestration or gateway capability for many Lemma platform areas, implying a general entrypoint that routes users to the correct module guide. The supplied code does something much narrower: it initializes a desk artifact by generating a Vite React TypeScript project, copying helper scripts, writing source/config files, and installing dependencies. This is consistent with a desk scaffolding utility, but not with a universal Lemma platform entrypoint. The filesystem writes and npm installs are expected implementation details for scaffolding, not the main reason for mismatch; the mismatch is that the actual primary purpose is materially narrower and different from the declared general-purpose routing role.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The declared description presents this skill as a broad, single entrypoint for many Lemma platform activities and modules. The supplied code instead performs a very specific function: it echoes a local preview URL, optionally derives a public preview URL from an existing workspace URL, and points to a browser-auth helper script. That is a materially narrower and different primary purpose than the declared description. There is no evidence in this code chunk of general routing, provisioning, testing orchestration, or cross-module entrypoint behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a high-level, platform-wide entrypoint and router for many Lemma modules. The supplied code does not implement routing, provisioning, design, or general platform guidance. Instead, it performs a specific operational task: validating the presence of LEMMA_TOKEN and printing instructions to authenticate a local desk app by setting localStorage in the browser. That is a materially narrower and different purpose, and it involves handling an auth token capability not reflected in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as a comprehensive single entrypoint for many Lemma platform operations and module routing. The supplied code does not implement any such broad orchestration or routing behavior; it only emits a deprecation message and execs another authentication-related script. That is a materially different primary purpose from the declared description, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/bundle-artifact.sh (reported line 39)May include surrounding context.

sh
fi

# Load project env first so bundling uses the same values as local dev.
load_env_file "$PROJECT_DIR/.env"
load_env_file "$PROJECT_DIR/.env.local"

# Resolve VITE_* build vars from project env or workspace env.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/bundle-artifact.sh (reported line 40)May include surrounding context.

sh
# Load project env first so bundling uses the same values as local dev.
load_env_file "$PROJECT_DIR/.env"
load_env_file "$PROJECT_DIR/.env.local"

# Resolve VITE_* build vars from project env or workspace env.
RESOLVED_API_URL="${VITE_LEMMA_API_URL:-${LEMMA_BASE_URL:-}}"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/init-artifact.sh (reported line 659)May include surrounding context.

sh
# Load project env first so bundling uses the same values as local dev.
load_env_file "$PROJECT_DIR/.env"
load_env_file "$PROJECT_DIR/.env.local"

# Resolve VITE_* build vars from project env or workspace env.
RESOLVED_API_URL="${VITE_LEMMA_API_URL:-${LEMMA_BASE_URL:-}}"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/bundle-artifact.sh (reported line 48)May include surrounding context.

sh
RESOLVED_POD_ID="${VITE_LEMMA_POD_ID:-${POD_ARG:-${LEMMA_POD_ID:-}}}"

if [ -z "$RESOLVED_API_URL" ]; then
  echo "❌ API URL not set. Set it in .env.local as VITE_LEMMA_API_URL or provide LEMMA_BASE_URL."
  exit 1
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/bundle-artifact.sh (reported line 53)May include surrounding context.

sh
RESOLVED_POD_ID="${VITE_LEMMA_POD_ID:-${POD_ARG:-${LEMMA_POD_ID:-}}}"

if [ -z "$RESOLVED_API_URL" ]; then
  echo "❌ API URL not set. Set it in .env.local as VITE_LEMMA_API_URL or provide LEMMA_BASE_URL."
  exit 1
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/init-artifact.sh (reported line 590)May include surrounding context.

sh
RESOLVED_POD_ID="${VITE_LEMMA_POD_ID:-${POD_ARG:-${LEMMA_POD_ID:-}}}"

if [ -z "$RESOLVED_API_URL" ]; then
  echo "❌ API URL not set. Set it in .env.local as VITE_LEMMA_API_URL or provide LEMMA_BASE_URL."
  exit 1
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/init-artifact.sh (reported line 602)May include surrounding context.

sh
RESOLVED_POD_ID="${VITE_LEMMA_POD_ID:-${POD_ARG:-${LEMMA_POD_ID:-}}}"

if [ -z "$RESOLVED_API_URL" ]; then
  echo "❌ API URL not set. Set it in .env.local as VITE_LEMMA_API_URL or provide LEMMA_BASE_URL."
  exit 1
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · modules/lemma-desks/scripts/init-artifact.sh (reported line 656)May include surrounding context.

sh
RESOLVED_POD_ID="${VITE_LEMMA_POD_ID:-${POD_ARG:-${LEMMA_POD_ID:-}}}"

if [ -z "$RESOLVED_API_URL" ]; then
  echo "❌ API URL not set. Set it in .env.local as VITE_LEMMA_API_URL or provide LEMMA_BASE_URL."
  exit 1
fi

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The invocation description is extremely broad and can cause this parent skill to activate for many generic Lemma-related tasks, including tasks that should be handled by narrower, better-scoped modules. Over-broad matching increases the chance of unintended tool use, misrouting, or application of the wrong operational guidance across sensitive platform areas.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script persists values taken from the current environment into a newly created .env.local file without an explicit warning or confirmation. While the specific variables shown are configuration values rather than obvious secrets, environment-derived values can still be sensitive in some deployments, and writing them to disk increases exposure through local compromise, backups, or accidental sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The guide explicitly tells the agent to use injected workspace credentials such as LEMMA_TOKEN and related environment variables directly, but provides no warning to treat them as secrets, avoid echoing them, or prevent accidental disclosure in logs, widgets, previews, or command output. In a workspace-execution skill, this is more dangerous because the skill routinely drives terminals, browsers, and live services, increasing the chance that secrets are exposed to users, third-party services, or persisted session history.

Content

No source excerpt is available for this finding.