Skip to content

Commit

Permalink
Tweaks to WPF whats new
Browse files Browse the repository at this point in the history
  • Loading branch information
adegeo committed Nov 12, 2024
1 parent 113d467 commit 95f6c4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions dotnet-desktop-guide/net/wpf/whats-new/net90.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,13 @@ Here's an image of the ligatures not being applied to the glyphs in .NET 8:
And now, that same text as rendered in .NET 9:

:::image type="content" source="./media/net90/ligature-9.png" alt-text="A screenshot of a simple WPF app that has a text block showing how glyphs are combined into ligatures with .NET 9.":::

## BinaryFormatter no longer supported

`BinaryFormatter` is considered unsafe because it's vulnerable to deserialization attacks, which can lead to denial of service (DoS), information disclosure, or remote code execution. It was implemented before deserialization vulnerabilities were well understood, and its design doesn't follow modern security best practices.

Starting with .NET 9, its implementation has been removed to prevent these security risks. When `BinaryFormatter` is used, the `PlatformNotSupportedException` exception is thrown.

WPF used `BinaryFormatter` in many scenarios, such as when serializing data for clipboard and drag-and-drop operations. Internally, WPF continues to use a safer subset of `BinaryFormatter` to handle specific use cases with a known set of types.

For more information about `BinaryFormatter`, see [WPF migration guide for BinaryFormatter](/dotnet/standard/serialization/binaryformatter-migration-guide/wpf-applications).
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!--<NoWarn>-->
<PropertyGroup>
<NoWarn>WPF0001</NoWarn>
<NoWarn>$(NoWarn);WPF0001</NoWarn>
</PropertyGroup>
<!--</NoWarn>-->

Expand Down

0 comments on commit 95f6c4f

Please sign in to comment.