fleet icon indicating copy to clipboard operation
fleet copied to clipboard

ai_tools: chromiumSideloaded() misclassifies legitimate browser components as sideloaded_unverified

Open marcusallen97 opened this issue 3 months ago • 2 comments

Fleet versions

  • Discovered: 4.90.0-rc.2608041622 (branch rc-minor-fleet-v4.90.0)
  • Reproduced: 4.90.0-rc.2608041622 (branch rc-minor-fleet-v4.90.0)

Web browser and operating system: Microsoft Edge (default install) running on Windows 11


💥 Actual behavior

The ai_tools table's browser_extension collector flags genuine, first-party browser components as sideloaded_unverified. Confirmed concretely with Microsoft Edge's built-in "Edge Copilot Bridge" feature, which was never sideloaded.

🛠️ Expected behavior

A component with a trusted Chromium location value (Internal or Component) should never be flagged sideloaded_unverified, regardless of its from_webstore value.

🧑‍💻 Steps to reproduce

These steps:

  • [x] Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  • [ ] Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
  1. On a Windows host with a default Microsoft Edge install (ships with the built-in "Edge Copilot Bridge" feature), query SELECT name, identifier, risk_flags FROM ai_tools WHERE type='browser_extension' AND name='Edge Copilot Bridge';
  2. Observe risk_flags includes sideloaded_unverified.
  3. Directly inspect the raw entry in Edge's Secure Preferences file for this extension's id (ndcpkimcihhghdcddljkfmmjccdmcmof): confirm from_webstore: false and location: 5 (Chromium's "Component" location — an explicitly trusted origin).

🕯️ More info (optional)

Root cause: orbit/pkg/table/ai_tools/internal/browserext/risk.go's chromiumSideloaded() checks fromWebstore == 0 first and returns true immediately — it never reaches the subsequent check for a trusted location value (chromiumLocInternal/chromiumLocComponent). Genuine first-party browser components are installed by the browser itself, not through the Web Store, so they will always report from_webstore: false by definition — making the location-based trust exemption the code was clearly designed to support effectively unreachable in practice.

Suggested fix: check location for a trusted value first and return false immediately in that case, before falling through to the fromWebstore check:

func chromiumSideloaded(fromWebstore, location int) bool {
	if location == chromiumLocInternal || location == chromiumLocComponent {
		return false
	}
	if fromWebstore == 0 {
		return true
	}
	...
}

Found while QA'ing #47619 (ai_tools fleetd table).

marcusallen97 avatar Aug 06 '26 18:08 marcusallen97

QA Summary

Fix merged in #50770. Verified 2026-08-10: cherry-picked 9cb3a5e2063fd1fa7b4a8b0ee7ce70553839a950 locally onto rc-minor-fleet-v4.90.0 (not pushed), rebuilt fleetd for the affected Windows host, and confirmed Edge Copilot Bridge's risk_flags goes from sideloaded_unverified to empty ("") — same host, same real component, only the fix differs.

marcusallen97 avatar Aug 10 '26 15:08 marcusallen97

Built in components trusted origins checked first false alarms vanish

fleet-release avatar Aug 17 '26 19:08 fleet-release