registry  /  @decocms/blocks-cli  /  7.5.1

@decocms/blocks-cli@7.5.1

Deco codegen (generate-blocks, generate-schema, generate-invoke) and Fresh-to-TanStack migration tooling

AI Security Review

scanned 2h ago · by lpm-firewall-ai

LPM treats this as warn-only first-party agent extension lifecycle risk. No confirmed malicious install-time or import-time behavior was found. The remaining risk is explicit user-command mutation of a Cursor agent rule plus project migration/bootstrap actions.

Static reason
One or more suspicious static signals were detected.; previous stored version diff introduced dangerous source
Trigger
User runs deco-migrate or related CLI commands with write/execute modes.
Impact
Can modify target project files and agent guidance during migration; no evidence of credential exfiltration, stealth persistence, or remote payload execution.
Mechanism
migration scaffolding, codegen, Cloudflare KV sync, and Cursor rule setup
Rationale
Static source inspection does not support a malicious verdict: there are no lifecycle hooks, no hidden exfiltration, and the network/shell behavior is aligned with migration and deployment tooling. Because the package sets up an always-applied agent rule in the target repo, it fits a warning-level agent extension lifecycle risk rather than clean.
Evidence
package.jsonscripts/migrate/phase-scaffold.tsscripts/migrate/templates/cursor-rules.tsscripts/migrate.tsscripts/sync-blocks-to-kv.tsscripts/lib/cf-kv-rest.tsscripts/generate-blocks.ts.cursor/rules/migration-tooling-policy.mdc.github/workflows/lockfile-check.yml.deco/blocks.gen.json.deco/blocks.gen.tswrangler.jsonc
Network endpoints3
api.cloudflare.com/client/v4github.com/decocms/deco-start/blob/main/.cursor/rules/migration-tooling-policy.mdcgithub.com/decocms/deco-start/blob/main/MIGRATION_TOOLING_PLAN.md

Decision evidence

public snapshot
AI called this Suspicious at 86.0% confidence as Unknown with medium false-positive risk.
Evidence for warning
  • scripts/migrate/phase-scaffold.ts writes .cursor/rules/migration-tooling-policy.mdc during explicit migration.
  • scripts/migrate/templates/cursor-rules.ts generates an alwaysApply Cursor rule pointing agents to upstream policy links.
  • scripts/migrate.ts bootstrap runs bun install and codegen commands in the target project after user-invoked migration.
  • scripts/sync-blocks-to-kv.ts reads CF_* env vars and writes project decofile snapshots to Cloudflare KV when --write is passed.
Evidence against
  • package.json has no preinstall/install/postinstall lifecycle hooks.
  • Main/bin entries are CLI/codegen/migration tools, activated by user commands rather than install/import side effects.
  • Cloudflare API and purge fetches are package-aligned operational endpoints, using user-provided CF/PURGE credentials.
  • generate-blocks.ts only reads .deco/blocks JSON and writes .deco/blocks.gen.{json,ts}.
  • Test-only child_process/dynamic require findings are not runtime package behavior.
Behavioral surface
Source
ChildProcessDynamicRequireEnvironmentVarsFilesystemNetworkShell
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 96 file(s), 970 KB of source, external domains: analytics.tiktok.com, api.cloudflare.com, bat.bing.com, cdn.example.com, connect.facebook.net, deco-otel-ingest.deco-cx.workers.dev, deco-otel-ingest.example, decoims.com, github.com, graph.instagram.com, ingest.example, ingest.example.com, s.lilstts.com, script.hotjar.com, scripts.clarity.ms, sp.vtex.com, static.hotjar.com, storage.googleapis.com, tailwindcss.com, www.clarity.ms, www.googletagmanager.com

Source & flagged code

5 flagged · loading source
scripts/audit-observability-config.test.tsView file
309} { L310: const { spawnSync } = require("node:child_process") as typeof import( L311: "node:child_process"
High
Child Process

Package source references child process execution.

scripts/audit-observability-config.test.tsView on unpkg · L309
309} { L310: const { spawnSync } = require("node:child_process") as typeof import( L311: "node:child_process"
Medium
Dynamic Require

Package source references dynamic require/import behavior.

scripts/audit-observability-config.test.tsView on unpkg · L309
scripts/sync-blocks-to-kv.tsView file
55purgeUrl: val("--purge-url", ""), L56: purgeToken: val("--purge-token", process.env.PURGE_TOKEN ?? ""), L57: }; ... L60: function gitChangedFiles(since: string, blocksDir: string): string[] { L61: const out = execSync(`git diff --name-only ${since} HEAD`, { encoding: "utf-8" }); L62: return changedBlockFiles(out, blocksDir); ... L65: async function purgeCache(origin: string, token: string, paths: string[]): Promise<void> { L66: const res = await fetch(new URL("/_cache/purge", origin).toString(), { L67: method: "POST",
High
Same File Env Network Execution

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

scripts/sync-blocks-to-kv.tsView on unpkg · L55
scripts/migrate-to-cf-observability.test.tsView file
14*/ L15: import * as cp from "node:child_process"; L16: import * as fs from "node:fs"; ... L23: function runCodemod(args: string[]): { stdout: string; stderr: string; code: number } { L24: const r = cp.spawnSync("npx", ["tsx", SCRIPT, ...args], { encoding: "utf8" }); L25: return { stdout: r.stdout || "", stderr: r.stderr || "", code: r.status ?? 0 };
High
Runtime Package Install

Package source invokes a package manager install command at runtime.

scripts/migrate-to-cf-observability.test.tsView on unpkg · L14
scripts/generate-schema.test.tsView file
matchType = previous_version_dangerous_delta matchedPackage = @decocms/blocks-cli@7.5.0 matchedIdentity = npm:QGRlY29jbXMvYmxvY2tzLWNsaQ:7.5.0 similarity = 0.979 summary = stored previous version shares package body but lacks this dangerous source file
Critical
Previous Version Dangerous Delta

This package version adds a dangerous source file absent from the previous stored version; route for source-aware review.

scripts/generate-schema.test.tsView on unpkg

Findings

1 Critical4 High4 Medium5 Low
CriticalPrevious Version Dangerous Deltascripts/generate-schema.test.ts
HighChild Processscripts/audit-observability-config.test.ts
HighShell
HighSame File Env Network Executionscripts/sync-blocks-to-kv.ts
HighRuntime Package Installscripts/migrate-to-cf-observability.test.ts
MediumDynamic Requirescripts/audit-observability-config.test.ts
MediumNetwork
MediumEnvironment Vars
MediumStructural Risk Force Deep Review
LowScripts Present
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License