Skip to content

Additional unsafe deserializers#349

Open
chanel-y wants to merge 4 commits intomainfrom
additional-unsafe-deserializers
Open

Additional unsafe deserializers#349
chanel-y wants to merge 4 commits intomainfrom
additional-unsafe-deserializers

Conversation

@chanel-y
Copy link
Copy Markdown

@chanel-y chanel-y commented Apr 14, 2026

Adding the unsafe deserializers available in csharp but now in powershell!

Weird thing about this PR is how it splits up the different kinds of .NET APIs are invoked in powershell:

InstanceDeserializerSink — Creates an object, then calls a method on it:

$fmt = New-Object System.Runtime.Serialization.Formatters.Soap.SoapFormatter
$fmt.Deserialize($stream) # ← sink is $stream

Requires tracking that $fmt was created as an unsafe type, then matching the method call on it.

StaticDeserializerSink — Call a static method directly on the type (no object creation):

[System.Windows.Markup.XamlReader]::Parse($xaml) # ← sink is $xaml

No New-Object involved — just [Type]::Method(). Needs different matching logic (check isStatic() + the type qualifier).

UnsafeConstructorSink — The constructor itself is the dangerous operation (not a follow-up method):

$r = New-Object System.Resources.ResourceReader -ArgumentList $pat

ResourceReader deserializes the resource file at construction time, so the constructor argument is the sink

Each of the deserializers is classified into of the above, except BinaryFormatter which is separate since it's still used by the BinaryFormatter query

chanel-y and others added 4 commits April 9, 2026 09:34
Detects usage of SSL 3.0, TLS 1.0, and TLS 1.1 via SecurityProtocolType
and SslProtocols enum references.

Covers: Cryptography.10031 (CWE-327, CWE-757)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant