Summary
A missing-authorization flaw in SiYuan's development-branch database search endpoint may let anonymous readers query database row content associated with a published page. The issue becomes risky when an attacker knows a database identifier and supplies a search keyword, because publication and encrypted-notebook access controls are not applied by the endpoint.
Affected context
The vulnerability is present in a development-branch endpoint introduced by commit 9b8e8956f, specifically /api/av/getAttributeViewSearchTarget. The route performs authentication checking but lacks additional authorization gates such as read-only restrictions, publish-access filtering, and encrypted-notebook checks. No released stable version is affected according to the supplied information.
Exploit preconditions
- Attack surface: HTTP API endpoint exposed by the SiYuan development branch
- Required access: Potentially none beyond anonymous reader access to the relevant published content
- Required information: A database identifier obtained from a published page and a search keyword
- Trigger point: A request to
/api/av/getAttributeViewSearchTarget - Why exploitation is possible: The endpoint checks authentication status but does not enforce the authorization and publication filters that would otherwise restrict returned rows
Why this happens
The underlying bug is an authorization enforcement gap. The route applies a general authentication check but omits object- and operation-level authorization controls, including publication-access and encrypted-notebook gating. This behavior maps to CWE-862: Missing Authorization, because authenticated or unauthenticated request handling can proceed without verifying whether the caller is permitted to access the requested database rows.
Potential impact
- Anonymous users may retrieve database row content that publication filters would otherwise withhold
- Sensitive information from unpublished or restricted rows could be disclosed
- The endpoint could enable systematic enumeration of searchable database content
- Privacy, confidentiality, and trust in published pages may be reduced
General mitigation guidance
Mitigation generally focuses on enforcing authorization consistently at every data-returning API boundary.
Defensive patterns include:
- Applying publish-access, read-only, and encrypted-notebook checks before querying or returning rows
- Reusing centralized authorization middleware or policy functions rather than relying only on authentication checks
- Deriving permitted records from the caller's effective publication scope
- Returning only fields and rows explicitly authorized for the requesting context
- Treating identifiers obtained from published pages as references, not proof of access
- Running the service with least privilege and limiting exposure of development endpoints
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and route audits that identify endpoints protected by authentication without resource-level authorization
- Code review signals such as database queries executed before publication or notebook-access policy checks
- Tests using anonymous, authenticated, read-only, published, and encrypted-notebook contexts
- API policy enforcement requiring authorization decisions before sensitive records are returned
- Monitoring for repeated database-search requests using varied identifiers and keywords
- Automated security review tools that flag missing authorization middleware or inconsistent policy coverage

