Suppress SM04191 BinaryFormatter CodeQL Warnings#11385
Merged
harshit7962 merged 1 commit intodotnet:mainfrom Jan 23, 2026
Merged
Suppress SM04191 BinaryFormatter CodeQL Warnings#11385harshit7962 merged 1 commit intodotnet:mainfrom
harshit7962 merged 1 commit intodotnet:mainfrom
Conversation
himgoyalmicro
approved these changes
Jan 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a CodeQL suppression comment for the SM04191 warning ("Use of deserialization without Binder") on a BinaryFormatter.Deserialize call that serves as a fallback for backward compatibility when NRBF deserialization doesn't support certain data types.
Changes:
- Added CodeQL suppression comment to line 268 in DataStreams.cs to document and suppress the SM04191 warning for the BinaryFormatter.Deserialize fallback call
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SatwikKrSharma
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The following changes suppresses SM04191: Use of deserialization without Binder
Justification
This is a known issue. The NRBF deserialization does not support custom data types and is (to a majority of instance) limited to primitives data types. Since
BinaryFormatteris now obsolete, at runtime, this should likely throw aPlatformNotSupportedExceptionunless developers explicitly include unsupported package in their application. This approach ensures backward compatibility, as there are wide variety of usage around this area and we don't want to break existing applications.Customer Impact
None
Regression
No
Testing
None
Risk
Low
Microsoft Reviewers: Open in CodeFlow