/

CVE-2026-77438

Severity:

HIGH RISK

(7.5)

Broken Access Control (CWE-863) in Trilium Share Search

CVE-2026-77438

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-200, CWE-863

Impact:

Unauthorized Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Trilium's public share-search endpoint may expose titles, hierarchical paths, identifiers, and content from notes protected by per-note sharing controls. An unauthenticated visitor who can access a published ancestor may be able to enumerate protected notes and infer or recover their contents through search responses.

Affected context

The issue occurs in Trilium deployments using the public share-search functionality when a published subtree contains notes with individual share-password or tree-visibility controls. The endpoint authorizes the supplied ancestor note but may not independently enforce each matching note's shareCredentials and shareHiddenFromTree settings before returning search results.

Exploit preconditions

  • Attack surface: Public share-search functionality exposed by a Trilium instance
  • Required access: No authenticated account may be required; access to a published ancestor or share context may be sufficient
  • Trigger point: A full-text search request against a shared note subtree
  • Why exploitation is possible: Authorization is applied to the requested ancestor without consistently rechecking access controls for every matching descendant note

Why this happens

The underlying bug is an authorization boundary failure. The search operation treats authorization for an ancestor note as sufficient for returning results from descendant notes, rather than evaluating each result against its own sharing and visibility settings. This behavior maps primarily to CWE-863: Incorrect Authorization and can produce CWE-200: Exposure of Sensitive Information when protected metadata or content is disclosed.

Potential impact

  • An unauthenticated visitor may enumerate protected note titles and tree paths
  • Search responses could reveal share identifiers or other note metadata
  • Attackers could use content matching as a boolean oracle
  • Protected note contents may be inferred or recovered
  • Confidential project, operational, or personal information could be disclosed

General mitigation guidance

Mitigation generally focuses on enforcing authorization at the individual resource level throughout search and response generation.

Common defensive patterns include:

  • Rechecking each matching note's share-password and visibility controls before including it in results
  • Applying the same authorization policy to search, navigation, previews, and direct content retrieval
  • Returning only fields that the requesting principal is authorized to view
  • Separating public indexes from protected note data and excluding restricted content from public search
  • Reducing information leakage through result counts, paths, identifiers, and content-matching behavior
  • Using least-privilege service permissions and maintaining conservative default visibility settings

How teams detect issues like this

Organizations can assess this class of issue through:

  • Static analysis and code review of search handlers for ancestor-only authorization checks
  • Tests that place protected and hidden notes beneath publicly searchable ancestors
  • Authorization matrix testing across direct access, search, navigation, previews, and exported results
  • Monitoring for repeated content-probing queries and unusual enumeration of share identifiers or paths
  • Policy enforcement requiring per-resource access checks before serialized search results are returned
  • Automated security review tools that flag data access performed outside the resource's authorization boundary

Sources

SourceLink
github.comgithub.com/TriliumNext/Trilium/commit/49fc7b67d9d49f01833e1ad9712ec83b079f98d2
github.comgithub.com/TriliumNext/Trilium/security/advisories/GHSA-6rxv-6w3q-7mv9

Frequently asked

questions

It may be exploitable remotely when public share-search is exposed and a visitor can reach a published ancestor containing protected descendant notes.

Not necessarily. The described behavior allows an unauthenticated visitor to query the public endpoint, although deployment-specific sharing and network controls affect exposure.

Enforce authorization independently for every note returned by a search operation, including password, visibility, and publication controls, before exposing metadata or content-related results.

Use centralized per-resource authorization checks, test mixed-visibility hierarchies, minimize search-result fields, and include negative authorization cases in automated integration and regression testing.

Find out what's already
exploitable in your codebase.