AITab [FE] - tool call response must call sanitizeUntrustedContent on response data
Categories
(Core :: Machine Learning: Frontend, defect, P1)
Tracking
()
People
(Reporter: rrando, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [aiaug] )
Title is being returned by the tool call function, but sanitizeUntrustedContent is not applied. This brackets with an untrusted tag.
Note that we may need to investigate any untrusted issues around return of the id slug, which will be added soon. We had hoped to include that in the chat context.
Comment 1•2 months ago
|
||
| frontend-triage | ||
Tools.sys.mjs interpolates result.metadata.title into the generate_aitab response after only stripping [ and ], so page-derived text reaches the model untruncated and unspotlighted inside an instruction ("Link the user to it as ..."), unlike the tab and history titles elsewhere in the same file. That title is the Header title of the model-composed surface, or the raw open-tab label captured at AITab.sys.mjs, and neither path is sanitized.
Fix: Call sanitizeUntrustedContent(title, true) at line 1427, truncate-only so the spotlighting quotes do not land inside the markdown link text, and sanitize heading at AITab.sys.mjs#795 so the fallback is covered too; the id slug needs no extra handling, since #slugify already reduces it to [a-z0-9_] capped at 60 characters. Add a hostile-title case to browser_aitab_generation.js, which today asserts only the viewer URL and never the link text, mirroring the check in test_ManageTabs.js.
Suggested severity: S3. Untrusted web-derived text enters the model context inside a tool instruction, but the get_page_content call that feeds it has already raised untrustedInput on the conversation, so the memory, tab-action and fetch gates stay in force and the exposure is a hardening gap rather than an open path.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-wrong-file, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Fixed here as part of the changes in Bug 2065560:
https://searchfox.org/firefox-main/source/browser/components/aiwindow/models/Tools.sys.mjs#1653
Description
•