Is MemPalace/mempalace safe?
- Python shell/command execution
- Python dynamic code execution
- Node.js shell/command execution
What to do: The Rust and Go code was not checked for shell, network or file access, so this result is incomplete. Review that code before installing.
MemPalace/mempalace is a GitHub repository analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators. Its Rust and Go code was not checked for shell, network or file access, so this result is partial. It can: dynamic code execution, filesystem read, filesystem write, mcp tools detected, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 0/100 (low).
mempalace 3.12.0
Get notified when this component changes
Change alerts aren't live yet. Leave your email and we'll let you know when they launch. We use it only for this and delete it on request.
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of MemPalace/mempalace's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (11)
The code turns strings into live code at runtime (eval / new Function / exec).
exec(compile(source, str(path), "exec"), globals())
exec(compile(source, str(path), "exec"), globals())
exec(compile(source, str(path), "exec"), globals())
exec(compile(source, str(path), "exec"), globals())
Why it matters: If those strings aren't fixed and trusted, they become a way to run arbitrary code.
Fix: Avoid evaluating dynamically constructed code; if unavoidable, ensure the input is a trusted constant and never derived from external data.
An MCP server entry launches a command on your host.
"command": "mempalace-mcp"
"command": "mempalace-mcp"
"command": "mempalace-mcp"
"command": "mempalace-mcp"
"command": "mempalace-mcp"
Why it matters: Trusting the manifest means running that binary — verify what it is and where it comes from.
Fix: Verify the launched command and its source before trusting this MCP server configuration.
The component can run operating-system commands or spawn processes.
import { spawn, spawnSync } from 'node:child_process';const probe = spawnSync(pythonBin, ['-m', 'mempalace', '--version'], {spawnSync(
const child = spawn(
import { spawnSync } from 'node:child_process';const res = spawnSync(pythonBin, ['-m', 'mempalace', 'wake-up', '--wing', wing], {import { spawn, spawnSync } from 'node:child_process';const res = spawnSync(
const res = spawnSync(locator, [scriptName], {const child = spawn(this.pythonBin, ['-u', BRIDGE_SCRIPT], {Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; prefer execFile with an argument array.
The component can run operating-system commands or spawn processes.
subprocess.run(["git", "init", "-b", "main"], cwd=str(output_dir), check=True)
subprocess.run(["git", "add", "."], cwd=str(output_dir), check=True)
subprocess.run(
["git", "update-index", "--chmod=+x", rel],
cwd=str(output_dir),
check=True,
)proc = subprocess.run(
[agy_bin, "plugin", "validate", "--strict", "--json", str(output_dir)],
capture_output=True,
text=True,
timeout=30,
)return subprocess.Popen(
[
sys.executable,
"-I",
"-S",
str(Path(__file__).resolve()),
str(target),
str(grace),
str(e …proc = subprocess.Popen(
[sys.executable, "-c", _HOLD_SCRIPT, db_path],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
)completed = subprocess.run(
["git", "-C", str(workspace), *arguments],
check=False,
capture_output=True,
text=True,
)completed = subprocess.run(
command,
check=False,
**runner_kwargs,
)os.execve(sys.executable, child, env)
completed = subprocess.run(child, env=env)
out = subprocess.run(
["ps", "-o", "lstart=", "-p", str(int(pid))],
capture_output=True,
text=True,
timeout=2,
env={**os.environ, "LC_ALL": "C"},
check=False,
) …proc = subprocess.Popen(cmd, env=env, **kwargs)
proc = subprocess.Popen(
cmd,
stdout=log_f,
stderr=log_f,
env=child_env,
**_detached_popen_kwargs(),
)subprocess.run(
_mempalace_command("mine", mine_dir, "--mode", mode),
stdout=log_f,
stderr=log_f,
timeout=60,
# Windows: hide the conhost wi …subprocess.Popen(
["notify-send", "--app-name=MemPalace", "--icon=brain", title, body],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
**_detached_popen_kwargs(),
)r = subprocess.run(
["git", "-C", str(cwd), *args],
capture_output=True,
text=True,
timeout=timeout,
check=False,
)n = subprocess.run(
["git", "config", "--global", "user.name"],
capture_output=True,
text=True,
timeout=2,
check=False,
).stdout.strip()e = subprocess.run(
["git", "config", "--global", "user.email"],
capture_output=True,
text=True,
timeout=2,
check=False,
).stdout.strip()Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.
Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; avoid shell=True.
The component reads files from disk.
const cfg = JSON.parse(fs.readFileSync(cfgFile, 'utf-8'));
const raw = fs.readFileSync(fullPath).toString('latin1');return fs.readFileSync(0, 'utf-8');
const rawCount = fs.readFileSync(counterFile, 'utf-8').trim();
const logoSvg = fs.existsSync(logoPath) ? fs.readFileSync(logoPath, 'utf-8') : '';
const raw = fs.readFileSync(scriptPath).toString('latin1');app.page('/', () => fs.readFileSync(indexHtmlPath, 'utf-8'));new Response(fs.readFileSync(stylesCssPath, 'utf-8'), {new Response(fs.readFileSync(appJsPath, 'utf-8'), {Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
fs.appendFileSync(path.join(stateDir, 'antigravity_hook.log'), line, 'utf-8');
fs.writeFileSync(tmpPath, body, 'utf-8');
fs.unlinkSync(tmpPath);
fs.writeFileSync(filePath, body, 'utf-8');
fs.writeFileSync(marker, '', 'utf-8');
fs.rmSync(full, { recursive: true, force: true });fs.rmSync(pendingFile, { force: true });fs.writeFileSync(lastInputPath, rawInput.slice(0, 4096), { encoding: 'utf-8', mode: 0o600 });fs.rmSync(pendingFile, { force: true });fs.writeFileSync(pendingFile, '', 'utf-8');
fs.rmSync(pendingFile, { force: true });Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component reads files from disk.
text = src.read_text(encoding="utf-8")
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
zf.writestr(info, file_path.read_bytes())
with open(db_path, "rb") as f:
with open(marker_path, encoding="utf-8") as f:
with open(path, encoding="utf-8") as f:
with open(header_path, "rb") as handle:
with open(meta_path, "rb") as f:
with open(maps_path, encoding="utf-8", errors="replace") as memory_maps:
with open(path, "rb") as f:
with open(meta_path, "rb") as handle:
source = path.read_text(encoding="utf-8")
with open(filepath, encoding="utf-8", errors="replace") as f:
gitignore.read_text(encoding="utf-8", errors="replace") if gitignore.is_file() else ""
return Path(os.path.expanduser(file_arg)).read_bytes().decode("utf-8")task = json.loads(Path(task_file).read_text(encoding="utf-8"))
data = json.loads(path.read_text(encoding="utf-8"))
with open(db_path, "rb") as handle:
raw = self._config_file.read_bytes()
with open(self._people_map_file, "r", encoding="utf-8") as f:
with open(session_file, encoding="utf-8", errors="replace") as f:
token = token_path.read_text(encoding="utf-8").strip()
stat = Path(f"/proc/{int(pid)}/stat").read_text(encoding="utf-8")for line in Path("/proc/stat").read_text(encoding="utf-8").splitlines()pid = pid_path(palace_path).read_text(encoding="utf-8").strip()
Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.
Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.
The component writes or deletes files on disk.
dst.write_bytes(normalized.encode("utf-8"))shutil.copy2(src, dst)
shutil.rmtree(target, onexc=_handle_readonly)
shutil.rmtree(target, onerror=_handle_readonly)
gitattributes.write_bytes(
b"# Preserve LF line endings on scripts across Windows/macOS/Linux\n"
b"*.mjs text eol=lf\n"
b"*.sh text eol=lf\n"
)manifest_path.write_bytes((json.dumps(manifest, indent=2) + "\n").encode("utf-8"))shutil.copytree(src, dst, symlinks=symlinks, ignore=_ignore)
shutil.rmtree(path)
os.remove(path)
with open(origin_path, "w", encoding="utf-8") as f:
with open(gitignore, "a", encoding="utf-8") as f:
Path(os.path.expanduser(args.out)).write_bytes(artifact["content"].encode("utf-8"))shutil.rmtree(backup_path)
os.remove(marker)
atomic_write_text(path, text)
log_fh = open(log_path, "a", encoding="utf-8")
lock_fh = open(state_dir(palace_path) / "start.lock", "a")
lock_fh = open(sd / "start.lock", "w") if _fcntl is not None else None
with open(config_path, "w", encoding="utf-8") as f:
with open(output_path, "w", encoding="utf-8") as f:
with open(output_path, "w", encoding="utf-8") as f:
with open(output_path, "w", encoding="utf-8") as f:
with open(out_path, "w", encoding="utf-8") as f:
state_file.write_text(json.dumps(state, indent=2))
_atomic_write_text(self._path, json.dumps(self._data, indent=2))
Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.
Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.
The component makes outbound network requests.
const res = await fetch(ENDPOINT, {Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
The component makes outbound network requests.
import urllib.request
_OPENER = urllib.request.build_opener(NoRedirectHandler)
from urllib import parse as urlparse
from urllib import error as urlerror, parse as urlparse, request as urlrequest
req = urlrequest.Request(url, data=data, method=method, headers=headers)
from urllib.request import pathname2url
return f"file:{pathname2url(db_path)}?mode=ro"from urllib import error as urlerror, request as urlrequest
self._opener = urlrequest.build_opener(urlrequest.ProxyHandler({}), _NoRedirectHandler)req = urlrequest.Request(
self.base_url + path,
data=data,
method=method,
headers={
"Authorization": f"Bearer {self.token}",
"Content-Type": "application/json", …import urllib.request
request = urllib.request.Request(f"{self.base_url}/healthz", headers=hub_request_headers())return urllib.request.Request(url, data=body, headers=headers)
from urllib.request import Request
req = Request(
url,
data=json_request_body(body),
headers={"Content-Type": "application/json", **headers},
)req = Request(self._models_url())
import urllib.request
url += "?" + urllib.parse.urlencode(params)
request = urllib.request.Request(url)
from urllib.request import Request, urlopen
request = Request(
"https://pypi.org/pypi/mempalace/json",
headers={"Accept": "application/json", "User-Agent": "mempalace-update-check"},
)with urlopen(request, timeout=2.0) as response: # noqa: S310 -- fixed HTTPS origin
Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.
Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.
An MCP tool surface (manifest or tool definitions) was found.
"mcpServers": {"mcpServers": {"mcpServers": {"mcpServers": {"mcpServers": {Why it matters: Just context — review which tools it offers and their permissions.
Fix: Review the declared MCP tools and their permissions.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in MemPalace/mempalace.
Maintain MemPalace/mempalace?
The free Claude Code plugin scans each npm, PyPI or MCP package with this report's open-source engine before the install command runs. It runs on your machine and needs no account.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →