Security

DeepTutor: any-origin CORS opens the admin API to websites

DeepTutor - credentialed CORS for any origin in the default no-auth mode lets any website call admin API routes, including one that starts a host command, and the web_fetch SSRF guard can be bypassed by DNS rebinding (GHSA-22fg-5qwc-4cpg)

PUBLISHED SEVERITY HIGHSTATUS UnpatchedGHSA-22fg-5qwc-4cpg
Unpatched

Unpatched. Reported privately via GitHub Security Advisory on 2026-07-17; the 90-day coordinated-disclosure window passed, and the final 2026-11-03 deadline set in our 2026-10-20 notice expired with no response from the maintainer. Related hardening landed since the report (catalog API keys are now redacted and the old tool execute endpoint was removed), but the core CORS issue remains.

Product
DeepTutor (FastAPI backend) in HKUDS/DeepTutor
Affected versions
DeepTutor through v1.7.1 and main (checked at HEAD f7aed07).
Severity
HIGH
Status
Unpatched
Weaknesses
  • CWE-306Missing Authentication for Critical Functionality
  • CWE-346Origin Validation Error
  • CWE-942Permissive Cross-domain Security Policy with Untrusted Domains
CWE-306, CWE-346 and CWE-942 as filed on GHSA-22fg-5qwc-4cpg.
GitHub advisory
GHSA-22fg-5qwc-4cpg
Private; in triage, not yet published by the maintainer
CVE
Pending (requested via MITRE CNA-LR)
Published
Credit
Finder: Aaron Elijah Mars of Aeon. Tool: Aeon (https://www.aeon.fun).

What operators should do now

No upstream patch is available yet. Anyone running DeepTutor, even only on their own machine, should apply one of these mitigations until an official fix is released.

  1. Turn authentication on (AUTH_ENABLED=true). In that mode the any-origin regex is not used and cross-origin requests are limited to the frontend origins plus any you list in CORS_ORIGIN or CORS_ORIGINS.
  2. If you keep authentication off, apply the small patch from our report: in _build_cors_settings in deeptutor/api/main.py, stop setting allow_origin_regex to https?://.* and limit CORS to the configured frontend origins in every mode. Add remote Docker or LAN frontends through CORS_ORIGINS instead.
  3. Do not browse untrusted sites in the same browser while a no-auth DeepTutor backend is running, and stop the backend when you are not using it.
  4. Review the MCP server registry (Settings, MCP) for stdio servers you did not add, and rotate the provider API keys configured in DeepTutor if you suspect it was reached cross-origin.
  5. For the web_fetch tool, patch deeptutor/tools/web_fetch.py to resolve the host once, check every address, and connect to that checked address, or block private and link-local ranges at the network level for the DeepTutor process.

Impact and reach

Any DeepTutor backend running with authentication off is exposed to every web page its user opens, as far as the browser lets public pages reach the backend's address. A backend reachable over a LAN or a remote Docker host, which is the setup the permissive default exists for, is the easiest case. Because require_admin treats every caller as admin when authentication is off, the page reaches the same admin routes the DeepTutor frontend uses and can read the answers.

Based on code review, that includes POST /api/settings/mcp/test, which connects to the MCP server described in the request body; for a stdio server that means running its command on the host as the DeepTutor user. The rest of the admin settings surface, including the MCP registry and model provider settings, is reachable the same way. The web_fetch rebinding gap lets content that steers the agent make the server fetch internal or metadata addresses. A working exploit is withheld.

How the CORS policy and admin gate combine

_build_cors_settings returns the regex https?://.* whenever authentication is off, and the app installs CORSMiddleware with that regex, allow_credentials=True, and every method and header allowed. CORSMiddleware echoes back any matching Origin, so every website gets a credentialed allow. The admin dependency then accepts every request in no-auth mode:

Disclosure timeline

  1. Vulnerability reported privately via GitHub Security Advisory (GHSA-22fg-5qwc-4cpg).
  2. First follow-up comment posted on the advisory (32 days in triage).
  3. Second follow-up comment posted on the advisory (62 days in triage).
  4. Coordinated-disclosure notice posted on the advisory after the 90-day window passed, setting a deadline of 2026-11-03. The notice acknowledged the related hardening (catalog API key redaction, removal of the old tool execute endpoint).
  5. Coordinated-disclosure deadline expired with no response from the maintainer; sink verified still present at HEAD f7aed07 and in release v1.7.1.
  6. Public advisory published; CVE requested via MITRE CNA-LR.

References

  • Affected repository: HKUDS/DeepTutor
  • GitHub Security Advisory: GHSA-22fg-5qwc-4cpg (private; in triage)