Closed Bug 1806730 Opened 1 year ago Closed 1 year ago

Dragging a URL to desktop fails with long page title (252 or more characters) since Firefox 108

Categories

(Core :: Widget: Win32, defect, P3)

Firefox 108
Desktop
Windows
defect

Tracking

()

VERIFIED FIXED
111 Branch
Tracking Status
firefox-esr102 --- verified
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- wontfix
firefox111 --- verified
firefox112 --- verified

People

(Reporter: soeren.hentzschel, Assigned: enndeakin)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

Attached file test case

STR:

  1. use Windows
  2. open a URL with a long page title* (see the attached test case)
  3. drag the URL from the address bar to the desktop

*) For me it happens with 252 or more characters.

Expected:

A shortcut is created.

Actual:

No shortcut is created, an error message appears:

"The syntax for the file name, directory name or disk label is incorrect." (freely translated, because I use Windows in German)


Since it's a regression from the security fix in bug 1746139 Firefox ESR 102.6 is affected as well.

It was reported as an issue in the Firefox support. A lot of Amazon pages have such large page titles.

Regressed by: CVE-2022-46874

:mkmelin, since you are the author of the regressor, bug 1746139, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mkmelin+mozilla)

The regressing commit is https://hg.mozilla.org/mozilla-central/rev/5984cee8a1c5
I'm not the author, just took over the bug after original author left.

Flags: needinfo?(mkmelin+mozilla)
Summary: Dragging a URL to desktop fails with long page title since Firefox 108 → Dragging a URL to desktop fails with long page title (252 or more characters) since Firefox 108

Neil, I don't suppose you happen to know what's up here?

(The DnD code is in widget, so moving this over there.)

Component: File Handling → Widget: Win32
Flags: needinfo?(enndeakin)
Product: Firefox → Core
See Also: → 1806775

So it looks like ValidateFilename is called but the extension (.URL) is being appended after this, so it ends up being four bytes too long. ValidateFileNameForSaving, which already handles cropping long filenames, was added in-between the two attempts to fix 1746139, so the changes in that bug aren't really needed, we should instead just remove the extra validation, (and I think that can remove the references to MAX_PATH).

Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Flags: needinfo?(enndeakin)
See Also: → 1808010

The severity field is not set for this bug.
:spohl, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(spohl.mozilla.bugs)
Severity: -- → S3
Flags: needinfo?(spohl.mozilla.bugs)
Priority: -- → P3
Pushed by neil@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/964759bae25f
remove the redundant filename length checking that ValidateFileNameForSaving already does, r=cmartin
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

Should we uplit to beta or can it ride the 111 train? Thanks

Flags: needinfo?(enndeakin)

Too late now for an uplift to beta.

Flags: needinfo?(enndeakin)
Flags: qe-verify+

Reproducible on a 2023-01-15 Nightly build on Windows 11.
Verified as fixed on Firefox 111.0b6(build ID: 20230226190100) and Nightly 112.0a1(build ID: 20230226214053) on Windows 11 and Windows 10.

Status: RESOLVED → VERIFIED
Flags: qe-verify+

Is this something we wanted to backport to ESR102 also since the regressing patch also landed there? It would need a rebased patch if so.

Flags: needinfo?(enndeakin)

Comment on attachment 9326138 [details]
WIP: Bug 1806730, remove the redundant filename length checking that ValidateFileNameForSaving already does, esr version

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Confusing error/silent failure occurs when dragging urls to desktop
  • User impact if declined: Pages with long titles cannot be dragged to the desktop
  • Fix Landed on Version: 111
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Removes unneeded code
Flags: needinfo?(enndeakin)
Attachment #9326138 - Flags: approval-mozilla-esr102?
Attachment #9309742 - Flags: approval-mozilla-esr102?
Attachment #9309742 - Flags: approval-mozilla-esr102?

Comment on attachment 9326138 [details]
WIP: Bug 1806730, remove the redundant filename length checking that ValidateFileNameForSaving already does, esr version

Approved for 102.10esr.

Attachment #9326138 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+

Reproducible on a 2023-01-15 Nightly build on Windows 11.
Verified as fixed on Firefox 102.10.0esr(build ID: 20230403141754) on Windows 11 and Windows 10.

Regressions: 1829981
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: