← MCP server and skill grades

docs-mcp-server

arabold/docs-mcp-server

D
Type
MCP server
Scanned
Nov 13, 2026
Version
d2bdb2f8378d
Files read
881

Docs MCP Server collects, indexes, and searches documentation from websites, GitHub repositories, package registries, and local files for AI coding assistants through a local server, web dashboard, and command line. Its biggest risk is that flaws in its safety checks allow untrusted pages or API callers to reach private network services and local files outside the allowed folder, while its default Docker setup exposes the passwordless control API to the local network with browser protections turned off.

What it can reach

Files
Reads local files, folders, and ZIP or TAR archives via file URLs (limited to your Documents folder by default), unpacks temporary archives, and reads and writes its local SQLite database, configuration files, installation ID, and cached helper binaries.
Network
Runs an HTTP and WebSocket server (port 6280 by default) for its web dashboard, API, and MCP; fetches websites, GitHub repositories and releases, npm, and PyPI; connects to configured AI embedding and login providers; downloads missing browser or database binaries; and sends usage telemetry to PostHog by default.
Shell commands
Runs the GitHub CLI (gh auth token) to read local GitHub credentials, runs helper scripts to install missing Chromium or SQLite binaries, and includes agent skill files that instruct AI assistants to run npx commands.
Secrets
Reads AI provider, cloud, and GitHub API keys from environment variables and .env files (including OpenAI, Google, AWS, Azure, and GitHub credentials), retrieves tokens from the GitHub CLI, and sends and stores user-supplied custom HTTP headers such as authorization tokens in its SQLite database.
Browser
Launches and controls a headless Chromium browser via Playwright with JavaScript enabled by default (downloading it on first run if missing) to render web pages, inline frames, and bot challenges.

Findings

2 high7 medium5 low2 info
  1. HighSSRF protection fails open on DNS errors and does not pin resolved IPs against DNS rebinding

    src/utils/accessPolicy.ts:115

    By default the server blocks requests to localhost, private networks, and cloud metadata addresses, but ScraperAccessPolicy resolves DNS separately before the actual HTTP or browser request without pinning the validated IP address. In addition, resolveAddresses catches any DNS lookup error and returns an empty list, which open mode treats as allowed. An attacker's domain that fails the first DNS query (for example with SERVFAIL) or uses a short-TTL DNS rebinding record can pass the policy check and make axios or headless Chromium connect directly to 127.0.0.1, 169.254.169.254, or internal LAN services when a page redirects or loads an iframe.

    Fix: Fail closed when DNS resolution throws or returns no addresses, pass a custom lookup callback to HTTP and HTTPS agents so connections use the exact validated IP address, and resolve or block non-HTTP(S) and unpinned browser requests.

  2. HighDocker HOST=0.0.0.0 default disables browser Origin protection on /api and WebSockets and exposes unauthenticated endpoints

    Dockerfile:81

    The Docker image sets HOST=0.0.0.0 so container port forwarding works, and the server only enforces browser Origin checks on /api and its WebSocket when bound to a loopback address (as confirmed in src/app/AppServer.test.ts and docs/infrastructure/security.md). As a result, when a user runs the Docker container on their machine—even if they bind the host port to 127.0.0.1—any malicious website they visit in their browser can open ws://localhost:6280/api (Host: localhost:6280 passes the host check) and call unauthenticated tRPC queries and mutations over the WebSocket to read indexed private documentation, read stored custom scrape authentication headers, start scrapes, or delete libraries. In addition, the README Quick Start uses -p 6280:6280, publishing the unauthenticated /mcp and /api endpoints to everyone on the same local network.

    Fix: Enforce Origin validation on /api and WebSocket upgrades on all bind addresses (for example, allowing same-origin requests whose Origin matches the Host header alongside localhost and server.allowedOrigins), and change the documented Docker port mapping to -p 127.0.0.1:6280:6280.

  3. MediumBrowser Origin check on the unauthenticated API and WebSocket is disabled when bound to 0.0.0.0

    src/app/AppServer.ts:111

    The tRPC API and WebSocket at /api have no authentication (even when OAuth is enabled for /mcp) and expose every query and mutation, including reading indexed docs, reading cleartext custom HTTP headers via getScraperOptions and getJobs, deleting libraries, and starting scrape jobs. AppServer only checks the browser Origin header on /api when server.host is a loopback address. Because the official Dockerfile sets ENV HOST=0.0.0.0 (and docker-compose publishes 0.0.0.0 ports), shieldsApi becomes false even if a user maps Docker's port only to 127.0.0.1 on the host. Any website the user visits in their browser can then open ws://localhost:6280/api (which passes the Host check) and take full control of the server, and anyone on the local network can reach published 0.0.0.0 ports directly.

    Fix: Enforce originPolicy on /api HTTP requests and WebSocket upgrades regardless of the bind address (originPolicy already permits localhost, server.publicUrl, and server.allowedOrigins), and bind published Docker Compose ports to 127.0.0.1 by default.

  4. MediumUnvalidated ScraperOptions in the tRPC API allow bypassing local file access controls

    src/pipeline/trpc/router.ts:52

    ScraperOptions includes internal-only fields (internalAllowedFileRoots and initialQueue items carrying internalAllowedFileRoots) that ScraperAccessPolicy treats as trusted bypass roots for temporary archives. Because enqueueScrapeJob uses z.custom<ScraperOptions>() (and storeScraperOptions uses z.unknown()), no runtime validation strips these fields. Any caller able to reach /api (such as a remote client on an exposed worker or a browser page via an unshielded WebSocket) can submit a web URL with an initialQueue pointing to file:// paths and internalAllowedFileRoots set to '/' or a hidden folder like ~/.ssh, bypassing fileAccess.mode (even when disabled), allowedRoots, followSymlinks, and includeHidden to index sensitive local files.

    Fix: Replace z.custom<ScraperOptions>() and z.unknown() in the tRPC routers with a strict Zod schema that accepts only user-facing scraper options and rejects internalAllowedFileRoots, initialQueue, and isRefresh.

  5. MediumCustom HTTP headers such as Authorization are sent to third-party subresources and cross-origin redirects

    src/scraper/middleware/HtmlPlaywrightMiddleware.ts:1327

    Users and agents are encouraged to pass authentication tokens and cookies via --header or custom headers in the web UI when indexing private documentation. During default Playwright rendering, mergePlaywrightHeaders checks same-origin only for URL-embedded basic credentials and attaches all customHeaders (including Authorization and Cookie) to every third-party subresource request made by the page, such as external CDN scripts, stylesheets, or widgets. BrowserFetcher and HttpFetcher likewise forward custom headers across cross-origin 3xx redirects without stripping sensitive headers, leaking user tokens to external servers.

    Fix: Restrict sensitive custom headers (or all customHeaders) to requests matching the target origin in HtmlPlaywrightMiddleware and BrowserFetcher, and strip Authorization and Cookie headers when following cross-origin redirects in HttpFetcher and BrowserFetcher.

  6. MediumSymlink combined with parent-directory segments bypasses allowedRoots and followSymlinks restrictions

    src/utils/accessPolicy.ts:402

    When fetch_url or scrape_docs (both available to the AI agent by default) is given a file:// URL, ScraperAccessPolicy checks root containment and symlinks after calling path.resolve(), which lexically collapses '<symlink>/..' segments before touching the filesystem, and then returns the un-normalized filePath to FileFetcher. When fs.readFile opens that un-normalized path, the OS kernel resolves the symlink first and applies '..' relative to the symlink's target directory. If any directory symlink exists inside the allowed Documents folder (such as workspace or repository symlinks), a prompt-injected agent can request file:///.../Documents/<symlink>/../... to read files outside allowedRoots despite followSymlinks being false.

    Fix: Walk and lstat every segment of the decoded path before collapsing '..' segments (or reject '..' segments outright), and return the canonicalized path from resolveFileAccess so FileFetcher never opens an un-normalized path.

  7. MediumHeadless Chromium is launched unconditionally with --no-sandbox when rendering untrusted pages

    src/scraper/fetcher/ManagedBrowser.ts:180

    ManagedBrowser.launch() hardcodes '--no-sandbox' and '--disable-setuid-sandbox' on all platforms, not only inside unprivileged containers. Because ScrapeMode.Auto renders HTML in Chromium with JavaScript enabled by default for both fetch_url and scrape_docs, untrusted web pages are processed inside an unsandboxed browser renderer, removing OS-level sandbox isolation if a malicious page triggers a Chromium renderer vulnerability.

    Fix: Keep Chromium's sandbox enabled by default on host installs and only pass --no-sandbox when explicitly configured for container environments that lack user namespaces.

  8. MediumDocker container binds unauthenticated HTTP and MCP server to 0.0.0.0 by default

    Dockerfile:81

    Dockerfile sets HOST=0.0.0.0 and DOCS_MCP_PROTOCOL=http on port 6280 with no authentication enabled by default, and the README.md quick-start command (-p 6280:6280) publishes that port on all host network interfaces rather than loopback. Anyone on the local network can reach the web UI and /mcp endpoint to read indexed documentation (including private repos or local files), trigger scrape jobs, or remove indexed libraries.

    Fix: Publish the container port on loopback by default in documentation (-p 127.0.0.1:6280:6280) and warn users to enable OAuth2/OIDC authentication before exposing port 6280 on 0.0.0.0 or host networking.

  9. MediumSkills recommend passing auth tokens and cookies via --header, which are forwarded to cross-origin sub-resources

    skills/fetch-url/SKILL.md:93

    Both skills/fetch-url/SKILL.md and skills/docs-manage/SKILL.md advise passing bearer tokens or session cookies with --header while leaving --scrape-mode at its default of auto (headless Chromium). As verified in src/scraper/middleware/HtmlPlaywrightMiddleware.test.ts, URL-embedded basic auth credentials are restricted to the page origin, but custom --header values are attached to every intercepted sub-resource request, leaking credentials to cross-origin CDNs, scripts, or iframes embedded on the page.

    Fix: Restrict sensitive custom headers such as Authorization, Cookie, and Proxy-Authorization to the target page origin during Playwright route handling, and update the skill instructions to warn about cross-origin sub-resources or recommend --scrape-mode fetch when passing credentials.

  10. LowCross-origin iframe HTML is spliced into untrusted pages, bypassing Same-Origin Policy and crawl scope

    src/scraper/middleware/HtmlPlaywrightMiddleware.ts:501

    When rendering a page, HtmlPlaywrightMiddleware reads body.innerHTML from every iframe and frameset via Playwright's privileged frame API and injects that HTML directly into the parent document's live DOM while page scripts are still running, without checking that the frame shares the parent origin or matches the job's crawl scope. If an operator configures scraper.security.network.allowedHosts, allowedCidrs, or allowPrivateNetworks to allow internal documentation hosts, any scraped external webpage can embed an iframe to an internal host and read its rendered HTML via a DOM MutationObserver or expose it in the indexed output.

    Fix: Only inline iframe or frame content when the frame's resolved URL is same-origin with the parent document (or passes the active crawl scope without exposing cross-origin content to parent-page scripts).

  11. LowShell invocation in GitHub CLI token lookup allows working-directory binary hijacking on Windows

    src/scraper/strategies/github-auth.ts:54

    When scraping a GitHub URL without an explicit token or GITHUB_TOKEN/GH_TOKEN environment variable, resolveGitHubAuth runs 'gh auth token' via child_process.exec, which spawns a shell. On Windows, cmd.exe searches the current working directory before PATH, so starting the server inside an untrusted repository containing a malicious gh.cmd or gh.bat file would execute attacker code when any GitHub URL is scraped.

    Fix: Use execFile('gh', ['auth', 'token'], { timeout: 5000 }) instead of exec so no shell is spawned, and set NoDefaultCurrentDirectoryInExePath in the child environment on Windows.

  12. LowBundled agent skills download and run an unpinned @latest npm package at runtime

    skills/docs-manage/SKILL.md:43

    All three bundled agent skills (skills/docs-manage/SKILL.md, skills/docs-search/SKILL.md, and skills/fetch-url/SKILL.md) instruct the coding agent to invoke npx @arabold/docs-mcp-server@latest on every command rather than a pinned version or locally installed binary. Because @latest resolves to whatever version is published on npm when the command runs, a future compromise of the npm package or publishing credentials would automatically execute untrusted code on the user's machine during normal skill use.

    Fix: Pin the package version in each SKILL.md to match the release version (for example, @arabold/docs-mcp-server@3.4.1) or instruct users to install a pinned version once and run docs-mcp-server directly.

  13. LowWindows shell command injection in developer live-auth test helper

    test/clerk-auth-live.ts:260

    The developer-only Clerk live test script opens the OAuth authorization URL on Windows by calling spawn("start", [url], { shell: true }). Because OAuth authorization URLs contain ampersand-separated query parameters derived from discovery metadata and state, cmd.exe interprets unquoted & characters as command separators, breaking the URL and allowing command execution if pointed at an untrusted OAuth issuer. Installed users never run this script.

    Fix: Avoid shell: true on Windows by invoking cmd.exe with execFile/spawn using ["/c", "start", "", url] or opening the URL via rundll32 url.dll,FileProtocolHandler.

  14. LowBundled Agent Skills download and run unpinned @latest package from npm at runtime

    skills/docs-manage/SKILL.md:43

    All three Agent Skills in skills/ (docs-manage, docs-search, and fetch-url) as well as README.md instruct the agent to run npx @arabold/docs-mcp-server@latest. Resolving the mutable @latest tag at runtime means a compromised npm publish would automatically download and execute untrusted code on the user's machine with access to environment secrets and gh CLI tokens without the user choosing to upgrade.

    Fix: Pin the exact package version in each release's skill definitions (for example, @arabold/docs-mcp-server@3.4.1) or instruct users to install a pinned version once and run the local docs-mcp-server binary.

  15. InfoUsage telemetry is enabled by default and sends scraped hostnames and library names to PostHog

    Dockerfile:19

    Release builds embed a PostHog API key and enable telemetry by default without prompting on first run. While document text, full URLs, and search queries are stripped, events sent to PostHog include library names, version labels, and the bare hostnames of scraped or fetched URLs, which can reveal internal corporate hostnames and project names if a user indexes intranet documentation before opting out.

    Fix: Pass --no-telemetry or set DOCS_MCP_TELEMETRY=false when indexing internal hostnames or private libraries, or make telemetry opt-in by default.

  16. InfoUsage telemetry to PostHog is enabled by default

    README.md:15

    The application sends usage telemetry events to PostHog out of the box unless turned off by the user, as documented in README.md and wired via POSTHOG_API_KEY in Dockerfile and posthog-node in package.json.

    Fix: Disable telemetry in the server configuration or environment if you do not want usage events sent externally, or consider making telemetry opt-in by default.