Security Asset Holders API Company Check - edmozley/freeitsm GitHub Wiki
Security: asset holders could be changed across companies through the REST API
Fixed in 5.4.0 · Found during the audit for #356 (Assets and All companies) · Present in releases up to and including 5.3.0 · Affects multi-company installs with company-limited API keys only · Module: Assets, REST API
Timeline
| Date | What happened |
|---|---|
| 15 November 2026 | Found while auditing every way an asset can be changed, for #356. Proved on a test install: a caller limited to one company could add and remove holders on another company's asset, while changing the asset's other fields was correctly refused. |
| 15 November 2026 | Fixed and released in 5.4.0. The fix was kept out of the public repository until the release, so it was never visible before an upgrade was available. |
| 15 November 2026 | This write-up published. |
Upgrading to 5.4.0 is the fix. A single-company install was never affected, and neither was any install whose API keys can reach every company.
The short version
An asset's holders - the people and analysts it is assigned to - can be changed through the REST API: POST /assets/{id}/assignments and DELETE /assets/{id}/assignments/{user_id}.
What that could do. An API key limited to some companies, with the asset assignments permission, could add or remove the holders of an asset in another company, by the asset's number. Adding by email (user_email) also found a person in any company, and the reply named them.
Who could do it: a holder of such an API key on a multi-company install. The screens in FreeITSM itself were not affected - they check the asset's company before calling the same code.
Nothing to do beyond upgrading. If you want to be thorough, an asset's History tab records every holder change, with who made it.
What was wrong
AssetsService (includes/services/assets.php) has one rule for "may this caller change this asset?": assertScope(), which updateFields() and the other changes call. The four holder functions - assignUser, unassignUser, assignAnalyst, unassignAnalyst - loaded the asset but did not call it:
self::loadRow($conn, $assetId); // 404 if gone
The screen's endpoint (api/assets/assign_asset_user.php) checked the company itself before calling them, so the gap was only reachable through the REST API, which goes straight to the service.
The fix
The same check as every other change to an asset, so another company's asset is "not found":
self::assertScope($conn, $ctx, self::loadRow($conn, $assetId));
And a person in a company the caller cannot reach reads exactly like one that does not exist - the same Unknown requester message, so the reply says nothing about them (personInScope()).
tests/asset-holder-scope.php proves it: assign and unassign, for people and analysts, by id and by email, are refused on another company's asset - and still work on the caller's own, and for a caller who can reach every company (the positive controls). Against the old code, six of its ten checks fail.
Related
- Multi-company isolation - the rule every endpoint follows
- Assets and All companies - design - the audit this came from
- 5.4.0 release notes