Skip to main content

Mastra Case Study

Verified baseline scan — CVE Lite CLI v1.18.1 · 2026-05-29

Mastra logo

Summary

  • Project: Mastra — TypeScript AI agent framework (agents, tools, workflows, observability, and playground UI)
  • Revision: e9d54b281667477dd97b9dfc166b338f6d097fe8
  • Lockfile: pnpm-lock.yaml (4,555 resolved packages, pnpm 11.3.0)
  • Baseline findings: 64 unique vulnerable packages (3 critical · 30 high · 25 medium · 6 low)
  • OSV advisory matches: 135 CVE/advisory entries deduplicated into 64 packages
  • Direct vs transitive: 4 direct / 60 transitive
  • Validated fix command groups generated: 2
  • First-pass coverage: 3 of 64 findings have confident copy-and-run commands
  • pnpm audit (same lockfile): 116 vulnerability entries (4 critical · 55 high · 51 moderate · 6 low)
  • Remediation applied in this study: none — baseline scan and generated fix plan only

What this case study demonstrates

Mastra is one of the largest pnpm monorepos in the CVE Lite CLI example set — 4,555 resolved packages across core SDK packages, deployer tooling, playground UI, client SDKs, docs apps, and integration examples. It exceeds the Vercel AI SDK snapshot (3,570) and Gatsby Yarn Classic snapshot (3,568) in raw graph size.

The direct/transitive split (4 direct, 60 transitive) highlights where maintainers can act from the root toolchain versus where risk lives in auth, observability, and agent-runtime dependencies:

@clerk/[email protected] — critical, transitive. Fast-password-hash advisories in Clerk auth paths used by playground and deployer flows — not a root package.json dependency.

[email protected] — critical, transitive. Remote code execution class advisories in git automation tooling pulled into the monorepo graph.

[email protected] — critical, transitive. Telemetry and gRPC-style serialization paths — CVE Lite also reports additional protobufjs versions at high severity separately.

The four direct findings are all toolchain-leverage points:

pnpm add --filter ./client-sdks/react --filter ./packages/playground --filter ./packages/playground-ui [email protected]

CVE Lite validates [email protected] (covering both direct versions 0.1.12 and 8.3.0), [email protected], and filtered [email protected] upgrades across playground workspaces.


Comparison Note: CVE Lite CLI vs pnpm audit

Both tools were run against the same pnpm-lock.yaml on the same machine on 2026-05-29.

Metricpnpm audit (11.3.0)CVE Lite CLI v1.18.1
Packages audited / parsed4,5554,555
Total reported findings11664
Critical43
High5530
Moderate / Medium5125
Low66
Direct vs transitive breakdown✓ (4 / 60)
Deduplicated package view
Validated fix targetspartial
Copy-and-run command groups✓ (2 groups)
Skipped findings with reason✓ (60 entries)

Why the totals differ: pnpm audit counts 116 vulnerability entries (advisory × path rows). CVE Lite counts 64 unique vulnerable package versions once each. Example: four minimatch majors each appear as separate unique packages in CVE Lite; pnpm audit may emit multiple rows per advisory path.

Critical severity: pnpm audit reports 4 critical entries; CVE Lite reports 3 critical unique packages (@clerk/shared, [email protected], simple-git). Both flag the same underlying critical packages — CVE Lite deduplicates [email protected] and 8.0.1 as separate high findings rather than folding them into the critical row.

Fix guidance:

pnpm audit lists advisories without workspace-filtered remediation. CVE Lite generates 2 command groups covering 3 findings on first pass, including filtered pnpm add for Vite across playground packages — a pattern highly relevant to AI framework monorepos where dev-server risk sits in UI workspaces, not the published npm tarball alone.


Before vs After

No remediation pass was performed for this study. This table records the verified baseline scan only.

StageFindingsCriticalHighMediumLowDirectTransitiveCommand groups
Baseline (verified)643302564602

Fix Journey

No commands were run for this study.

The instinct on 3 critical findings is to pnpm add at the repo root. CVE Lite shows why that fails: @clerk/shared, simple-git, and critical protobufjs are transitive — they require parent-package or upstream workspace decisions.

For path-to-regexp, two direct versions (0.1.12 and 8.3.0) collapse into one validated command targeting 8.4.0.

