# GHSA-4r66-7rcv-x46x: SiYuan vulnerable to RCE via zip slip and Command Injection via PandocBin

> Authenticated attackers can achieve remote code execution by exploiting a Zip Slip vulnerability to overwrite executables and trigger them via Pandoc settings.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 9 Dec 2025
- **Also known as:** GO-2025-4219

## What is GHSA-4r66-7rcv-x46x?

GHSA-4r66-7rcv-x46x is a path traversal vulnerability in github.com/siyuan-note/siyuan/kernel, published on 9 Dec 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### 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:
```bash
#!/bin/sh
echo 'you have been pwned' > /siyuan/workspace/data/pwned.txt
echo "pandoc 3.1.0"
```
3. Upload zip to workspace via `/api/file/putFile`
4. Extract zip via `/api/archive/unzip`, overwrites the existing executable `startup.sh` while maintaining the +x permission
5. 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

## Which versions are affected by GHSA-4r66-7rcv-x46x?

3 open source packages ship an affected version, including github.com/siyuan-note/siyuan/kernel.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/siyuan-note/siyuan/kernel` | Go | All versions | None |
| `github.com/siyuan-note/siyuan/kernel` | Go | All versions to 0.0.0-20251202123337-6ef83b42c7ce | None |
| `github.com/siyuan-note/siyuan/kernel` | Go | All versions to 0.0.0-20251202123337-6ef83b42c7ce | None |

## How do I fix GHSA-4r66-7rcv-x46x?

No fix has been published for GHSA-4r66-7rcv-x46x yet. Limit exposure of the affected software until one is available.

## Is GHSA-4r66-7rcv-x46x being exploited?

There is no known exploitation of GHSA-4r66-7rcv-x46x in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-4r66-7rcv-x46x and fix it if it is affected.

What it is: GHSA-4r66-7rcv-x46x is a path traversal vulnerability in github.com/siyuan-note/siyuan/kernel, published on 9 Dec 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-4r66-7rcv-x46x in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/siyuan-note/siyuan/kernel (Go): affected all versions; no fix listed
- github.com/siyuan-note/siyuan/kernel (Go): affected all versions up to 0.0.0-20251202123337-6ef83b42c7ce; no fix listed
- github.com/siyuan-note/siyuan/kernel (Go): affected all versions up to 0.0.0-20251202123337-6ef83b42c7ce; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-4r66-7rcv-x46x/ (Markdown: https://insights.sbomify.com/GHSA-4r66-7rcv-x46x/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-4r66-7rcv-x46x

---
From sbomify Insights: https://insights.sbomify.com/GHSA-4r66-7rcv-x46x/
Summaries are generated and may contain mistakes; the official description above is the record.
