Dangerous exec
- Finding
- Shell command execution detected (child_process).
Security checks across static analysis, malware telemetry, and agentic risk
This skill is meant to share agent memories, but its script can push your local MEMORY.md to a hard-coded GitHub repo and uses unsafe shell Git commands.
Install or run this only after configuring your own private shared repository, reviewing what is in MEMORY.md, and confirming the script has been fixed to avoid shell injection and to require approval before pushing or importing memory.
64/64 vendors flagged this skill as clean.
Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.
A malicious or malformed repo URL, workspace path, agent ID, or commit message could run commands on the user's machine when the sync script is invoked.
The script builds shell commands by interpolating environment-derived values into execSync. Similar interpolation is also used for the commit message, so shell metacharacters in SHARED_MEMORY_REPO, OPENCLAW_WORKSPACE, AGENT_ID, or the message argument could execute unintended commands.
execSync(`git clone ${SHARED_REPO} ${sharedDir}`, { stdio: 'inherit' });Use execFileSync or spawn with argument arrays, validate and quote inputs, and avoid passing user-controlled values through a shell.
Private instructions, user facts, project details, or secrets stored in local memory could be copied into a shared Git repository and reused by other agents.
The script exports the full local MEMORY.md content into the shared repository without filtering, redaction, or a per-run confirmation step.
const localMemory = path.join(WORKSPACE, 'MEMORY.md'); ... const content = fs.readFileSync(localMemory, 'utf-8'); ... fs.writeFileSync(sharedMemory, JSON.stringify(exported, null, 2));
Review MEMORY.md before syncing, require explicit approval before export, add redaction/exclusion controls, and use a private repository controlled by the user or team.
The skill may attempt to mutate a remote GitHub repository using existing local credentials, and users may not realize which account or repository is being used.
The script defaults to a hard-coded GitHub repository and pushes commits using whatever Git credentials are available, while the registry declares no credential requirement or scope.
const SHARED_REPO = process.env.SHARED_MEMORY_REPO || 'https://github.com/weidadong2359/agent-memory-shared.git'; ... execSync('git push', { cwd: sharedDir, stdio: 'inherit' });Require the user to configure an explicit private repository, declare the Git/GitHub credential requirement, and show the target remote before any push.
Another contributor to the shared repository could introduce misleading or malicious memory content that an agent may later trust.
Imported memories are accepted from any matching file in the shared repo based only on self-declared JSON fields, with no signature, identity verification, trust policy, or provenance check.
const files = fs.readdirSync(sharedDir).filter(f => f.endsWith('-memory.md')); ... const data = JSON.parse(fs.readFileSync(filePath, 'utf-8')); imported.push({ agentId: data.agentId, timestamp: data.timestamp, content: data.content });Authenticate memory producers, sign or verify memory files, restrict trusted agent IDs, and treat imported memory as untrusted until reviewed.
One mistaken or malicious memory update could spread across agents and persist in version control.
The default command performs a full pull-export-push cycle, which can propagate bad, sensitive, or poisoned memory through the shared repository to other agents.
case 'sync':
pullUpdates(sharedDir);
exportMemory(sharedDir);
pushUpdates(sharedDir, 'Sync memory');Make sync steps explicit, add review gates before push/import, validate memory changes, and provide rollback guidance.