memory-bank

Warn

Audited by Socket on Sep 8, 2026

10 alerts found:

Anomalyx9Security
AnomalyLOW
scripts/mb_openspec_normalize.py

No explicit malicious payload or credential-stealing logic is visible in the Python fragment itself. However, the module executes a dynamically resolved command via bash -c based on stdout from an external resolver script, and it forwards the entire process environment (including any secrets) to that command. This creates a significant supply-chain / arbitrary command execution risk depending on the integrity and inputs of the resolver/command resolution flow. Cache persistence is somewhat hardened against path/symlink escapes, and cached outputs undergo shape validation, but these do not mitigate the core execution risk.

Confidence: 58%Severity: 62%
AnomalyLOW
hooks/lib/recall_index.py

No clear evidence of intentional malware (no network calls, no process spawning, no persistence, no credential theft). However, this module can perform sensitive filesystem reads using request-controlled `mb`/`source` values and then directly emits the read content in its rendered stdout, creating a high potential for data disclosure if exposed to untrusted requests. Additionally, its dynamic import mechanism mutates `sys.path` to locate and import `rrf_merge`, introducing a local/supply-chain behavior risk in adversarial filesystem environments.

Confidence: 66%Severity: 68%
AnomalyLOW
docs/security/audit-2026-04-21.md

The provided fragment alleges multiple high-impact supply-chain risk behaviors consistent with malicious capability: manifest-driven recursive deletion (rm -rf), conditional/unconditional execution of a repository-controlled override script via bash, and symlink-related overwrite hazards. It also describes privacy risks from partial secret redaction and retention of sensitive backups/logs. While the exact implementation cannot be verified because the actual code is not included, the described primitives warrant urgent review and hardening (strict path canonicalization/allowlisting, opt-in for override execution, refusal to follow unsafe symlinks, and stronger secret detection/retention controls).

Confidence: 45%Severity: 68%
SecurityMEDIUM
scripts/mb-test-run.sh

No direct malware/persistence/exfiltration code is visible in this fragment. However, the script contains a high-impact supply-chain control weakness: it executes a caller-controlled command string using `eval` (from TEST_CMD_CLI/MB_TEST_COMMAND). If an attacker can influence those environment variables (common in CI/config poisoning scenarios), they can achieve arbitrary code execution in the repository directory. Additionally, test execution via go test/bats and log parsing can propagate whatever test output is produced into CI artifacts, potentially including sensitive information.

Confidence: 74%Severity: 78%
AnomalyLOW
adapters/pi_session_memory_extension.ts

Moderate concern: this module persistently logs user input (truncated) and tool execution outcomes to sessionFile (privacy/data retention risk) and also executes a Bash script on shutdown via detached child_process.spawn. The background script execution behavior is unknown from the fragment and is the main security-relevant sink. Without seeing how sessionFile/mbPath/SKILL_DIR are constructed and whether mbPath can be user-controlled, a supply-chain or argument-injection/backdoor risk cannot be ruled out, though there is no clear evidence of network exfiltration in the provided snippet.

Confidence: 55%Severity: 55%
AnomalyLOW
scripts/mb-sdd-self-check-eval.sh

No direct indicators of malware (exfiltration, persistence, credential theft, network activity, or obfuscated payloads) are present in this fragment. However, the function is intrinsically high-privilege because it executes the provided cmd via bash eval with only heuristic preflight checks; if any portion of cmd (or related inputs) can be influenced by an attacker, this becomes a serious RCE risk. Additionally, optional ore is used as an ERE pattern in grep -E, which can introduce performance risk if untrusted. Treat cmd/ore as fully trusted and ensure strict supply-chain integrity for declarations.

Confidence: 70%Severity: 60%
AnomalyLOW
settings/hooks.json

This fragment is not evidence of in-line malware; it is primarily a high-control orchestrator that executes many opaque local hook scripts from `~/.claude/...` across a full session lifecycle. It explicitly directs use of sensitive local context (`~/.claude/CLAUDE.md`), and it likely performs logging/sync/autosave operations via external scripts. The concrete threat level depends entirely on the integrity and content of the referenced hook/script files; if they are trusted and integrity-protected, risk is lower, but if tampered with, the execution surface enables arbitrary malicious actions (including possible data exfiltration) and persistence-like behavior.

Confidence: 62%Severity: 65%
AnomalyLOW
scripts/mb-metrics.sh

This module is primarily a metrics collector, but it contains two high-impact execution surfaces that elevate supply-chain risk when used on untrusted repositories: (1) it can execute a repository-local override script (.memory-bank/metrics.sh) when MB_ALLOW_METRICS_OVERRIDE=1, and (2) in --run mode it executes a dynamically derived command via bash -c "$TEST_CMD". The absence of visible exfiltration/backdoors in this fragment suggests it is not clearly malware by itself, but it can readily become an arbitrary code execution vehicle depending on repository contents and—critically—the implementation of _lib.sh command construction and sanitization.

Confidence: 64%Severity: 62%
AnomalyLOW
commands/db-migration.md

No direct indicators of overt malware (exfiltration, backdoor/persistence, credential theft) are present in the provided fragment. However, it contains a high-impact execution sink: `eval` executes shell code derived from the output of a helper script located in a user home directory. If that helper script or its output can be tampered with, this workflow becomes an arbitrary command execution vector. The remainder of the fragment is mainly read-only tool detection and stated safety requirements, but enforcement and the migration write/apply logic are not included here, limiting verification of the destructive-change safeguards and correct escaping/DDL safety.

Confidence: 62%Severity: 62%
AnomalyLOW
commands/api-contract.md

The code fragment is an automation workflow for API contract generation/diffing/testing and shows no direct signs of overt malware (no exfiltration/persistence/reverse shell patterns in the provided text). However, it contains a significant execution risk: it uses eval on stdout from a local user-home script (~/.claude/…), which can enable arbitrary command execution if that script or its output is tampered with. Additionally, reliance on npx-run tooling increases general supply-chain/execution exposure unless versions are pinned/locked.

Confidence: 72%Severity: 62%
Audit Metadata
Analyzed At
Sep 8, 2026, 06:07 AM
Package URL
pkg:socket/skills-sh/fockus%2Fskill-memory-bank%2Fmemory-bank%2F@85e39bb7d959f641d307c1f2e10d9386b3f07ebc