Closed Bug 1952268 (CVE-2025-3035) Opened 8 months ago Closed 8 months ago

AI Shortcuts leak the tab title and `<browser>` they are first opened in for the window

Categories

(Core :: Machine Learning: General, defect, P1)

defect
Points:
2

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox136 --- wontfix
firefox137 + verified
firefox138 + verified

People

(Reporter: MattN, Assigned: Mardak)

References

(Regression)

Details

(6 keywords, Whiteboard: [genai][adv-main137+])

Attachments

(5 files)

The AI Chat Shortcuts feature doesn't clean up its mouseover listener and the UI element is shared across all tabs in a browser window so the first tab to use the feature is the one always used for determining the tab title to include in the chat message. The reference to that first browser where its used is also kept alive until the window closes. It seems like the mouseover listener was never removed since the initial implementation in Jul 2024 as I don't see any removeEventListener there. I'm surprised the add/remove event listener lint rules didn't catch this.

Incorrect tab title disclosure STR:

  1. Turn on the AI Chatbot feature
  2. Open the following URL in a private window data:text/html,<title>Embarassing tab title</title>Foo
  3. Select the text "Foo"
  4. Hover over the AI Chatbot Shortcuts icon that appears
  5. Open a tab with the URL https://example.com
  6. Select some text on example.com
  7. Hover the AI Chatbot Shortcuts icon that appears
  8. Choose "Explain this" or another option that includes the tab title in the chat message

Expected result:
The chat message contains <tabTitle>Example Domain</tabTitle>.

Actual result:
The chat message contains <tabTitle>Embarassing tab title</tabTitle> and leaks this tab title to the AI provider.

== Memory leak ==
If I close the "Embarassing tab title" tab, the <browser> is kept alive until the window closes as the mouseover listener is never removed and its function keeps the browser alive.

Flags: needinfo?(edilee)
Assignee: nobody → edilee
Severity: -- → S3
Points: --- → 2
Flags: needinfo?(edilee)
Priority: -- → P1
Whiteboard: [genai]

at a glance, this behavior probably changed with bug 1922623

Keywords: regression
Regressed by: 1922623

Set release status flags based on info from the regressing bug 1922623

previously the lifespan of the element was tied to the current tab. now it's associated to the first tab that showed the shortcut, so the title of the original tab title is leaked as long as the tab is open and user selects a shortcut on a different tab. closing the original tab makes the title unavailable

Group: core-security → dom-core-security

Avoid duplicate listeners by removing on hide.

Comment on attachment 9470342 [details]
Bug 1952268 - shortcuts listener should be handled by current show r=ngrato!

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: it currently includes a test to open a second tab and show shortcuts. unclear the expected security rating for this opt-in feature that requires user selecting a provider then text then hovering then selecting again on another tab. and the leaked title is presumably of the tab previously sent from the first interaction
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Unknown
  • Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: beta, release
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: Yes
  • If not, how different, hard to create, and risky will they be?:
  • How likely is this patch to cause regressions; how much testing does it need?: removes duplicate listeners but changing scope introduced this regression in the first place
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: No
Attachment #9470342 - Flags: sec-approval?

Comment on attachment 9470342 [details]
Bug 1952268 - shortcuts listener should be handled by current show r=ngrato!

Approved to land and request uplift if desired

Attachment #9470342 - Flags: sec-approval? → sec-approval+
Pushed by elee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d720a01dd6d shortcuts listener should be handled by current show r=ngrato,firefox-ai-ml-reviewers
Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch

The patch landed in nightly and beta is affected.
:Mardak, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox137 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(edilee)

Avoid duplicate listeners by removing on hide.

Original Revision: https://phabricator.services.mozilla.com/D240656

Attachment #9470836 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: missing/incorrect tab title when using chatbot selection feature
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: 1. enable chatbot with provider 2. select text from one tab 3. select text from another tab
  • Risk associated with taking this patch: low
  • Explanation of risk level: simplify logic to avoid duplicates
  • String changes made/needed: none
  • Is Android affected?: no
Flags: qe-verify+
Attachment #9470836 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

I've reproduced this bug using an affected Nightly build (2025-03-26), with STR from comment 0.

The issue is verified as fixed on latest Nightly 138.0a1, and Beta 137.0b5 (treeherder build), running Win 11, Ubuntu 24.04 and macOS 14.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: needinfo?(edilee)
Attached file advisory.txt
Whiteboard: [genai] → [genai][adv-main137+]
Alias: CVE-2025-3035
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: