Loading npm security reports…
Loading npm security reports…
greprag@5.85.3: Agent extension lifecycle risk – flagged | LPM Firewall
npm / greprag / 5.85.3 Private GrepRAG client for existing Claude Code, Codex, OpenCode, and Grok Build tenants.
Flagged as agent extension risk
Allowed by default with warning: install-time first-party agent extension setup was detected.
AI security reviewscanned on Oct 14, 2026, 16:23 UTC · by lpm-firewall-ai The manifest activates a postinstall hook that writes bundled skills into global agent skill directories without an affirmative setup step. This meets the warning category for first-party package-owned agent extension setup, while the inspected behavior does not establish a block-level attack.
Static reason
High-risk behavior combination matched malicious policy.; source matched previously finalized malicious package; routed for review
Trigger
Installing the package runs its postinstall hook.
Impact
The agent may load the installed GrepRAG skill in later sessions, changing its available instructions and capabilities.
Mechanism
The hook detects existing Claude Code or Codex directories and copies the bundled core skill, plus refreshes bundled skills already installed, into their global skill folders without an affirmative setup prompt in the hook.
Evidence
package.json scripts/postinstall.js ~/.claude/skills ~/.codex/skills
public snapshot
Evidence for warning
package.json declares a postinstall hook that runs scripts/postinstall.js. The hook checks for existing Claude Code or Codex directories and targets their global skills folders. The hook copies the bundled core GrepRAG skill into detected agent skill directories and refreshes bundled skills already present. Evidence against
The observed automatic setup is limited to bundled GrepRAG skills; this source does not establish credential collection or a remote payload. Behavioral surface
Source Child process · Crypto · Dynamic require · Environment variables · Filesystem · Network · Shell
Supply chain High entropy strings · Minified · URL strings
Manifest No manifest risk signals triggered.
Scanned 220 files · 2.50 MB of source
7 external domains referenced
127.0.0.1 api.example.com api.greprag.com code.claude.com docs.claude.com docs.stripe.com registry.npmjs.org Findings1 critical · 18 high · 6 medium · 5 low Source & flagged code23 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
Medium Dynamic require
Package source references dynamic require/import behavior.
dist/deploy-gate.js View on unpkg · L63 Code excerpt · 3 lines 63 exports.evaluateDeployGate = evaluateDeployGate;
64 const fs = __importStar (require ("fs" ));
65 const path = __importStar (require ("path" ));
Low Weak crypto
Package source references weak cryptographic algorithms.
dist/commands/state-trigger.js View on unpkg · L84 Code excerpt · 9 lines 84 const TRIGRAM_MAX = 20 ;
85 const ERROR_RE = /\b (error|failed|exception|traceback|exit code [1 -9 ]|not found|no such)\b/i;
86 // ---------- Transcript → turns ----------------------------------------------
⋯
184 try {
185 rec = JSON.parse (trimmed);
186 }
⋯
451 // family (above) and names the flavor (below) — an invocation *mentioning*
452 // fnm/node_modules/package.json is not evidence that fnm/the workspace broke
High Trigger reachable persistence
A manifest entrypoint or package-local install chain reaches persistence behavior.
dist/commands/grok-spawn.js View on unpkg · L5 Medium Install persistence
Source writes installer persistence such as shell profile or service configuration.
dist/commands/grok-spawn.js View on unpkg · L5 Shared code excerpt · 2 findings · 12 lines Trigger-reachable persistence chain: manifest.main -> dist/index.js -> dist/commands/grok-spawn.js
5 * children when the tool call returns. The surviving launch is a scheduled
6 * task (`schtasks /Create /IT` then `/Run` ) that `start` s a new `cmd /k`
7 * window running grok.exe — a visible command-prompt bootloader outside the
⋯
50 const path = __importStar (require ( ));
High Host fingerprint exfiltration
Source collects local host identity data and sends it to an external endpoint.
dist/commands/skill.js View on unpkg · L99 Code excerpt · 12 lines 99 function projectSkillDir (skill) {
100 for (const source of (0 , sk[redacted])(process.cwd ())) {
101 if (source.scope !== 'project' )
⋯
159 function rmDir (p) {
160 // Node 14+ fs.rmSync; ours is Node 18+ per package.json engines.
161 fs.rmSync (p, { recursive: true , force: true });
⋯
167 function () {
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 · L10 Code excerpt · 12 lines 10 //
11 // The installed Claude chip-spawn doc (~/.claude/docs/chip-spawn.md) is retired:
12 // `greprag load chip-spawn` serves that doctrine from the package and cannot
⋯
27 name: 'Claude Code' ,
28 agentDir: path.join (home, '.claude' ),
29 skillsTarget: path.join (home, '.claude' , 'skills' ),
30 },
⋯
32 name: '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:
}
}
return { refreshed, blocked };
}
var debug_log_path = path12.join(os4.homedir(), ".greprag", "opencode-plugin-debug.log");
var _debuglogready = false;
function dloginit() {
if (_debuglogready)
return;
_debuglogready = true;
try {
fs11.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 · 20 lines Manifest-trigger-reachable source links an external AI-agent control path to a behavior-bearing write operation.
)
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('#'))
continue;
dist/archive/page-renderer.js#virtual:normalized:round1 View file High Semantic analysis limited
A bounded semantic-analysis stage reached its safety limit; remaining detectors completed, but this package requires AI review.
dist/archive/page-renderer.js#virtual:normalized:round1 View on unpkg Scanner record · 1 line stage = ast_semantic_analysis; reason = ast_parse_error; limitedFiles = 28
High Known malware source similarity
Source file is highly similar to a previously finalized malicious package; route for source-aware review.
dist/commands/app.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/app.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/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.78.3
matchedPath = dist/commands/watcher-registry.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/ccr-store.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/ccr-store.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/doctor.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/doctor.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/fix.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/fix.js
matchedIdentity = npm:Z3JlcHJhZw:5.78.3
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.78.3
matchedPath = dist/commands/inbox-watch-supervisor.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/mechanic.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/mechanic.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/opencode-relay.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/opencode-relay.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/status.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/commands/status.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/codex-delegation-dedupe.js View on unpkg Scanner record · 6 lines matchType = normalized_sha256
matchedPackage = greprag@5.78.3
matchedPath = dist/codex-delegation-dedupe.js
matchedIdentity = npm:Z3JlcHJhZw:5.78.3
similarity = 1.000
summary = normalized source hash matched finalized malicious source
Code↓
Package metadata 7 findings
Medium Network
Medium Environment variables
Medium Structural risk force deep review
453 // (`fnm exec … | grep -i error` classified as fnm-node-bootstrap off its own
"path"
51 const child_process_1 = require ("child_process" );
52 function winQuote (value) {
55 function resolveGrokExe () {
56 const home = os.homedir ();
57 const named = process.platform === 'win32' ? 'grok.exe' : 'grok' ;
58 const pinned = path.join (home, '.grok' , 'bin' , named);
136 console.error (` ${cmd.map(a => /\s/.test(a) ? JSON.stringify(a) : a).join(' ')}` );
mirrorApiConfig
168 const apiKey = process.env.GREPRAG_API_KEY || '' ;
170 throw new Error ('GREPRAG_API_KEY not set — run `greprag init` first.' );
171 return { apiUrl: process.env.GREPRAG_API_URL || 'https://api.greprag.com' , apiKey };
agentDir: path.join (home, '.codex' ),
34 skillsTarget: path.join (home, '.codex' , 'skills' ),
38 function copyDir (src, dest) {
const line = `[${( new date()).toisostring()}] [greprag-memory] ${msg}
fs11.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(filepath2) {
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
const idx = trimmed.indexof('=');
let value = trimmed.slice(idx + 1).trim();
if ((value.startswith('"') && value.endswith('"')