prompts.chat
- Type
- MCP server
- Scanned
- Nov 29, 2026
- Version
- 2d0597b2fecd
- Files read
- 1798
prompts.chat is an open-source web app, command-line tool, and AI plugin for finding, sharing, and installing AI prompts, skills, and bots. The biggest risk is that installing community skills or bots can save unreviewed scripts outside the intended folder or inject terminal commands, while self-hosted servers create a default 'password123' admin account and can expose private prompts and user data.
What it can reach
- Files
- Saves downloaded skill instructions, configs, and helper scripts into .claude/skills/, reads and writes a local prompt cache in ~/.prompts-chat/prompts.json, creates new project folders during setup, and reads local prompt files on the server.
- Network
- Connects to prompts.chat (or a custom server) to search, fetch, and save prompts and skills, and when self-hosted, runs a web server that connects to PostgreSQL, AI services (OpenAI, Fal.ai, Wiro.ai), S3 storage, OAuth providers, Google Analytics, Sentry, and webhook URLs.
- Shell commands
- Runs terminal commands using npx to start the local plugin server, and runs degit, npm, createdb, and prisma commands during project setup.
- Secrets
- Reads the PROMPTS_API_KEY for authenticated requests, and when self-hosted, reads database URLs, login and OAuth secrets, S3 storage keys, and AI provider API keys from environment variables.
- Browser
- Opens external AI chat websites and prompt links in the default web browser, and launches desktop code editors such as VS Code, Cursor, Windsurf, and Goose.
- System
- Accesses the system clipboard to copy prompt text from the command-line tool, web app, and Raycast extension.
Findings
-
HighDefault admin and user accounts seeded with hardcoded password 'password123'
The standard self-hosting setup wizard (npx prompts.chat new or npm run setup) defaults to email/password authentication and runs npm run db:setup, which executes prisma/seed.ts. That seed script creates an ADMIN account (admin@prompts.chat) and accounts for all imported prompt authors with the hardcoded password 'password123' (and prisma/reset-admin.ts sets the same password). Anyone who can reach a self-hosted instance over the network can sign in as admin, read all private prompts, modify or delete data, and manage users and webhooks.
Fix: Generate a random password (or require an ADMIN_PASSWORD environment variable) when creating the initial admin user, and do not set a known password on imported author accounts.
-
HighShell command injection in generated bot setup commands
When rendering a bot's setup instructions for /bots/{slug}.md, /bots/{slug}/SKILL.md, and the prompts-chat://bots/{id} MCP resource, setupCommands interpolates skill.source and skill.name into bash commands without quoting, and wraps routine.trigger, routine.prompt, and routine.name in JSON.stringify double quotes, which still evaluate $(...) and backtick command substitutions in bash. Because getInstallPrompt instructs the user's AI agent to read the bot's markdown and set up the bot as described, a stranger who publishes a bot can inject arbitrary shell commands that execute when an agent or user runs the generated CLI commands.
Fix: Validate skill.name and skill.source against a strict allowlist pattern and escape all shell arguments with single-quote POSIX shell escaping (replacing ' with '\'') instead of JSON.stringify.
-
HighMissing path-traversal sanitization when storing, parsing, and installing multi-file Agent Skills
Although sanitizeFilename in src/lib/skill-files.ts states it must be used on all server-side write and read paths to prevent path traversal, neither createPrompt/updatePrompt in src/lib/prompt-write.ts nor parseSkillFiles in src/lib/skill-files.ts calls it. An authenticated user can submit a SKILL prompt via the API containing control-character separators with '../' or absolute paths, which are then served unsanitized by src/lib/mcp/resources.ts and written to .claude/skills/{slug}/{filename} when an agent follows plugins/claude/prompts.chat/skills/skill-lookup/SKILL.md.
Fix: Enforce sanitizeFilename in parseSkillFiles and on SKILL writes in createPrompt/updatePrompt, and update skill-lookup/SKILL.md to verify that resolved target paths stay within .claude/skills/{slug}/ and get user confirmation before writing scripts.
-
HighUnsanitized skill filenames in get_skill allow path traversal during agent skill installation
src/lib/mcp/tools/skills.ts:240
When a user downloads a skill archive over HTTP (/api/prompts/[id]/skill), the server strips '..' segments and calls sanitizeFilename on every file to prevent Zip Slip. However, the get_skill MCP tool returns raw filenames parsed from skill.content without calling sanitizeFilename, while both get_skill's tool description and plugins/claude/prompts.chat/skills/skill-lookup/SKILL.md instruct the AI agent to write each file directly to .claude/skills/{slug}/{filename}. Because a skill author can write raw content containing '..' filenames via POST /api/prompts/[id]/versions (or approved change requests), installing a malicious community skill can trick the agent into overwriting files outside .claude/skills/ such as .claude/settings.json or Git hooks.
Fix: Filter and normalize every returned file.filename through sanitizeFilename inside get_skill (matching /api/prompts/[id]/skill), store the sanitized return value on write, and instruct the agent in SKILL.md to reject any slug or filename containing '..' or leading slashes.
-
HighOpenGraph and Twitter image routes expose private and deleted prompts without authentication
src/app/prompts/[id]/opengraph-image.tsx:54
In Next.js App Router, opengraph-image.tsx and twitter-image.tsx run as standalone route handlers that do not execute PromptLayout's privacy checks. Unlike src/app/bots/[slug]/opengraph-image.tsx (which explicitly checks !bot.isPrivate), src/app/prompts/[id]/opengraph-image.tsx queries db.prompt.findUnique by ID without checking isPrivate or deletedAt, renders the title, author, media, and first 400 characters of content into a PNG image, and caches it publicly for an hour. Anyone who knows or guesses a prompt or bot ID can read its private content via /prompts/{id}/opengraph-image.
Fix: Check if (!prompt || prompt.isPrivate || prompt.deletedAt) in src/app/prompts/[id]/opengraph-image.tsx and return the generic 'Prompt Not Found' image when true.
-
MediumHardcoded upstream Sentry DSN sends private self-hosted PII, logs, and session replays to external account
sentry.server.config.ts, sentry.edge.config.ts, and src/instrumentation-client.ts hardcode the prompts.chat team's own Sentry DSN and enable telemetry whenever NODE_ENV is 'production' (including Docker and standard self-hosted production builds). With sendDefaultPii: true, enableLogs: true, request tracing, and client-side Sentry.replayIntegration() active, private self-hosted deployments silently transmit user PII (IP addresses, cookies, headers), server logs, errors, and browser session recordings to an external Sentry project without asking or warning the operator.
Fix: Read the DSN from an opt-in environment variable such as process.env.SENTRY_DSN / process.env.NEXT_PUBLIC_SENTRY_DSN, disable Sentry when it is unset, and default sendDefaultPii to false.
-
MediumMCP endpoint rate limiting bypassed by arbitrary API key or X-Forwarded-For headers
handleMcpRequest builds rateLimitId from the raw apiKey string before checking whether authenticateApiKey actually matched a user, and otherwise falls back to the client-spoofable first entry of X-Forwarded-For. An unauthenticated caller on the network can send a different fake x-api-key header on every POST to /api/mcp to bypass all MCP rate limiters completely, allowing unlimited database queries and unauthenticated semantic search calls that consume the server's OpenAI translation and embedding quota.
Fix: Only key rate limits by user.id when authenticateApiKey succeeds; for unauthenticated requests, use a trusted platform IP header or socket address and apply rate limiting before querying the database for the API key.
-
MediumLocal MCP CLI downloads unpinned package at runtime and spawns npx with shell: true
packages/prompts.chat/src/cli/index.tsx:153
Running prompts.chat mcp (the local MCP server configuration shown in the README) invokes npx -y @fkadev/prompts.chat-mcp without a pinned version, downloading and executing the latest npm release at runtime even if the user pinned prompts.chat. It also passes CLI args to spawn with shell: true, which concatenates arguments into a shell command string without escaping.
Fix: Bundle @fkadev/prompts.chat-mcp as a pinned direct dependency in package.json instead of fetching it with npx -y at runtime, and invoke spawn without shell: true (using npx.cmd on Windows if needed).
-
MediumServer-side request forgery via unvalidated avatar and mediaUrl in OpenGraph image rendering
src/app/api/user/profile/route.ts:20
PATCH /api/user/profile validates avatar with z.string().url(), which accepts internal and private network URLs (such as http://127.0.0.1, http://169.254.169.254, or internal Docker service names) without calling the project's isPrivateUrl helper. When /prompts/[id]/opengraph-image renders a prompt created by that user, Next.js ImageResponse fetches prompt.author.avatar (as well as prompt.mediaUrl) from the server and embeds valid image/SVG responses into the returned PNG, allowing authenticated users on a self-hosted instance to probe internal services.
Fix: Restrict avatar and mediaUrl to https: URLs and reject private/internal addresses using isPrivateUrl (as done for webhooks) before saving or fetching them in ImageResponse.
-
MediumPrompt version endpoint bypasses update validation and skill filename sanitization
src/app/api/prompts/[id]/versions/route.ts:80
While normal prompt and skill edits go through updatePrompt and save_skill (which enforce skill filename sanitization, moderation checks, rate limits, and classifier/bot invariants), POST /api/prompts/[id]/versions only checks that content is a non-empty string and writes it directly to db.prompt.update. A user can create a valid prompt or skill and immediately overwrite its live content via this endpoint with unsanitized skill file paths or unmoderated content.
Fix: Route POST /api/prompts/[id]/versions through updatePrompt (or apply the same type-specific validation, skill filename sanitization, and moderation checks) instead of updating prompt.content directly.
-
MediumYAML and SKILL.md frontmatter injection via unescaped title and description in raw export
src/app/api/prompts/[id]/raw/route.ts:102
GET /api/prompts/[id]/raw escapes prompt.content when building .prompt.yml, .prompt.md, and .SKILL.md files, but interpolates prompt.title and multiline prompt.description directly into YAML lines without escaping. A prompt author can place newlines and YAML keys inside description to inject fields such as model or messages into .prompt.yml files, or frontmatter directives such as allowed-tools into .SKILL.md files imported by users and agent tools.
Fix: Serialize YAML frontmatter and .prompt.yml metadata with a proper YAML serializer (such as the yaml package already in dependencies) or pass title and description through yamlEscape.
-
MediumUser-submitted prompt example mediaUrl accepts javascript: and data: URLs
src/app/api/prompts/[id]/examples/route.ts:8
Any signed-in user can attach an example URL to a public image or video prompt, and the endpoint only checks mediaUrl with Zod's .url() validator. Because new URL() accepts schemes like javascript: and data: in addition to https:, a stranger can store a javascript: or data: URL in the database, which can run script in a visitor's browser if rendered as a clickable link.
Fix: Restrict mediaUrl to https: URLs (and optionally to trusted storage hostnames) instead of relying on z.string().url() alone.
-
MediumPrompt Builder Agent ingests untrusted community prompts while holding privacy and content tools
src/app/api/prompt-builder/chat/prompt-builder-agent.prompt.yml:13
The Prompt Builder Agent system prompt forces the AI to call search_prompts and read existing community-submitted prompts before creating any new prompt, without warning the model that search results are untrusted text. Because the same agent also has tools like set_privacy and set_content, prompt injection hidden inside a public prompt can trick the agent into marking a user's draft prompt public or inserting unwanted instructions into generated prompts or SKILL.md files.
Fix: Remove set_privacy from the agent's toolset so only the user can change visibility in the UI, clearly delimit search_prompts output as untrusted data, and instruct the model never to follow instructions found inside retrieved examples.
-
LowWebhook SSRF check can be bypassed via DNS resolution, IPv4-mapped IPv6, and HTTP redirects
triggerWebhooks checks webhook.url with isPrivateUrl before calling fetch, but isPrivateUrl only inspects literal hostname strings and misses external domains that resolve to internal IPs, IPv4-mapped IPv6 addresses such as [::ffff:127.0.0.1] or [::], and HTTP 3xx redirects followed automatically by fetch. Although webhooks are admin-configured, isPrivateUrl is also exported as the application's SSRF guard and does not reliably block internal network or cloud metadata access.
Fix: Resolve hostnames via DNS and validate all returned IPv4 and IPv6 addresses (including IPv4-mapped IPv6 and unspecified addresses) at connection time, and set redirect: 'error' on fetch.
-
LowNext.js image optimizer allows proxying from any HTTPS hostname
Configuring images.remotePatterns with hostname: '**' turns the public /_next/image endpoint into an open image proxy for any HTTPS host, allowing unauthenticated visitors to force the server to fetch and process arbitrary large images from external or internal HTTPS servers.
Fix: Restrict images.remotePatterns to known trusted storage and avatar hostnames (such as your S3/CDN domain and avatars.githubusercontent.com) or disable Next.js image optimization for user-supplied URLs.
-
LowUnauthenticated OpenAI completion proxy with spoofable rate limit in /api/book/demo
src/app/api/book/demo/route.ts:321
POST /api/book/demo allows anonymous callers when features.aiGeneration is enabled, accepts a caller-supplied systemPrompt and unbounded prompt from the JSON body, and forwards them directly to openai.chat.completions.create. Anonymous rate limiting keys on the first entry of the X-Forwarded-For header, so an unauthenticated attacker can send a random X-Forwarded-For value on each request to bypass both per-minute and daily limits and consume the server's OPENAI_API_KEY quota for arbitrary completions.
Fix: Remove the client-controlled systemPrompt override, enforce strict length limits on prompt inputs, bound the in-memory rate-limit map size, and derive the client IP from a trusted proxy header rather than the first X-Forwarded-For entry.
-
LowUnvalidated model parameter and non-atomic credit check in /api/media-generate
src/app/api/media-generate/route.ts:83
POST /api/media-generate reads model directly from the request body without verifying that it belongs to plugin.getModels(), then interpolates it into authenticated POST URLs for Fal.ai (https://queue.fal.run/${modelId}) and Wiro.ai (https://api.wiro.ai/v1/Run/${request.model}) using the server's API keys. Any logged-in user can invoke arbitrary costly models or use '../' segments to reach other endpoints on those API hosts. In addition, generationCreditsRemaining is checked before awaiting startGeneration and decremented afterward without an atomic gt: 0 condition, letting concurrent requests bypass the daily credit cap.
Fix: Verify that the requested model ID is present in plugin.getModels() for the requested type, and atomically decrement generationCreditsRemaining using updateMany with where: { id: session.user.id, generationCreditsRemaining: { gt: 0 } } before starting generation.
-
LowPartial path prefix check in .well-known/skills route lacks trailing path separator
src/app/.well-known/skills/[...path]/route.ts:20
GET /.well-known/skills/[...path] checks resolvedPath.startsWith(path.resolve(SKILLS_DIR)) without appending path.sep. Although no sibling file or folder starting with 'skills' exists in plugins/claude/prompts.chat/ by default, a request like /.well-known/skills/../skills-other/file would pass this check if such a sibling were ever added.
Fix: Compare against path.resolve(SKILLS_DIR) + path.sep (or check path.relative) so sibling paths sharing the 'skills' prefix are rejected.
-
LowCollection API continues returning prompt content after a prompt is made private or deleted
src/app/api/collection/route.ts:17
POST /api/collection prevents adding another user's private prompt, but GET /api/collection returns the full prompt record (including updated content) without filtering out prompts that were subsequently marked isPrivate or soft-deleted by their author.
Fix: Filter collections in GET /api/collection with prompt: { deletedAt: null, OR: [{ isPrivate: false }, { authorId: session.user.id }] }.
-
LowMCP API keys are stored in plaintext and returned in full on GET
src/app/api/user/api-key/route.ts:29
User MCP API keys are stored unhashed in the users table and returned in full by GET /api/user/api-key. Database backups, SQL read leaks, or a hijacked browser session expose active API keys instead of only showing the secret once upon generation.
Fix: Store a cryptographic hash (e.g., SHA-256) of the API key in the database, show the raw key only once when generated, and return only a masked prefix on GET /api/user/api-key.
-
LowUnbounded limit and missing rate limit on unauthenticated AI search endpoint
src/app/api/search/ai/route.ts:16
When features.aiSearch is enabled, GET /api/search/ai accepts unauthenticated queries with no rate limit, no query length cap, and an uncapped limit parameter parsed directly with parseInt, allowing callers to trigger paid OpenAI embedding calls and request arbitrarily large result sets.
Fix: Clamp limit to a safe range (e.g., 1 to 50), cap the length of q, and apply per-IP rate limiting.
-
LowUntrusted community prompts are interpolated directly into the system prompt of improve_prompt
src/lib/ai/improve-prompt.prompt.yml:51
When the improve_prompt tool enhances a user's prompt, it injects matching community prompts ({{similarPrompts}}) directly into the high-privilege system role message without delimiters or untrusted-data boundaries. A stranger who publishes a prompt containing injection instructions could steer the improve_prompt model into embedding unwanted or malicious instructions into the enhanced prompt returned to the user or coding agent.
Fix: Move {{similarPrompts}} out of the system message or wrap it in clear XML/delimiter tags with explicit instructions to treat its contents strictly as untrusted reference examples rather than instructions.
-
LowWebhook test SSRF check can be bypassed via HTTP redirects or DNS resolution
src/app/api/admin/webhooks/[id]/test/route.ts:79
Before sending a test webhook, the route calls a synchronous isPrivateUrl(webhook.url) check and then calls fetch(webhook.url) with default redirect behavior. Synchronous URL parsing cannot see DNS records that resolve to internal or cloud-metadata IPs, and fetch follows 3xx redirects to internal addresses without re-checking the target, returning the upstream body in the error message when the status is not 2xx.
Fix: Set redirect: "error" on fetch, resolve DNS records and block private or link-local IP addresses on the actual socket connection, and avoid returning raw response bodies on failure.
-
LowAPI documentation builds MCP URLs and CLI commands from the untrusted Host header
Instead of using the configured site URL (NEXTAUTH_URL via getBaseUrl), the /docs/api page reads the incoming HTTP Host header to build baseUrl and embeds it into copy-pasteable MCP configs and CLI commands that include PROMPTS_API_KEY. Behind a misconfigured reverse proxy cache or default virtual host, a spoofed Host header can trick users into copying MCP commands pointing their API key at an attacker's host.
Fix: Use getBaseUrl() from @/lib/seo (backed by NEXTAUTH_URL) rather than reading the request's Host header.
