Skip to content

Listed But Not Allowed To Open December 2026

Ed Mozley edited this page Dec 6, 2026 · 1 revision

Security: listed to colleagues who could not open it

Fixed in 6.0.2 Β· Found while designing and reviewing Global Search Β· Modules: Projects (documents), Knowledge (Ctrl-K)


Timeline

Date What happened
1 December 2026 The Ctrl-K gap identified by @cloudcogsio while designing Global Search (discussion #459); recorded as decision D9 on Global Search - design.
6 December 2026 The documents gap found in the review of Global Search part 1 (PR #537).
6 December 2026 Both fixed and released in 6.0.2, the same day, and this write-up published.

Upgrading to 6.0.2 is the fix. Nothing else needs doing.

The short version

Two places in FreeITSM decided what a list may show with a wider rule than the one that decides what you may open. Opening was always refused, so nobody could read a document or an article they were not allowed to - but its title, and for documents a snippet of its text, could appear in a list.

  • Documents on a members-only project. A project can be members only (since 3.3.0): only its owner, its members and people who manage Projects see it. A document attached to such a project could still show up - title and a snippet of its text - in search results and the documents finder, for analysts in the same company who are not on the project. Downloading or previewing it was refused. Present in 3.3.0 to 6.0.1, and only where members-only projects have documents attached. Administrators and project managers see every project anyway, so nothing changed for them.
  • Knowledge articles with an access list, in Ctrl-K. An article can be limited to named analysts or teams (since 5.7.0). The search box in the header, Ctrl-K, did not follow that list, so the title of a restricted article - and of archived articles - could appear for an analyst not on it. Opening it was refused. Present in 5.7.0 to 6.0.1, and only where Knowledge access lists are used.

What was wrong

Documents are not judged on their own: a document is visible if you can see at least one record it is attached to. The documents registry (documentEntityRegistry() in includes/documents.php) therefore gives every kind of parent record two rules - can, which decides whether you may have the document (download, preview), and filter, which narrows a list (search, the documents finder) in SQL. The two must say the same thing.

For projects they did not. can called analystCanAccessProject(), which checks members-only projects. filter only checked the company:

'can'    => function (PDO $c, int $a, int $id) { return analystCanAccessProject($c, $a, $id); },
'filter' => function (PDO $c, int $a, string $alias) { return activeTenantFilter($c, $a, $alias); },

Ctrl-K's knowledge block searched the index with a company rule only, not the article's own access list (knowledgeVisibilitySql()), which every other Knowledge screen uses.

The fix

The project entry's list rules now add the members-only rule, projectVisibleSql() - the same rule the Projects module uses for its own lists - to the company rule. Both the single-company filter and the new every-company companies rule (added by Global Search, PR #537) carry it:

// TRAP: the list rules must be as narrow as 'can'. Company alone let a
// members-only project's documents (title, snippet) into search and the
// documents finder for colleagues outside the project, though 'can'
// refused the download. projectVisibleSql() is the members-only rule.
'filter' => function (PDO $c, int $a, string $alias) {
    require_once __DIR__ . '/projects/visibility.php';
    [$t, $tp] = activeTenantFilter($c, $a, $alias);
    [$m, $mp] = projectVisibleSql($c, $a, $alias, false);
    return [$t . $m, array_merge($tp, $mp)];
},

false at the end means "with no analyst, hide members-only projects" - a list without a reader shows less, never more.

For Ctrl-K, Global Search part 1 builds a per-record clause into every search of the index (searchScopeForAnalyst() in includes/search/search.php), and its Knowledge part is knowledgeVisibilitySql() - access lists and archived articles included. That arrived with @cloudcogsio's PR, as agreed in the design (D9).

⚠️ TRAP for anyone adding a parent type to the documents registry: filter (and companies) must be exactly as narrow as can. If can calls a helper that checks more than the company, the list rules must check it too.

How it was tested

tests/document-project-members.php (new, 14 checks): a members-only project with its owner and a colleague in the same company, and a project open to everyone, each with a document.

  • Without the fix: the colleague sees the members-only document in a list, in a list across companies and in search - 4 failures, including "listed === downloadable" disagreeing.
  • With the fix: 14 of 14 - the owner sees it everywhere (positive controls), the colleague nowhere, the open project's document is seen by both, and for every person and document the list agrees with the download.

The Ctrl-K change is covered by tests/global-search-permissions.php (an article on an access list, in Global Search's scope and in Ctrl-K's exact scope). The existing document permission tests (document-permissions.php 22, document-search-permissions.php 9, project-documents-api.php 45) pass.

Files

File Change
includes/documents.php the project entry's filter and companies rules add projectVisibleSql()
includes/search/search.php per-record clause on every index search, Knowledge via knowledgeVisibilitySql() (PR #537)
api/system/global_search.php Ctrl-K's knowledge block uses that scope (PR #537)
tests/document-project-members.php new

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally