Cross-Agent Memory Sharing

Security checks across static analysis, malware telemetry, and agentic risk

Overview

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.

Static analysis

Dangerous exec

Critical
Finding
Shell command execution detected (child_process).

VirusTotal

64/64 vendors flagged this skill as clean.

View on VirusTotal

Risk analysis

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.

What this means

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.

Why it was flagged

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.

Skill content
execSync(`git clone ${SHARED_REPO} ${sharedDir}`, { stdio: 'inherit' });
Recommendation

Use execFileSync or spawn with argument arrays, validate and quote inputs, and avoid passing user-controlled values through a shell.

What this means

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.

Why it was flagged

The script exports the full local MEMORY.md content into the shared repository without filtering, redaction, or a per-run confirmation step.

Skill content
const localMemory = path.join(WORKSPACE, 'MEMORY.md'); ... const content = fs.readFileSync(localMemory, 'utf-8'); ... fs.writeFileSync(sharedMemory, JSON.stringify(exported, null, 2));
Recommendation

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.

What this means

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.

Why it was flagged

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.

Skill content
const SHARED_REPO = process.env.SHARED_MEMORY_REPO || 'https://github.com/weidadong2359/agent-memory-shared.git'; ... execSync('git push', { cwd: sharedDir, stdio: 'inherit' });
Recommendation

Require the user to configure an explicit private repository, declare the Git/GitHub credential requirement, and show the target remote before any push.

What this means

Another contributor to the shared repository could introduce misleading or malicious memory content that an agent may later trust.

Why it was flagged

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.

Skill content
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 });
Recommendation

Authenticate memory producers, sign or verify memory files, restrict trusted agent IDs, and treat imported memory as untrusted until reviewed.

What this means

One mistaken or malicious memory update could spread across agents and persist in version control.

Why it was flagged

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.

Skill content
case 'sync':
    pullUpdates(sharedDir);
    exportMemory(sharedDir);
    pushUpdates(sharedDir, 'Sync memory');
Recommendation

Make sync steps explicit, add review gates before push/import, validate memory changes, and provide rollback guidance.