Is shadcn-ui/ui safe?
- Node.js shell/command execution
- npm install-time lifecycle hook
- MCP server launches a host command
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
shadcn-ui/ui is an npm package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators. It can: filesystem read, filesystem write, install time execution, 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).
ui 0.0.1
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of shadcn-ui/ui'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 (7)
package.json runs scripts automatically when the package is installed.
"postinstall": "fumadocs-mdx"
Why it matters: Install scripts are a favorite supply-chain foothold — they execute on every machine that installs the package.
Fix: Inspect the hook command. Install-time scripts are a common supply chain execution vector; ensure they do nothing beyond a documented build step.
An MCP server entry launches a command on your host.
"command": "npx",
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 { execFileSync } from "node:child_process"import { execSync } from "child_process"execSync("npx changeset version", { stdio: "inherit" })execSync("pnpm install --lockfile-only", { stdio: "inherit" })import { execFileSync } from "node:child_process"import { execFileSync } from "node:child_process"import { exec } from "child_process"exec("git rev-parse --short HEAD", (err, stdout) => {import { spawn, type ChildProcess } from "node:child_process"const child: ChildProcess = spawn(
import { execa } from "execa"import { execa } from "execa"import { execa } from "execa"import { execFileSync } from "node:child_process"import { execa } from "execa"import { execa } from "execa"import { execa } 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.
The component reads files from disk.
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath))
const content = fs.readFileSync(filePath, "utf-8")
let source = fs.readFileSync(src, "utf8")
return fs.readFile(absolutePath, "utf-8")
let code = await fs.readFile(file.path, "utf-8")
const raw = fs.readFileSync(path.join(process.cwd(), src), "utf8")
const content = fs.readFileSync(file, "utf-8")
fs.readFileSync(filepath, "utf-8") === content
const legacy: IconMapping = JSON.parse(fs.readFileSync(legacyPath, "utf-8"))
fs.readFileSync(outputPath, "utf-8") === content
const content = await fs.readFile(pnpmWorkspacePath, "utf8")
const appConfigContents = await fs.readFile(
const contents = await fs.readFile(path.resolve(cwd, file), "utf8")
const contents = await fs.readFile(filePath, "utf8")
const content = await fs.readFile(resolvedPath, "utf8")
return await fs.readFile(sourcePath, "utf-8")
return await fs.readFile(registryFile, "utf-8")
const content = await fs.readFile(resolvedFilePath, "utf-8")
content = await fs.readFile(registryFile, "utf-8")
await fs.readFile(sourcePath, "utf-8")
const raw = await fs.readFile(cssFilepath, "utf8")
let output = await fs.readFile(cssFilepath, "utf8")
const existingContent = await fs.readFile(envFilePath, "utf-8")
const existingFileContent = await fs.readFile(filePath, "utf-8")
const existingFileContent = await fs.readFile(filePath, "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.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, "\t") + "\n")
fs.writeFile(
fs.writeFile(path.join(temporaryDirectory, "app/globals.css"), ""),
fs.writeFile(
fs.writeFile(
await fs.rm(temporaryDirectory, { recursive: true, force: true })fs.writeFileSync(filepath, content)
fs.writeFileSync(outputPath, content)
await fs.writeFile(cssFilepath, output, "utf8")
await fs.writeFile(cssFilepath, output, "utf8")
await fs.writeFile(envFilePath, mergedContent, "utf-8")
await fs.writeFile(envFilePath, newEnvContent + "\n", "utf-8")
await fs.writeFile(filePath, mergedContent, "utf-8")
await fs.writeFile(filePath, content, "utf-8")
await fs.writeFile(resolvedPath, rewrittenContent, "utf-8")
await fs.writeFile(layoutPath, updatedContent, "utf-8")
await fs.writeFile(config.resolvedPaths.tailwindConfig, output, "utf8")
fs.writeFileSync(snapshotPath, `${JSON.stringify(result, null, 2)}\n`)await fs.writeFile(
await fs.writeFile(
await fs.writeFile(cssFilepath, cssContent, "utf8")
await fs.writeFile(targetPath, `${JSON.stringify(config, null, 2)}\n`, "utf8")await fs.writeFile(
await fs.writeFile(outputPath, JSON.stringify(result.data, null, 2))
await fs.writeFile(file, result.content)
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 response = await fetch(
fetch("/typeset.css")const data = await fetch("https://api.github.com/repos/shadcn-ui/ui", {const response = await fetch(url, { signal: AbortSignal.timeout(5000) })return await fetch(url, {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": {const health = writer.tool("getDeploymentHealth", {"name": "@tool-ui",
const transport = new StdioServerTransport()
export const server = new Server(
server.setRequestHandler(ListToolsRequestSchema, async () => {server.setRequestHandler(CallToolRequestSchema, async (request) =>
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 shadcn-ui/ui.
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 →