Closed Bug 1905512 Opened 1 year ago Closed 1 year ago

Remove website URL ending with a dot character from the history

Categories

(Toolkit :: Places, defect, P2)

Firefox 127
defect

Tracking

()

VERIFIED FIXED
130 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- verified
firefox127 --- wontfix
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- verified

People

(Reporter: miljan.miljan, Assigned: yazan)

References

(Blocks 2 open bugs)

Details

(Keywords: privacy, Whiteboard: [sng][places-privacy])

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

I tried to delete or forget a website which URL is ending with a dot character. The URL is https://rts.rs.
Also, https://rt.rs.

Actual results:

Could not delete it from the history.

Expected results:

Website to be deleted from the history.

I can reproduce the issue 115.12.0esr, 127.0.2, 128.0b9 as well as Nightly129.0a1 Windows11.

STR:

  1. Visit https://bugzilla.mozilla.org./home , https://bugzilla.mozilla.org./home?GoAheadAndLogIn=1 and https://bugzilla.mozilla.org./page.cgi?id=etiquette.html
  2. Open Library
  3. Try to Forgot About This Site... on the history item

Actual results:

TypeError: Expected well formed hostname string for `host` with atmost 1 wildcard. History.sys.mjs:586:13
    removeByFilter resource://gre/modules/History.sys.mjs:586
    deleteByHost resource://gre/modules/ClearDataService.sys.mjs:1112
    deleteByBaseDomain resource://gre/modules/ClearDataService.sys.mjs:1123
    deleteDataFromBaseDomain resource://gre/modules/ClearDataService.sys.mjs:2087
    promises resource://gre/modules/ClearDataService.sys.mjs:2201
    map self-hosted:178
    promises resource://gre/modules/ClearDataService.sys.mjs:2200
    map self-hosted:178
    _deleteInternal resource://gre/modules/ClearDataService.sys.mjs:2198
    deleteDataFromBaseDomain resource://gre/modules/ClearDataService.sys.mjs:2086
    errorCount resource://gre/modules/ForgetAboutSite.sys.mjs:29
    removeDataFromBaseDomain resource://gre/modules/ForgetAboutSite.sys.mjs:28
    forgetAboutThisSite chrome://browser/content/places/controller.js:1428
    AsyncFunctionNext self-hosted:807

NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "Expected well formed hostname string for `host` with atmost 1 wildcard." {file: "resource://gre/modules/History.sys.mjs" line: 586}]'[JavaScript Error: "Expected well formed hostname string for `host` with atmost 1 wildcard." {file: "resource://gre/modules/History.sys.mjs" line: 586}]' when calling method: [nsIClearDataService::deleteDataFromBaseDomain]
    errorCount resource://gre/modules/ForgetAboutSite.sys.mjs:29
    removeDataFromBaseDomain resource://gre/modules/ForgetAboutSite.sys.mjs:28
    forgetAboutThisSite chrome://browser/content/places/controller.js:1428
Status: UNCONFIRMED → NEW
Component: Untriaged → Sanitizers
Ever confirmed: true
Product: Firefox → Core
Component: Sanitizers → Data Sanitization
Product: Core → Toolkit

Hey Marco, could you verify why this is throwing in the places component?

Flags: needinfo?(mak)

The regex at https://searchfox.org/mozilla-central/rev/3d173a6ad865eb778eb7a85de900e92774559ed6/toolkit/components/places/History.sys.mjs#583 doesn't assume this case.
It's not really common on the Web to use absolute host names, it's more common in other network communications (or dns).
Though, they clearly work as demonstrated in comment 1.
We should update the regex to allow an optional trailing dot.
And we should file a follow-up to evaluate merging them, I see currently we consider bugzilla.mozilla.org. different from bugzilla.mozilla.org but, while technically true, for our scopes we should probably normalize the URL removing the trailing dot and merge them.

Flags: needinfo?(mak)

Moving the bug to Places as it's not due to the sanitization code.

Severity: -- → S2
Component: Data Sanitization → Places
Keywords: privacy
Priority: -- → P2
Whiteboard: [sng][places-privacy]
Assignee: nobody → yalmacki
Status: NEW → ASSIGNED
Blocks: 1907542
Blocks: 1907573
Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/325ffb165783 Modify regex to allow an optional trailing dot at the end of URLs in history removeByFilter function. r=mak,places-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch

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

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

For more information, please visit BugBot documentation.

Flags: needinfo?(yalmacki)

I don't think this is super urgent to uplift

Seems like we probably want to uplift this to ESR128?

Flags: needinfo?(mak)
Attachment #9420325 - Flags: approval-mozilla-esr128?

esr128 Uplift Approval Request

  • User impact if declined: Cannot remove site from history
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: see comment 1
  • Risk associated with taking this patch: low
  • Explanation of risk level: it's a regular expression change making an API a bit more lenient
  • String changes made/needed: none
  • Is Android affected?: no
Flags: qe-verify+
Flags: needinfo?(mak)
Attachment #9420325 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+

I was able to reproduce the issue using Firefox 129.0b1 on Windows 11, while following the steps described in Comment 1.
Verified as fixed using Firefox 130.0-RC1 and Firefox 128.2.0esr, on macOS 14.6, Windows 11 and Ubuntu 22.04. https://bugzilla.mozilla.org./home , https://bugzilla.mozilla.org./home?GoAheadAndLogIn=1 and https://bugzilla.mozilla.org./page.cgi?id=etiquette.html are deleted from History by using the 'Forgot About This Site...' option.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: