Loading npm security reports…
Loading npm security reports…
greprag@5.59.1: Agent extension lifecycle risk – flagged | LPM Firewall
npm / greprag / 5.59.1 Incomplete Chip Spawn artifact; install 5.59.2 or later.
GrepRAG — agent memory for Claude Code, Codex, and OpenCode.
Flagged as agent extension risk
Allowed by default with warning: install-time first-party agent extension setup was detected.
AI security reviewscanned on Nov 8, 2026, 08:10 UTC · by lpm-firewall-ai The postinstall hook writes the package's own skill into external Claude Code or Codex skill directories without a separate user command, creating an automatic agent-extension lifecycle risk. The inspected behavior is scoped to GrepRAG's skill and an existing Claude Code document, so it does not establish malicious control hijacking.
Static reason
High-risk behavior combination matched malicious policy.; source matched previously finalized malicious package; routed for review
Trigger
Package installation runs the postinstall script.
Impact
Agent behavior can change immediately after installation without a separate setup command. The observed writes are limited to GrepRAG's own skill and an existing Claude Code document.
Mechanism
The script detects existing Claude Code or Codex homes, then copies the package's own skill files into their skills directories; it may refresh an existing Claude Code chip-spawn document.
Evidence
package.json scripts/postinstall.js ~/.claude/skills/greprag ~/.codex/skills/greprag ~/.claude/docs/chip-spawn.md
public snapshot
Evidence for warning
The postinstall hook runs automatically and targets detected Claude Code and Codex homes. It copies the package's own skills into agent skill directories, installing the core GrepRAG skill even when it was not already present. It also refreshes an existing Claude Code chip-spawn document during install. Evidence against
The hook skips agent homes that are not present and limits new skill installs to the GrepRAG core skill. Other skills and the chip-spawn document are refreshed only when they already exist. The manifest also has a prepublishOnly build-and-verification script; no harmful install-time network behavior was identified. Behavioral surface
Source Child process · Crypto · Environment variables · Filesystem · Network · Shell
Supply chain High entropy strings · Minified · URL strings
Manifest No manifest risk signals triggered.
Scanned 143 files · 1.63 MB of source
7 external domains referenced
127.0.0.1 api.greprag.com code.claude.com docs.claude.com docs.stripe.com registry.npmjs.org www.apple.com Findings1 critical · 19 high · 5 medium · 5 low Source & flagged code22 flagged High Install time lifecycle scripts
Package defines install-time lifecycle scripts.
package.json View on unpkg Medium Ambiguous install lifecycle script
Install-time lifecycle script is not statically allowlisted and needs review.
package.json View on unpkg Shared scanner record · 2 findings · 1 line scripts.postinstall = node scripts/postinstall.js
High Child process
Package source references child process execution.
dist/procedure-run.js View on unpkg · L51 Code excerpt · 3 lines 51 const crypto = __importStar (require ("crypto" ));
52 const child_process_1 = require ("child_process" );
53 function stateDir () {
Code excerpt · 3 lines 10 * On Windows, any `spawn` / `exec*` / `*Sync` launched WITHOUT
11 * `windowsHide: true` flashes a `cmd.exe` /console window. v5.40.0 shipped
12 * that flash four separate times (guard-refresh, guard-flush, desk-line,
High Trigger reachable persistence
A manifest entrypoint or package-local install chain reaches persistence behavior.
dist/commands/codex-startup.js View on unpkg · L45 Medium Install persistence
Source writes installer persistence such as shell profile or service configuration.
dist/commands/codex-startup.js View on unpkg · L45 Shared code excerpt · 2 findings · 12 lines Trigger-reachable persistence chain: manifest.main -> dist/index.js -> dist/commands/codex.js -> dist/commands/codex-startup.js
45 function home () {
46 return process.env.HOME || process.env.USERPROFILE || os.homedir ();
47 }
⋯
53 }
54 function powershellQuote (s) {
55 return `'${s.replace(/'/g, "''")}'` ;
High Same file environment network execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/commands/docptr.js View on unpkg · L53 Code excerpt · 6 lines 53 const fs = __importStar (require ("node:fs" ));
54 const node_child_process_1 = require ("node:child_process" );
55 const project_anchor_1 = require ("../project-anchor" );
⋯
58 return {
59 apiUrl: process.env.GREPRAG_API_URL || 'https://api.greprag.com' ,
60 apiKey: process.env.GREPRAG_API_KEY || '' ,
Critical AI agent control hijack
Source creates an unconsented AI-agent control surface through install-time mutation or a default unauthenticated remote skill channel.
scripts/postinstall.js View on unpkg · L24 Code excerpt · 12 lines 24 name: 'Claude Code' ,
25 agentDir: path.join (home, '.claude' ),
26 skillsTarget: path.join (home, '.claude' , 'skills' ),
27 docsTarget: path.join (home, '.claude' , 'docs' ),
28 refreshClaudeDocs: true ,
⋯
31 name: 'Codex' ,
32 agentDir: path.join (home, '.codex' ),
33
High External AI agent control surface mutation
Runtime or CLI source writes behavior-bearing configuration into a user or project AI-agent control surface.
dist/opencode-plugin.bundle.js View on unpkg Scanner record · 30 lines Runtime or CLI code links a write operation to an explicit external AI-agent control path:
.push(proc.announce.summary);
}
return lines;
}
var debug_log_path = path3.join(os.homedir(), ".greprag", "opencode-plugin-debug.log");
var _debuglogready = false;
function dloginit() {
if (_debuglogready)
return;
_debuglogready = true;
try {
fs3.writefilesync(debug_log_path, "");
} catch {
}
}
High Trigger reachable external AI agent control surface mutation
Manifest-trigger-reachable source writes behavior-bearing configuration into a user or project AI-agent control surface.
dist/commands/init.js View on unpkg Scanner record · 21 lines Manifest-trigger-reachable source links an external AI-agent control path to a behavior-bearing write operation.
';
if (!fs.existssync(dir))
fs.mkdirsync(dir, { recursive: true });
const body = object.entries(existing)
.map(([k, v]) => `${k}=${v}`)
.join('\n') + '\n';
fs.writefilesync(file, body);
}
function readenvfile(file) {
const out = {};
try {
const raw = fs.readfilesync(file, 'utf-8');
for (const line of raw.split(/\r?\n/)) {
const trimmed = line.trim();
if (!trimmed || trimmed.startswith('#'))
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/opencode-watch.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/opencode-watch.js
matchedIdentity = npm:Z3JlcHJhZw:5.78.3
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/watcher-registry.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.74.21
matchedPath = dist/commands/watcher-registry.js
matchedIdentity = npm:Z3JlcHJhZw:5.74.21
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/ccr-store.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/ccr-store.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/codex-doctor.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/commands/codex-doctor.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source
dist/commands/inbox-watch-supervisor.js View file High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/inbox-watch-supervisor.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.74.21
matchedPath = dist/commands/inbox-watch-supervisor.js
matchedIdentity = npm:Z3JlcHJhZw:5.74.21
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/inbox-watch.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.74.21
matchedPath = dist/commands/inbox-watch.js
matchedIdentity = npm:Z3JlcHJhZw:5.74.21
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/opencode-relay.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/commands/opencode-relay.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/opencode-plugin.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/opencode-plugin.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/codex-steering.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/codex-steering.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/checkpoint-helpers.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.73.12
matchedPath = dist/commands/checkpoint-helpers.js
matchedIdentity = npm:Z3JlcHJhZw:5.73.12
similarity = 1.000
summary = normalized source hash matched finalized malicious source
Code↓
Package metadata 8 findings
Medium Network
Medium Environment variables
Medium Structural risk force deep review
Low Non install lifecycle scripts
68 cli: stableExecutable (path.join (__dirname, '..' , 'index.js' )),
69 args: process.platform === 'win32'
70 ? ['codex' , 'watch' , '--all' , '--delivery' , 'app-server-resume' , '--transport' , 'stdio' ]
87 const file = path.join (home (), 'Library' , 'LaunchAgents' , 'com.greprag.codex-watch.plist' );
88 return { kind: 'macOS LaunchAgent' , path: file, installed: fs.existsSync (file), hint: 'Load with launchctl or log out/in.' };
skillsTarget: path.join (home, '.codex' , 'skills' ),
34 docsTarget: path.join (home, '.codex' , 'docs' ),
35 refreshClaudeDocs: false ,
39 function copyDir (src, dest) {
40 fs.mkdirSync (dest, { recursive: true });
const line = `[${( new date()).toisostring()}] [greprag-memory] ${msg}
fs3.appendfilesync(debug_log_path, line);
dlog(`module top reached: pid=${process.pid} argv0=${process.argv[0]} distpath=${__filename}`);
var api_url = "https://api.greprag.com";
function loadenvfile(filepath
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/opencode-plugin.bundle.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/opencode-plugin.bundle.js
matchedIdentity = npm:Z3JlcHJhZw:5.78.3
similarity = 1.000
summary = normalized source hash matched finalized malicious source
continue;
const idx = trimmed.indexof('=');
let value = trimmed.slice(idx + 1).trim();
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/init.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.60.4
matchedPath = dist/commands/init.js
matchedIdentity = npm:Z3JlcHJhZw:5.60.4
similarity = 1.000
summary = normalized source hash matched finalized malicious source