Skip to main content
SkillTotal

Is @mastra/core safe?

Partially analyzed - 4 code files not read (2 too large and 2 minified)
Notable — review in context (a capability is not a malicious indicator):
  • Node.js shell/command execution
  • Node.js filesystem read
  • Node.js filesystem write/delete

What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.

@mastra/core is an npm package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators. It can: filesystem read, filesystem write, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 0/100 (low).

@mastra/core 1.85.0

npm package · npm:@mastra/core
LOW
0
/ 100 risk score
Snapshot · scanned Nov 21, 2026 · @mastra/core@1.85.0 · engine 1.8.0 / ruleset 107

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 @mastra/core's authors. Report a false positive.

Capabilities — what this component can do (not a risk score):
filesystem readfilesystem writenetwork egressshell execution

Behavioral traits

How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.

Execution authority
Tool Access Control / Direct Tool Access
Filesystem reach
Tool Execution Context
Network egress
Interaction & Communication / Direct Communication

Findings (4)

CapabilityNode.js shell/command executionnot scored · severity highST-SHELL-NODE

The component can run operating-system commands or spawn processes.

let child_process = require("child_process");
import { execFile } from "child_process";
import { execFile } from "child_process";
let child_process = require("child_process");
let child_process = require("child_process");
import { exec } from "child_process";
let child_process = require("child_process");
async spawn(command, options = {}) {
throw new Error(`${this.constructor.name} must implement spawn()`);
async spawn(command, options = {}) {
import { execFileSync } from "child_process";
async spawn(command, options = {}) {
throw new Error(`${this.constructor.name} must implement spawn()`);
async spawn(command, options = {}) {
import type { execa as execaType } from 'execa';

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.

CapabilityNode.js filesystem readnot scored · severity mediumST-FS-NODE-READ

The component reads files from disk.

const content = await (0, fs_promises.readFile)(file, "utf-8");
return JSON.parse(await (0, fs_promises.readFile)(path, "utf8"));
const globalJsonContent = fs.readFileSync(GLOBAL_PROVIDER_REGISTRY_JSON(), "utf-8");
if (fs.existsSync(localJsonPath)) shouldCopyJson = globalJsonContent !== fs.readFileSync(localJsonPath, "utf-8");
const globalDtsContent = fs.readFileSync(GLOBAL_PROVIDER_TYPES_DTS(), "utf-8");
if (fs.existsSync(localDtsPath)) shouldCopyDts = globalDtsContent !== fs.readFileSync(localDtsPath, "utf-8");
const timestamp = fs.readFileSync(CACHE_FILE(), "utf-8").trim();
const content = fs.readFileSync(jsonPath, "utf-8");
const content = fs.readFileSync(filePath, "utf-8");
const globalJsonContent = fs.default.readFileSync(GLOBAL_PROVIDER_REGISTRY_JSON(), "utf-8");
if (fs.default.existsSync(localJsonPath)) shouldCopyJson = globalJsonContent !== fs.default.readFileSync(localJsonPath, "utf-8");
const globalDtsContent = fs.default.readFileSync(GLOBAL_PROVIDER_TYPES_DTS(), "utf-8");
if (fs.default.existsSync(localDtsPath)) shouldCopyDts = globalDtsContent !== fs.default.readFileSync(localDtsPath, "utf-8");
const timestamp = fs.default.readFileSync(CACHE_FILE(), "utf-8").trim();
const content = fs.default.readFileSync(jsonPath, "utf-8");
const content = fs.default.readFileSync(filePath, "utf-8");
const parsed = JSON.parse((0, fs.readFileSync)(cursorPath, "utf-8"));
return r.fs.readFile(r.fsPath, options);
const content = await srcR.fs.readFile(srcR.fsPath);
return options?.encoding ? await fs_promises.readFile(absolutePath, { encoding: options.encoding }) : await fs_promises.readFile(absolutePath);
current = Number.parseInt((0, fs.readFileSync)(OOM_SCORE_ADJ_PATH, "utf8"), 10);
existingProfile = await fs_promises.readFile(userProvidedPath, "utf-8");
const content = await fs_promises.readFile(markerPath, "utf-8");
return (await fs_promises.default.readFile(filePath, "utf-8")).split("\n")[lineNumber - 1]?.trim() ?? null;
fileContent = await fs_promises.default.readFile(absolutePath, "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.

CapabilityNode.js filesystem write/deletenot scored · severity mediumST-FS-NODE-WRITE

The component writes or deletes files on disk.

(0, fs.unlinkSync)(fullPath);
(0, fs.unlinkSync)(fullPath);
await (0, fs_promises.unlink)(leasePath).catch(() => {});
if ((await this.#readLease(leasePath))?.owner === owner) await (0, fs_promises.unlink)(leasePath).catch(() => {});
await (0, fs_promises.writeFile)(candidatePath, JSON.stringify(lockRecord), { flag: "wx" });
await (0, fs_promises.unlink)(candidatePath).catch(() => {});
if (this.#sameLeaseMutationLock(heldLock, lockRecord)) await (0, fs_promises.unlink)(lockPath).catch(() => {});
await (0, fs_promises.writeFile)(candidatePath, JSON.stringify(owner), { flag: "wx" });
await (0, fs_promises.unlink)(candidatePath).catch(() => {});
await (0, fs_promises.rm)(ownerDirectory, {
await (0, fs_promises.rm)(ownerDirectory, {
await (0, fs_promises.unlink)(isolatedPath).catch(() => {});
await (0, fs_promises.unlink)(recoveryPath).catch(() => {});
await (0, fs_promises.rm)(`${recoveryPath}.owners`, {
if (this.#sameLeaseMutationLock(current, expected)) await (0, fs_promises.unlink)(lockPath).catch(() => {});
await (0, fs_promises.writeFile)(tempPath, JSON.stringify(value), { flag: "wx" });
await (0, fs_promises.unlink)(tempPath).catch(() => {});
if (sameIdentity(await fileIdentity(this.socketPath).catch(() => void 0), identity)) await (0, fs_promises.unlink)(this.socketPath).catch(() => {});
await (0, fs_promises.unlink)(privatePath).catch(() => {});
await (0, fs_promises.unlink)(lockPath).catch(() => {});
if (sameIdentity(await fileIdentity(lockPath).catch(() => void 0), lockIdentity)) await (0, fs_promises.unlink)(lockPath).catch(() => {});
fs.writeFileSync(tempPath, content, encoding);
fs.unlinkSync(GLOBAL_PROVIDER_REGISTRY_JSON());
fs.unlinkSync(GLOBAL_PROVIDER_TYPES_DTS());

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.

CapabilityNode.js network egressnot scored · severity mediumST-NET-NODE

The component makes outbound network requests.

import { ServerResponse as ServerResponse_2 } from 'node:http';
import { ServerResponse } from 'node:http';
import { ServerResponse as ServerResponse_2 } from 'http';
import { ServerResponse } from 'node:http';
import { ServerResponse as ServerResponse_2 } from 'http';
import { ServerResponse } from 'node:http';
import { ServerResponse as ServerResponse_2 } from 'http';
const response = await this.#fetch(url, {
const response = await this.#fetch(url, {
const response = await fetch(versionUrl, { signal: controller.signal });
const response = await fetch(versionUrl, { signal: controller.signal });
return ((input, init) => fetch(input, {
const response = await fetch(currentUrl, perHopInit("manual"));
return await fetch(currentUrl, perHopInit("follow"));
const response = await fetch(url, {
return ((input, init) => fetch(input, {
const response = await fetch(currentUrl, perHopInit("manual"));
return await fetch(currentUrl, perHopInit("follow"));
const response = await fetch(url, {
const response = await fetch(urlText);
const response = await fetch(urlText);
return ((input, init) => fetch(input, {

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.

How attackers abuse these capabilities

Interactive labs on the attack class behind the rules above. They show the technique, not anything found in @mastra/core.

Maintain @mastra/core?

Check the next package before your agent installs it

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 component

How we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →