← MCP server and skill grades

cow-skill-hub

zhayujie/cow-skill-hub

C
Type
Repo
Scanned
Nov 17, 2026
Version
7ec4acc86d92
Files read
63

Cow Skill Hub is a web marketplace built with Astro for browsing, uploading, and downloading AI agent skills, deployable on Cloudflare or as a self-hosted Node.js server. Its biggest risks are stored cross-site scripting via javascript: links in skill summaries and a Node self-hosting default that lets unauthenticated network callers immediately publish skills without review.

What it can reach

Network
Runs an HTTP web server for the skill marketplace and makes outbound HTTPS requests to GitHub OAuth, Google OAuth, and GitHub, Google, and Gravatar avatar hosts.
Files
In Node self-hosted mode (DEPLOY_TARGET=node), reads and writes uploaded skill ZIP archives under ./data/skills (or SKILL_STORAGE_DIR) and loads environment variables from .env.
Secrets
Reads JWT_SECRET, GitHub and Google OAuth client IDs and secrets, and MySQL connection credentials from environment variables or Cloudflare runtime bindings.
Other
Reads and writes user accounts, skill metadata, skill file contents, and install logs in Cloudflare D1 or a MySQL database.

Findings

1 high2 medium1 low
  1. HighStored cross-site scripting via Markdown links in skill summaries

    src/components/SkillDetail.astro:21

    Skill submissions sent to POST /api/skills/submit accept user-controlled text in summary (and description) that is rendered on skill detail pages with marked.parse(displaySummary) and injected into the page using set:html. The code overrides only the raw HTML token renderer (html: () => ''), which does not block javascript: or data: URLs inside standard Markdown links such as [Documentation](javascript:...). When a visitor or reviewer clicks such a link in the Overview tab, attacker JavaScript runs in the Skill Hub origin, allowing it to act as a logged-in user or rewrite the displayed CLI install command on the page. In addition, calling marked.use() inside the component frontmatter mutates the global marked singleton on every page request.

    Fix: Sanitize the HTML produced by marked.parse with an allowlist HTML sanitizer such as DOMPurify or sanitize-html that permits only http:, https:, and mailto: URLs, and create a module-scoped Marked instance instead of calling marked.use() on each request.

  2. MediumUnauthenticated skill uploads auto-publish and bypass review in Node self-hosted mode

    src/pages/api/skills/submit.ts:134

    When self-hosting with DEPLOY_TARGET=node (where the standalone Node adapter also listens on 0.0.0.0 by default), allowAnonymousSubmit defaults to true unless ALLOW_ANONYMOUS_SUBMIT=false is explicitly set. In POST /api/skills/submit, unauthenticated requests not only skip login but are assigned status 'published' immediately, whereas logged-in OAuth users are placed into 'pending' for review. Even on a Node deployment with OAuth configured, an attacker can omit cookies to bypass moderation and publish malicious skills straight into the live catalog, and because the endpoint parses raw request text as JSON without checking Origin or Content-Type, any webpage visited by someone who can reach a local or intranet Node instance can submit skills cross-site without a CORS preflight.

    Fix: Default ALLOW_ANONYMOUS_SUBMIT to false on all deployment targets, never grant anonymous uploads a higher publication status ('published') than authenticated uploads ('pending'), and enforce Origin checks and Content-Type: application/json on POST /api/skills/submit.

  3. MediumGoogle OAuth username strips email domain, causing cross-domain account collisions

    src/pages/api/auth/google/callback.ts:13

    During Google login, googleUsernameFromEmail derives username solely from the local part of the email before '@' (and does not check email_verified), while the users table enforces UNIQUE(provider, username). Any two Google accounts sharing the same prefix across different domains (for example, admin@company.com and admin@attacker-domain.com) collide on ('google', 'admin'). On Cloudflare D1, ON CONFLICT(id) does not handle the secondary unique constraint, causing a 500 error that blocks the second user from signing in; on MySQL, sql-dialect.ts rewrites ON CONFLICT(id) DO UPDATE to ON DUPLICATE KEY UPDATE, causing the colliding login to overwrite the existing user's display_name and avatar_url.

    Fix: Require email_verified === true from Google's userinfo response, include the domain or a unique suffix from u.sub when constructing username, and avoid MySQL ON DUPLICATE KEY UPDATE mutating rows matched via a secondary unique index.

  4. LowUnconditional wildcard CORS exposes private or local skill catalogs to any website

    src/pages/api/_utils.ts:8

    All JSON API responses and ZIP package downloads return Access-Control-Allow-Origin: *, even though the project explicitly supports private self-hosted deployments and local development servers. If an instance is run on localhost or an internal corporate network, any external website a user visits in their browser can fetch /api/skills, /api/skills/[name]/files, and /api/skills/[name]/download (where reachable under browser network policies) to read private skill definitions and source code.

    Fix: Make Access-Control-Allow-Origin configurable via an environment variable, defaulting to SITE_URL or disabling cross-origin headers on private self-hosted deployments.