Closed Bug 1750233 Opened 2 years ago Closed 2 years ago

JSON enterprise policies on Windows no longer work as REG_SZ

Categories

(Firefox :: Enterprise Policies, defect)

Firefox 96
All
Windows
defect

Tracking

()

VERIFIED FIXED
98 Branch
Tracking Status
firefox-esr91 --- verified
firefox96 --- wontfix
firefox97 + verified
firefox98 --- verified

People

(Reporter: brett.abram, Assigned: mkaply)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

1.) Launch the Windows Registry Editor
2.) If it does not exist, create the "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox" key
3.) On that key, create a new String Value with name "ExtensionSettings"
4.) Set the Data for this new value to "{"uBlock0@raymondhill.net":{"installation_mode":"force_installed","install_url":"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"}}"
5.) Open Firefox

Actual results:

uBlock Origin was not installed and there are the following errors on about:policies:

  • Object expected but not received
  • Invalid parameters specified for ExtensionSettings.

Expected results:

uBlock Origin should have been installed.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Win32
Product: Firefox → Core

Some additional information:

Component: Widget: Win32 → Enterprise Policies
Product: Core → Firefox

I can reproduce this issue.

Indeed this seems to be a regression caused by the changes performed in Bug 1737605.

Mozregression pushlog:

This also seems to affect other policies which are applied using JSON (ExtensionSettings & Preferences).

Mike, can you please take a look? Setting this to S3 for now but we can bump it up after your evaluation

Thank you!

Severity: -- → S3
Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Flags: needinfo?(mozilla)
Keywords: regression
OS: Unspecified → Windows
Regressed by: 1737605
Hardware: Unspecified → All

The documentation for these values has always said they are REG_MULTI_SZ. (Personally I think Chrome made a mistake by not using MULTI_SZ since you have to put all of the JSON on one line).

That being said, I'll see if I can figure out something. The reason I did it this way is because it was the only way I could validate the JSON when the registry is read.

When we read the Windows registry, we don't know the type of the value, so we don't know to parse it as JSON.

Flags: needinfo?(mozilla)
Assignee: nobody → mozilla
Status: NEW → ASSIGNED

So basically my previous patch tried way to hard to solve this problem. I should have just added the REG_MULTI_SZ parsing and then removed some unnecessary errors from the schema validator.

Thanks for looking into and fixing this so quickly, Mike. Do you know what version(s) the fix is likely to land in?

I'll try to get it in the 97 and 91.6 ESR since it's a regression.

Great, thank you.

Pushed by mozilla@kaply.com:
https://hg.mozilla.org/integration/autoland/rev/b52cd455661f
Allow JSON policy to be a REG_SZ. r=mstriemer
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

The patch landed in nightly and beta is affected.
:mkaply, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(mozilla)

Comment on attachment 9259743 [details]
Bug 1750233 - Allow JSON policy to be a REG_SZ. r?mstriemer

Beta/Release Uplift Approval Request

  • User impact if declined: Policy that use to work as a string doesn't.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: In bug
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Policy only, brings back mostly preexisting code
  • String changes made/needed:

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Policy only
  • User impact if declined: Policy that use to work as a string doesn't.
  • Fix Landed on Version: 98
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Policy only, brings back mostly preexisting code
Flags: needinfo?(mozilla)
Attachment #9259743 - Flags: approval-mozilla-esr91?
Attachment #9259743 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9259743 [details]
Bug 1750233 - Allow JSON policy to be a REG_SZ. r?mstriemer

Approved for 97.0b9 and 91.6esr.

Attachment #9259743 - Flags: approval-mozilla-esr91?
Attachment #9259743 - Flags: approval-mozilla-esr91+
Attachment #9259743 - Flags: approval-mozilla-beta?
Attachment #9259743 - Flags: approval-mozilla-beta+

I have also reproduced this issue on an affected build (Release v96.0.2), but I can't verify the fix in Nightly v98.0a1 because uBlock extension still doesn't auto-install, however, some policies errors are no longer displayed.

  • affected build:
    Object expected but not received
    Invalid parameters specified for PictureInPicture.
    Unknown policy: New Key #1

  • fixed build:
    Invalid parameters specified for PictureInPicture.
    Unknown policy: New Key #1

Mike, have added the policy key correctly?
Are the steps in comment 0 valid?

Flags: needinfo?(mozilla)
Attached file Registry file for test

Extension Settings should be right clicking on Firefox and selecting new String.

I've attached a .reg file that shows it.

And yes, some validation errors don't show anymore.

This was a compromise for multiple typed objects.

Flags: needinfo?(mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: