Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch From Using Unmaintained Newtonsoft.Json to Using System.Text.Json in Powershell Authentication Module #2774

Open
fey101 opened this issue Jun 4, 2024 · 1 comment · May be fixed by #3083
Assignees
Labels
enhancement New feature or request type:security Security, or privacy issue

Comments

@fey101
Copy link
Contributor

fey101 commented Jun 4, 2024

Describe the bug

The Newtonsoft.Json dependency of the SDK's authentication module, is no longer actively maintained. In the past we have also encountered trust issues with the signed Newtonsoft.Json package throwing verificationError 18 which interprets to
"Your file is signed but we don't trust it"
and PS SDK users, have raised this too as an issue for them. See #2741 and JamesNK/Newtonsoft.Json#2755

Expected behavior

Avoid Newtonsoft.Json related issues mentioned above by switching to System.Text.Json

How to reproduce

The task will include writing tests to cover the affected code segments and mitigate against any regressions before switching to system.text.json.

The current tricky work is the Json DOM handling in the 3 files below

It should be easier to replace JsonConvert.SerializeObject with JsonSerializer.Seralize in other files like

var body = JsonConvert.SerializeObject(content);

Acceptance Criteria

  • 100% test coverage on affected files/files originally using Newtonsoft.Json package
  • Working authentication module with the tests passing and using System.Text.Json instead of Newtonsoft.Json
@fey101 fey101 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience enhancement New feature or request and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jun 4, 2024
@timayabi2020 timayabi2020 self-assigned this Aug 6, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Jan 8, 2025

We also need to bump System.Text.Json that has a CVE & is causing conflicts with ExchangeOnlineManagement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type:security Security, or privacy issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants