Summary
SiYuan versions before 3.7.4 expose sensitive configuration values through the /api/system/getConf endpoint to anonymous or publish-reader users. The exposed data may include the session-cookie signing key, operating-system username, and encrypted-notebook key material, enabling cookie forgery and possible administrator impersonation when access-auth codes are not configured.
Affected context
The issue occurs in SiYuan deployments where the system configuration endpoint is reachable by unauthenticated users or users with publish-reader access and sensitive configuration fields are returned without adequate masking. Risk is higher when the deployment does not use access-auth codes, because a disclosed session-signing key may support administrator-level impersonation.
Exploit preconditions
- Attack surface: The
/api/system/getConfHTTP API endpoint - Required access: Anonymous access or publish-reader permissions, depending on deployment configuration
- Trigger point: Requesting system configuration data from the endpoint
- Why exploitation is possible: Sensitive secrets and key material are returned to callers instead of being consistently redacted, allowing exposed authentication-signing material to be reused
Why this happens
The underlying bug is insufficient protection of sensitive information in an API response. Configuration serialization exposes secrets that should be omitted or masked according to the caller's privilege and the field's sensitivity. This maps to CWE-522, where credentials or authentication material are inadequately protected and can be disclosed to an unauthorized party.
Potential impact
- Attackers may forge or tamper with session cookies
- Unauthorized users could impersonate valid accounts
- Deployments without access-auth codes may allow administrator impersonation
- Encrypted-notebook key material could be exposed
- The operating-system username and related deployment details may be disclosed
- Attackers could gain access to protected content or alter application data
General mitigation guidance
Mitigation generally focuses on reducing the amount of sensitive data returned
by configuration APIs and enforcing least privilege.
Common defensive patterns include:
- Excluding session-signing keys, encryption keys, and other secrets from API responses by default
- Applying field-level redaction based on sensitivity and caller privilege
- Requiring strong authentication and authorization for diagnostic or configuration endpoints
- Treating publish-reader access as untrusted for secret disclosure decisions
- Configuring an additional access-auth control where appropriate
- Rotating potentially exposed signing keys and encryption material through established secret-management processes
- Running the application with the minimum required operating-system permissions
How teams detect issues like this
Organizations can assess this issue through:
- API tests that request configuration endpoints using anonymous and low-privilege identities
- Response-schema checks that fail when secret-like fields appear in externally reachable responses
- Static analysis and code review for configuration serializers that return complete internal objects
- Monitoring for unusual access to system-configuration endpoints and anomalous session activity
- Policy enforcement requiring explicit allowlists for fields exposed by administrative APIs
- Automated security review tools that identify credential, key, or token material in API responses

