Advisory

GHSA-4r66-7rcv-x46x

Also known as: GO-2025-4219

Summary

SiYuan vulnerable to RCE via zip slip and Command Injection via PandocBin

Details

Summary
Siyuan is vulnerable to RCE. The issue stems from a "Zip Slip" vulnerability during zip file extraction, combined with the ability to overwrite system executables and subsequently trigger their execution.

Steps to reproduce

  1. Authenticate
  2. Create zip slip payload with path traversal entry ../../../../opt/siyuan/startup.sh. startup.sh contains malicious code like:
#!/bin/sh
echo 'you have been pwned' > /siyuan/workspace/data/pwned.txt
echo "pandoc 3.1.0"
  1. Upload zip to workspace via /api/file/putFile
  2. Extract zip via /api/archive/unzip, overwrites the existing executable startup.sh while maintaining the +x permission
  3. Trigger execution by calling /api/setting/setExport with pandocBin=/opt/siyuan/startup.sh. This calls IsValidPandocBin() which executes startup.sh --version that outputs "pandoc 3.1.0" and executes any arbitrary malicious code

Severity

High Basis: The source's own band: HIGH

Dates

Published
2025-12-09 17:18 UTC
Modified
2025-12-15 20:41 UTC

Affected packages and fixes

github.com/siyuan-note/siyuan/kernel

Go · All systems

Affected

  • introduced 0, last affected 0.0.0-20251202123337-6ef83b42c7ce (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences