T08 · Insecure Dependencies
- 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
Security audit
Security checks for vulnerabilities and agentic risk
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.
modules/lemma-desks/scripts/init-artifact.sh:647Unpinned npm Dependencies Permit Mutable Remote Code Execution
modules/lemma-desks/scripts/bundle-artifact.sh:17Dotenv Files Are Executed as Arbitrary Shell Code
modules/lemma-desks/scripts/print-browser-auth-setup.sh:11Authentication Token Is Disclosed Through Process Arguments and Terminal Output
modules/lemma-desks/scripts/init-artifact.sh:112Broadly Exposed Development Server Is Used with a Browser-Readable Bearer Token
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.
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.
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.
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.
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.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 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:-}}"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 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:-}}"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Without declared permissions the skill's intent is opaque and cannot be validated.
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.
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.
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.