For [email protected], the fix is explicitly filtered to ./client-sdks/react, ./packages/playground, and ./packages/playground-ui — the correct mental model for monorepo maintainers.


Why this matters

Mastra sits at the intersection of AI agent frameworks and large pnpm monorepos — the exact graph shape teams struggle to triage: Clerk auth, OpenTelemetry, LangSmith, ai SDK versions, playground Vite servers, and Turbo build tooling all in one lockfile.

CVE Lite's value is deduplication and actionable grouping at 4,555-package scale: 64 unique findings, 4 direct levers, 2 command groups, and 60 skipped findings with reasons — versus 116 pnpm audit rows without remediation structure.


Scan command

Run from the Mastra repository root or from the examples/mastra directory in this repository:

cve-lite . --verbose --all

The example lockfile reflects Mastra at revision e9d54b281667477dd97b9dfc166b338f6d097fe8. OSV advisory data changes over time — re-scanning may show different counts on the same revision.


Scan verification

Every number in this case study comes from a live scan of the committed fixture at examples/mastra/ in the CVE Lite CLI repository.

FieldValue
Scan date2026-05-29
CLI versionv1.18.1
CVE Lite commandnode dist/index.js examples/mastra --verbose --all --json
pnpm audit commandpnpm audit / pnpm audit --json (pnpm 11.3.0, Node.js 24)
Advisory sourceOSV (https://api.osv.dev) — online mode
Lockfile sourceexamples/mastra/pnpm-lock.yaml from mastra-ai/mastra@e9d54b2
Packages parsed (CVE Lite)4,555
Unique vulnerable packages (CVE Lite)64
Vulnerability entries (pnpm audit)116
Fix command groups (CVE Lite)2
First-pass covered findings (CVE Lite)3
Skipped findings with reason (CVE Lite)60

Reproduce CVE Lite locally from the repository root:

npm install
npm run build
node dist/index.js examples/mastra --verbose --all

Reproduce pnpm audit from the example directory (Node.js 22+ recommended for pnpm 11):

cd examples/mastra
pnpm audit
pnpm audit --json

Both tools were run against the same pnpm-lock.yaml on the same machine on 2026-05-29.


Remaining risk

All 64 baseline findings remain open at the time of this study. No remediation was applied.

Only 3 findings have first-pass copy-and-run commands. The other 60 are skipped with explicit reasons in the scan output.


Baseline findings

Full vulnerable package list from the verified scan on 2026-05-29 (revision e9d54b2):

PackageVersionSeverityRelationshipFix hintAdvisory IDs
@clerk/shared3.28.2criticaltransitive3.47.5CVE-2026-41248, CVE-2026-42349
protobufjs7.5.4criticaltransitive7.5.8CVE-2026-44294, CVE-2026-44293…
simple-git3.28.0criticaltransitive3.36.0CVE-2026-6951, CVE-2026-28291…
@babel/plugin-transform-modules-systemjs7.28.5hightransitive7.29.4CVE-2026-44728
@opentelemetry/auto-instrumentations-node0.56.1hightransitive0.75.0CVE-2026-44902
@opentelemetry/exporter-prometheus0.207.0hightransitive0.217.0CVE-2026-44902
@opentelemetry/exporter-prometheus0.208.0hightransitive0.217.0CVE-2026-44902
@opentelemetry/exporter-prometheus0.57.2hightransitive0.217.0CVE-2026-44902
@opentelemetry/sdk-node0.207.0hightransitive0.217.0CVE-2026-44902
@opentelemetry/sdk-node0.208.0hightransitive0.217.0CVE-2026-44902
@opentelemetry/sdk-node0.57.2hightransitive0.217.0CVE-2026-44902
axios1.13.5hightransitive1.16.0CVE-2026-44494, CVE-2026-44495…
defu6.1.4hightransitive6.1.5CVE-2026-35209
fast-uri3.1.0hightransitive3.1.2CVE-2026-6321, CVE-2026-6322
js-cookie3.0.5hightransitive3.0.7CVE-2026-46625
kysely0.28.8hightransitive0.28.17CVE-2026-33468, CVE-2026-44635…
langsmith0.5.26hightransitive0.6.0CVE-2026-45134
lodash-es4.17.21hightransitive4.18.0CVE-2026-2950, CVE-2026-4800…
minimatch10.2.1hightransitive10.2.3CVE-2026-27904, CVE-2026-27903
minimatch5.1.7hightransitive5.1.8CVE-2026-27904, CVE-2026-27903
minimatch7.4.6hightransitive7.4.8CVE-2026-27904, CVE-2026-26996…
minimatch9.0.5hightransitive9.0.7CVE-2026-27904, CVE-2026-26996…
multer2.0.2hightransitive2.1.1CVE-2026-3520, CVE-2026-2359…
path-to-regexp0.1.12highdirect0.1.13CVE-2026-4867
path-to-regexp8.3.0highdirect8.4.0CVE-2026-4923, CVE-2026-4926
picomatch2.3.1hightransitive2.3.2CVE-2026-33672, CVE-2026-33671
picomatch4.0.3hightransitive4.0.4CVE-2026-33672, CVE-2026-33671
protobufjs7.5.5hightransitive7.5.8CVE-2026-44294, CVE-2026-44293…
protobufjs8.0.1hightransitive8.2.0CVE-2026-44294, CVE-2026-44293…
svgo3.3.2hightransitive3.3.3CVE-2026-29074
tmp0.2.5hightransitive0.2.6CVE-2026-44705
undici6.22.0hightransitive6.24.0CVE-2026-1525, CVE-2026-1527…
vite7.3.1highdirect7.3.2CVE-2026-39365, CVE-2026-39363…
@fastify/static9.0.0mediumtransitive9.1.1CVE-2026-6410, CVE-2026-6414
@protobufjs/utf81.1.0mediumtransitive1.1.1CVE-2026-44288
@workos/authkit-session0.3.4mediumtransitive0.5.1CVE-2026-42565
ajv8.17.1mediumtransitive8.18.0CVE-2025-69873
better-auth1.4.18mediumtransitive1.6.2
brace-expansion1.1.12mediumtransitive1.1.13CVE-2026-33750
brace-expansion2.0.2mediumtransitive2.0.3CVE-2026-33750
brace-expansion5.0.4mediumtransitive5.0.6CVE-2026-33750, CVE-2026-45149
file-type20.4.1mediumtransitive21.3.2CVE-2026-31808, CVE-2026-32630
follow-redirects1.15.11mediumtransitive1.16.0
ip-address10.1.0mediumtransitive10.1.1CVE-2026-42338
mdast-util-to-hast13.2.0mediumtransitive13.2.1CVE-2025-66400
postcss8.5.8mediumtransitive8.5.10CVE-2026-41305
protobufjs7.5.7mediumtransitive7.5.8CVE-2026-45740
qs6.14.1mediumtransitive6.15.2CVE-2026-8723, CVE-2026-2391
turbo2.9.12mediumdirect2.9.14CVE-2026-45772, CVE-2026-45773
uuid10.0.0mediumtransitive11.1.1CVE-2026-41907
uuid11.1.0mediumtransitive11.1.1CVE-2026-41907
uuid13.0.0mediumtransitive13.0.1CVE-2026-41907
uuid8.3.2mediumtransitive11.1.1CVE-2026-41907
uuid9.0.1mediumtransitive11.1.1CVE-2026-41907
webpack-dev-server5.2.3mediumtransitive5.2.4CVE-2026-6402
ws8.18.0mediumtransitive8.20.1CVE-2026-45736
ws8.20.0mediumtransitive8.20.1CVE-2026-45736
yaml2.8.1mediumtransitive2.8.3CVE-2026-33532
@ai-sdk/provider-utils2.1.10lowtransitive4.0.0CVE-2026-8769
@ai-sdk/provider-utils2.2.8lowtransitive4.0.0CVE-2026-8769
@ai-sdk/provider-utils3.0.20lowtransitive4.0.0CVE-2026-8769
@ai-sdk/provider-utils3.0.25lowtransitive4.0.0CVE-2026-8769
@wong2/mcp-cli1.13.0lowtransitive2.0.0CVE-2025-9262
ai4.3.19lowtransitive5.0.52CVE-2025-48985

Want your project reviewed?

If you maintain an interesting JavaScript or TypeScript project and want CVE Lite CLI considered for a public case study, open an issue in the CVE Lite CLI repository.

Please include:

  • the repository link
  • why the project would make a useful case study
  • whether the dependency graph is publicly reproducible

Not every project will be selected. Preference will go to projects that are publicly useful, technically interesting, and strong examples of realistic dependency remediation workflows.