Closed Bug 2067819 Opened 2 months ago Closed 2 months ago

Policy URL fields reject URLs the URL parser accepts (IDN hosts, non-ASCII paths, spaces)

Categories

(Firefox :: Enterprise Policies, defect, P2)

defect

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 158+ fixed
firefox156 --- wontfix
firefox157 --- wontfix
firefox158 + fixed
firefox159 --- fixed

People

(Reporter: mkaply, Assigned: mkaply)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 external files)

The url, urlOrEmpty and origin definitions in browser/components/enterprisepolicies/schemas/policies-schema.json use "format": "uri", which the compliant validator implements as the RFC 3986 grammar. The previous validator accepted any string new URL() could parse, so URL values administrators have always been able to set are now rejected:

  • IDN hosts, https://münchen.example/
  • non-ASCII paths, https://a.example/über
  • paths, queries and fragments containing a space, {, }, ^ or a double quote

Every url-typed field is affected - Bookmarks, Permissions origins, ExtensionSettings install_url, Proxy, AppUpdateURL. Depending on the field, the entry is dropped or the whole policy fails; either way the administrator sees the policy silently not apply.

RFC 3986 is not the rule Firefox enforces when it loads these URLs - the URL parser is. Validating them the way Firefox will actually parse them (e.g. a custom format backed by URL.canParse) restores the previous contract, but it trades away a standard format keyword that other tooling such as the enterprise console understands, so the approach needs a decision rather than just a patch.

Regressed by bug 2044429. Homepage.URL additionally accepts several URLs separated by |; that quirk is being handled separately in bug 2067248.

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

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)

Not high severity until someone complains :)

Severity: -- → S3
Flags: needinfo?(mozilla)
Priority: -- → P3

:mkaply, looks like Bug 2074747 is a duplicate of this?
Adding to See Also since I wasn't sure. We can dup it over once you have a chance to confirm.

Flags: needinfo?(mozilla)
Keywords: regression
Regressed by: 2044429
See Also: → 2074747
Duplicate of this bug: 2074747

yes. I'll fix.

Severity: S3 → S2
Flags: needinfo?(mozilla)
Priority: P3 → P2
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/23ae96913389 https://hg.mozilla.org/integration/autoland/rev/f618097a7405 Revert "Bug 2067819 - Validate policy URLs with the URL parser. r=bsmth" for causing xpc failures @ test_extensionsettings_install_without_url.js

The thing I landed before this depended on the old behavior somehow. Checking.

Flags: needinfo?(mozilla)

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

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch

The patch landed in nightly and beta is affected, along with ESR.

:mkaply, please make an uplift decision for beta and ESR:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox158 to wontfix if the fix can wait for the next release.
  • For ESR, nominate the patch for the appropriate ESR uplift approval if the fix should be included in ESR, or set the ESR status flag(s) to wontfix if an uplift isn't needed. Each affected ESR release needs a decision.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(mozilla)
See Also: → 2075774
Attachment #9653172 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Enterprise policy URLs that Firefox can load (IDN hosts, non-ASCII paths, spaces, and %PLACEHOLDER% values in AppUpdateURL) are rejected, so those policies silently don't apply. Regression from bug 2044429.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Restores the previous rule of accepting any URL the URL parser accepts. Limited to enterprise policy validation.
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9653173 - Flags: approval-mozilla-esr153?

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Enterprise policy URLs that Firefox can load (IDN hosts, non-ASCII paths, spaces, and %PLACEHOLDER% values in AppUpdateURL) are rejected, so those policies silently don't apply. This broke self-hosted AppUpdateURL configurations moving from 140 to 153 (bug 2074747). Regression from bug 2044429.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Restores the previous rule of accepting any URL the URL parser accepts. Limited to enterprise policy validation. Rebased: the only conflict was a test file for an update_url feature not on ESR.
  • String changes made/needed?: None
  • Is Android affected?: no
Attachment #9653172 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
See Also: 2074747 →
Attachment #9653173 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
QA Whiteboard: [qa-triage-done-c160/b159]
Flags: needinfo?(mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: