Summary
SiYuan contains an information disclosure vulnerability that can let authenticated Reader users retrieve credential-named files belonging to certain widgets. If a widget is referenced for publishing and its files contain secrets, a Reader may obtain API keys, tokens, or other stored credentials.
Affected context
The issue affects SiYuan versions before 3.8.9 in the getFile handling of widget files. It arises when the sensitive-path guard can be bypassed for credential-named files under publish-referenced widget paths, allowing an authenticated Reader to request files that should not be exposed.
Exploit preconditions
- Attack surface: File retrieval through SiYuan's
getFilefunctionality - Required access: An authenticated account with the Reader role
- Trigger point: A request for a credential-named file under a publish-referenced widget path, such as
credentials.json - Why exploitation is possible: The sensitive-path guard can be bypassed for these widget files, permitting retrieval of content that may contain secrets
Why this happens
The vulnerability is an information exposure flaw mapped to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor. The file retrieval logic does not consistently prevent access to sensitive, credential-named widget files in the affected context. As a result, a Reader may access data that should be protected by the sensitive-path guard.
Potential impact
- API keys or tokens could be disclosed to an authenticated Reader
- Exposed credentials may enable access to connected services or other systems
- Organizations may face unauthorized data access or follow-on compromise if disclosed secrets remain valid
General mitigation guidance
Defensive patterns include enforcing authorization and sensitive-file restrictions consistently at the file retrieval boundary, rather than relying on path checks that can be bypassed by alternate request forms.
Prefer keeping secrets outside publishable widget directories and reducing the amount of sensitive data stored with widgets. Apply least-privilege access controls to file retrieval and widget publishing, and use secure-by-default rules that deny access to credential and secret files unless explicitly authorized.
How teams detect issues like this
Review file-serving code for path normalization and authorization checks that occur before file access, including checks for credential-named files in widget directories. Static analysis and code review can look for inconsistent sensitive-path guards or routes that resolve files without applying the same policy.
Monitor access logs for Reader requests to credential-named widget files and enforce policies that prevent secrets from being stored in publishable locations. Automated security review tools may help identify inconsistent access-control paths.

