SiYuan's /export/ file handler was hardened against export disclosure (issue #12213) by adding an
IsSubPath(exportBaseDir, fullPath) check and an IsSensitivePath() check in commit bb481e1. These guards
were added only to the main branch of the handler. The handler begins with a short-circuit branch:
if strings.HasPrefix(c.Request.URL.Path, "/export/temp/") {
c.File(filepath.Join(util.TempDir, c.Request.URL.Path))
return
}
This branch joins the broader util.TempDir with the raw, percent-decoded request path and serves it with
neither IsSubPath nor IsSensitivePath. An authenticated request to
/export/temp/%2e%2e/.../etc/passwd traverses out of TempDir and reads arbitrary files - exactly the
sensitive-file disclosure the patch intended to prevent. Present in the latest master.
bb481e1 (the hardening) through the latest master.model.CheckAuth) - but the patch's stated goal is to deny sensitive-file
export even to authorized callers.kernel/server/serve.go serveExport(): the main branch has IsSubPath + IsSensitivePath; the
/export/temp/ short-circuit branch (above it) has neither and uses util.TempDir as its root.
c.Request.URL.Path is percent-decoded by net/http, so %2e%2e becomes .. and filepath.Join collapses it.
bb481e1 / d68bd5a (GHSA-6865-qjcf-286f): guards on
the main branch + IsSensitivePath extended to *.db/*.log./export path family./export/temp/ short-circuit branch was never covered by the guards (this report).GET /export/<sensitive> (main branch) -> 401/403 (guards work).GET /export/temp/%2e%2e/%2e%2e/.../tmp/<planted-marker> (or /etc/hostname) -> 200 + file content,
demonstrating the unguarded traversal. The PoC reads only a planted marker / /etc/hostname; no credentials.Authenticated arbitrary file read bypassing the sensitive-file protection: /etc/passwd, ~/.ssh/*, SiYuan
*.db workspace data, *.log.
IsSubPath + IsSensitivePath to the /export/temp/ branch (or restrict its root to TempDir/temp with
an IsSubPath check).filepath.Clean the request path and reject ...kernel/server/serve.go serveExport() lines 308-312.| Software | Affected versions |
|---|---|
github.com/siyuan-note/siyuan/kernel
|
< 0.0.0-20260510110132-b763d787d1f2 |
A vulnerability database tells you what is broken. Attack surface management tells you where it is running: it discovers your internet-facing assets and flags the ones affected by issues like this one.
What is attack surface management? →A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.
CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.
A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.
Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.
Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.
SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.