registry  /  @explorer02/cfm-survey-sdk  /  0.9.14

@explorer02/cfm-survey-sdk@0.9.14

Headless React SDK for custom survey UIs. Matches CFM respondent-view behavior (navigation, logic, validation, progress, submission); you own all presentation.

AI Security Review

scanned 3h ago · by lpm-firewall-ai

LPM blocks this version under the AI-agent control-surface policy. Install-time code mutates AI-agent control files in the consuming project without an explicit user command. It selects targets from ambient agent environment variables and defaults to writing all supported formats.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
npm installs the package as a dependency
Impact
Can alter Codex, Claude, and Cursor instruction/control surfaces for subsequent agent sessions.
Mechanism
postinstall writes package-supplied agent instruction stubs into the consumer project
Policy narrative
On dependency installation, `postinstall.js` identifies the active AI coding agent from environment variables or defaults to `all`. It then writes or merges package-controlled instructions into the consumer project's `AGENTS.md`, `CLAUDE.md`, and/or `.cursorrules`. This is an unconsented install-time mutation of broad foreign AI-agent control surfaces, independent of any explicit CLI invocation.
Rationale
The automatic postinstall agent-control-file writes are concrete and meet the install-time control-surface hijack boundary. Other network and shell capabilities are confined to explicitly invoked CLI workflows and do not mitigate the lifecycle behavior.
Evidence
package.jsonpostinstall.jspostinstall/detect-agent.jspostinstall/agent-stubs.jstemplates/AGENT.mdINIT_CWD/AGENTS.mdINIT_CWD/CLAUDE.mdINIT_CWD/.cursorrules

Decision evidence

public snapshot
AI called this Malicious at 98.0% confidence as Malware with low false-positive risk.
Evidence for policy block
  • `package.json` runs `node postinstall.js` on install.
  • `postinstall.js` targets consumer `INIT_CWD`/project root.
  • `detect-agent.js` detects Codex, Claude, Cursor, or defaults to all.
  • `postinstall.js` writes `AGENTS.md`, `CLAUDE.md`, and `.cursorrules`.
  • `agent-stubs.js` injects package-supplied agent instructions and merges existing `AGENTS.md`.
  • Mutation occurs automatically when installed under `node_modules`.
Evidence against
  • `postinstall.js` contains no network or child-process execution.
  • CLI shell, deployment, and upload functions require explicit `cfm-sdk` commands.
  • No credential harvesting or covert exfiltration was found in lifecycle files.
Behavioral surface
Source
ChildProcessEnvironmentVarsFilesystemNetwork
Supply chain
HighEntropyStringsMinifiedUrlStrings
Manifest
NoLicense
scanned 7 file(s), 469 KB of source, external domains: custom-p0.feedbook.me, distribution-dashboard-three.vercel.app, nodejs.org, raw.githubusercontent.com

Source & flagged code

8 flagged · loading source
package.jsonView file
scripts.postinstall = node postinstall.js
High
Install Time Lifecycle Scripts

Package defines install-time lifecycle scripts.

package.jsonView on unpkg
scripts.postinstall = node postinstall.js
Medium
Ambiguous Install Lifecycle Script

Install-time lifecycle script is not statically allowlisted and needs review.

package.jsonView on unpkg
dist/cli/index.jsView file
1#!/usr/bin/env node L2: "use strict";var ai=Object.create;var an=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var ui=Object.getPrototypeOf,pi=Object.proto... L3:
High
Child Process

Package source references child process execution.

dist/cli/index.jsView on unpkg · L1
170`),process.exit(1))):(console.log(` L171: \u274C ${u.red}winget package manager is not installed on this system.${u.reset}`),console.log(`${u.bold}\u{1F449} To proceed, please either:${u.reset}`),console.log(" 1. Install... L172: `),process.exit(1)):s?Re("brew")?(console.log(` ... L177: `),process.exit(1))):(console.log(` L178: \u274C ${u.red}Homebrew package manager (brew) is not installed on this system.${u.reset}`),console.log(`${u.bold}\u{1F449} To proceed, please either:${u.reset}`),console.log(" 1... L179: `),process.exit(1)):(console.log(` ... L184: \u26A0\uFE0F ${u.yellow}Global installation failed or permissions restricted.${u.reset}`),console.log(`\u2139 ${u.dim}Falling back: Running Vercel dynamically via npx.${u.reset}`)... L185: ${u.dim}Step 3/4: Checking Vercel Login...${u.reset}`);let t=!!process.env.VERCEL_TOKEN,n=!1;if(t)console.log(`\u2714 ${u.green}VERCEL_TOKEN environment variable detected. Skipping... L186: \u2714 ${u.green}Logged in successfully!${u.reset}`)}return t}M();Se();async function Kn(e,t){console.log(`
High
Same File Env Network Execution

A single source file combines environment access, network access, and code or shell execution; review context before blocking.

dist/cli/index.jsView on unpkg · L170
1#!/usr/bin/env node L2: "use strict";var ai=Object.create;var an=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var ui=Object.getPrototypeOf,pi=Object.proto... L3: ... L66: L67: Example reply: "yes, AWS" or "no"`,Xn="CFM_NEXT_STEP=ASK_DEPLOY"});function eo(e){return Zn.join(e,Li)}function to(){return process.env.CFM_SKIP_WORKFLOW_GATE==="1"}function be(e){... L68: `,"utf8")}function no(e){let t=be(e);bt(e,{version:1,coreVerifyPassedAt:new Date().toISOString(),layoutVerifyPassedAt:t?.layoutVerifyPassedAt??null,deployConfirmed:t?.deployConfirm... L69: `).length}function At(e,t,n){let o=new Set;if(t==="fastPath"){let s=e.fastPath;for(let r of s?.read??[])o.add(r)}else if(t==="phase"&&n!==void 0){let r=e.phases?.find(i=>String(i.i... ... L82: Source: ${e.source}`),console.log(n),console.log(""),!1}function $t(e,t,n=!1){let o=Ka(t,n);return o.length?Wa({title:"INSTALL SURVEY-TYPE DEPS (run once before Phase 6)",packages:... L83: `)){let o=n.trim();if(!o||o.startsWith("#"))continue;let s=o.indexOf("=");if(s<=0)continue;let r=o.slice(0,s).trim(),i=o.slice(s+1).trim();(i.startsWith('"')&&i.endsWith('"')||i.st... L84: `)}function Ir(e){r
High
Sandbox Evasion Gated Capability

Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.

dist/cli/index.jsView on unpkg · L1
177`),process.exit(1))):(console.log(` L178: \u274C ${u.red}Homebrew package manager (brew) is not installed on this system.${u.reset}`),console.log(`${u.bold}\u{1F449} To proceed, please either:${u.reset}`),console.log(" 1... L179: `),process.exit(1)):(console.log(` ... L182: ${u.dim}Step 2/4: Checking Vercel CLI...${u.reset}`);let e="vercel",t=!1;if(Re("vercel"))console.log(`\u2714 ${u.green}Vercel CLI is installed!${u.reset}`);else{console.log(`\u2753... L183: \u{1F4E5} ${u.cyan}Installing Vercel CLI globally... (npm install -g vercel)${u.reset}`),se("npm",["install","-g","vercel"])&&Re("vercel")?console.log(`\u2714 ${u.green}Vercel CLI ... L184: \u26A0\uFE0F ${u.yellow}Global installation failed or permissions restricted.${u.reset}`),console.log(`\u2139 ${u.dim}Falling back: Running Vercel dynamically via npx.${u.reset}`)...
High
Runtime Package Install

Package source invokes a package manager install command at runtime.

dist/cli/index.jsView on unpkg · L177
postinstall.jsView file
24Install-time AI-agent control hijack evidence: L34: L35: fs.writeFileSync(filePath, newContent, 'utf8'); L36: } ... L41: function writeClaudeMd(targetDir) { L42: const filePath = path.join(targetDir, 'CLAUDE.md'); L43: const stub = getClaudeMdStub(); ... L47: if (!canUpdateClaudeMd(existing)) { L48: console.log('Skipped CLAUDE.md (custom content outside @AGENTS.md bridge)'); L49: return; ... L51: if (existing.trim() === stub.trim()) { L52: console.log('CLAUDE.md already up to date'); L53: return; Payload evidence from postinstall/detect-agent.js: L24: */ L25: function detectAgent(env = process.env) { L26: const override = env.CFM_SDK_AGENT;
Critical
Ai Agent Control Hijack

Install-time source drops package-supplied AI-agent/MCP control files or instructions.

postinstall.jsView on unpkg · L24
templates/docs/survey-ui/verify-agent-build.shView file
path = templates/docs/survey-ui/verify-agent-build.sh kind = build_helper sizeBytes = 10916 magicHex = [redacted]
Medium
Ships Build Helper

Package ships non-JavaScript build or shell helper files.

templates/docs/survey-ui/verify-agent-build.shView on unpkg

Findings

1 Critical5 High5 Medium6 Low
CriticalAi Agent Control Hijackpostinstall.js
HighInstall Time Lifecycle Scriptspackage.json
HighChild Processdist/cli/index.js
HighSame File Env Network Executiondist/cli/index.js
HighSandbox Evasion Gated Capabilitydist/cli/index.js
HighRuntime Package Installdist/cli/index.js
MediumAmbiguous Install Lifecycle Scriptpackage.json
MediumNetwork
MediumEnvironment Vars
MediumShips Build Helpertemplates/docs/survey-ui/verify-agent-build.sh
MediumStructural Risk Force Deep Review
LowNon Install Lifecycle Scripts
LowScripts Present
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License