{"id":"CVE-2026-46341","aliases":["CVE-2026-46341","GHSA-jwp7-wg77-3w9v"],"related":[],"kind":"vulnerability","state":"published","title":"Apify MCP server: Domain Allowlist Bypass in fetch-apify-docs via String Prefix Matching","summary":"The Apify MCP server enables AI agents to extract data from websites using ready-made scrapers, crawlers, and automation tools available on the Apify Store. Prior to 0.9.21, the fetch-apify-docs tool in src/tools/common/fetch_apify_docs.ts validates allowlisted documentation domains with String.startsWith() rather than URL hostname comparison, allowing attacker-controlled URLs such as `https://docs.apify.com.evil.com/` and `https://docs.apify.com@evil.com/` to pass the ALLOWED_DOC_DOMAINS check and return arbitrary fetched content to the LLM. This issue is fixed in version 0.9.21.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The Apify MCP server enables AI agents to extract data from websites using ready-made scrapers, crawlers, and automation tools available on the Apify Store. Prior to 0.9.21, the fetch-apify-docs tool in src/tools/common/fetch_apify_docs.ts validates allowlisted documentation domains with String.startsWith() rather than URL hostname comparison, allowing attacker-controlled URLs such as `https://docs.apify.com.evil.com/` and `https://docs.apify.com@evil.com/` to pass the ALLOWED_DOC_DOMAINS check and return arbitrary fetched content to the LLM. This issue is fixed in version 0.9.21.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `fetch-apify-docs` tool validates URLs against a domain allowlist using `String.startsWith()` instead of proper URL hostname comparison. This allows bypass via attacker-controlled subdomains (e.g., `https://docs.apify.com.evil.com/`), enabling the tool to fetch and return arbitrary web content to the LLM.\n\n### Details\n#### Vulnerable component\n\n`src/tools/common/fetch_apify_docs.ts`, line 51:\n\n```typescript\nconst isAllowedDomain = ALLOWED_DOC_DOMAINS.some((domain) => url.startsWith(domain));\n```\n\n`src/const.ts`, lines 167-170:\n\n```typescript\nexport const ALLOWED_DOC_DOMAINS = [\n    'https://docs.apify.com',\n    'https://crawlee.dev',\n] as const;\n```\n\n#### How the bypass works\n\n`String.startsWith('https://docs.apify.com')` matches any string beginning with that prefix, including:\n\n- `https://docs.apify.com.evil.com/payload` - attacker-controlled subdomain\n- `https://docs.apify.com@evil.com/payload` - userinfo component in URL (browser behavior varies, but `fetch()` in Node.js may follow this)\n- `https://docs.apify.com.evil.com:8080/path` - custom port on attacker domain\n\nAll of these pass the `startsWith` check because they begin with the exact string `https://docs.apify.com`.\n\n#### The fetched content is returned to the LLM\n\nAfter the allowlist check passes, the tool fetches the URL and returns the full page content as markdown (`fetch_apify_docs.ts:69-103`):\n\n```typescript\nconst response = await fetch(url);\n// ...\nconst html = await response.text();\nmarkdown = htmlToMarkdown(html);\n// ...\nreturn buildMCPResponse({ texts: [`Fetched content from ${url}:\\n\\n${markdown}`], ... });\n```\n\nThe HTML is converted to markdown and returned verbatim to the LLM. This creates a prompt injection vector - the attacker's page can contain instructions that the LLM may follow.\n\nWhile tools like `get-html-skeleton` have no domain allowlist at all - it accepts any URL. The `fetch-apify-docs` tool was clearly intended to be more restricted (documentation-only), but the `startsWith` check defeats that intent.\n\n### PoC\n```json\n{\n  \"method\": \"tools/call\",\n  \"params\": {\n    \"name\": \"fetch-apify-docs\",\n    \"arguments\": {\n      \"url\": \"https://docs.apify.com.evil.com/prompt-injection-payload\"\n    }\n  }\n}\n```\n\nThe URL passes the `startsWith('https://docs.apify.com')` check, fetches the attacker's page, and returns its content to the LLM.\n### Impact\n- **Prompt injection via fetched content**: Attacker hosts a page at `docs.apify.com.evil.com` containing LLM instructions. When the tool fetches and returns this content, the LLM may follow the injected instructions.\n- **Security boundary violation**: The allowlist was explicitly designed to restrict fetching to trusted documentation domains. The bypass defeats this intent.\n- **SSRF (limited)**: The tool can fetch from attacker-controlled servers, though the primary risk is the content returned to the LLM rather than network access.\n- **Account compromise via _meta.apifyToken**: Injected prompt instructions can direct the LLM to include a specific `_meta.apifyToken` (the server's per-request token feature) in subsequent `call-actor` invocations, redirecting billable operations to a victim's account or accessing their private Actors","format":"markdown","source":"ghsa"},{"lang":"es","text":"El servidor Apify MCP permite a los agentes de IA extraer datos de sitios web utilizando scrapers, crawlers y herramientas de automatización prefabricados disponibles en la Tienda Apify. Antes de la versión 0.9.21, la herramienta fetch-apify-docs en src/tools/common/fetch_apify_docs.ts valida los dominios de documentación en lista blanca con String.startsWith() en lugar de la comparación de nombre de host de URL, permitiendo que URLs controladas por el atacante, como ’https://docs.apify.com.evil.com/’ y ’https://docs.apify.com@evil.com/’, pasen la verificación ALLOWED_DOC_DOMAINS y devuelvan contenido arbitrario obtenido al LLM. Este problema está solucionado en la versión 0.9.21.","source":"nvd"}],"published":"2026-05-19T16:34:34.000Z","modified":"2026-10-24T20:10:00.137Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-20","CWE-183"],"affected":[{"ranges":[{"version":"< 0.9.21","status":"affected"}],"vendor":"apify","product":"apify-mcp-server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.9.21"}],"ecosystem":"npm","package":"@apify/actors-mcp-server","purl":"pkg:npm/%40apify/actors-mcp-server","source":"ghsa"}],"references":[{"url":"https://github.com/apify/apify-mcp-server/security/advisories/GHSA-jwp7-wg77-3w9v","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/apify/apify-mcp-server/pull/781","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/apify/apify-mcp-server/commit/e39bdee530da1db0b3b3d3713558b33c9608e629","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/apify/apify-mcp-server/releases/tag/v0.9.21","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/apify/apify-mcp-server","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-17T14:01:40.675Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46341","url":"https://www.cve.org/CVERecord?id=CVE-2026-46341","licence":"CVE Terms of Use","modified":"2026-07-17T14:01:46.108Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jwp7-wg77-3w9v","url":"https://github.com/advisories/GHSA-jwp7-wg77-3w9v","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:06.238Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46341","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46341","licence":"Public domain","modified":"2026-10-24T20:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:28.416Z","epss":{"score":0.00234,"percentile":0.15383,"date":"2026-12-01T12:00:22.000Z"}}