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

Added an option to disable type inference from message content #6274

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

timbussmann
Copy link
Contributor

@timbussmann timbussmann commented Feb 17, 2022

Backport of #6244 (including #6269 )

Allows to opt-out of the default fallback behavior to let the serializer determine the type from the message content. If the Headers.EnclosedMessageTypes header does not exist or contains unknown types, NServiceBus invokes the serializer without any type information to let the serializer know that it should try to infer the target type from the message body.

Message bodies can contain type information e.g., via XML element names or Newtonsoft.Json's $type property. The exact behavior of a serializer is not defined and heavily differs between serializer implementations. This can lead to some potential security vulnerability due hard-to-predict impact of user-defined input.

This features can disable this fallback behavior which will cause the message to fail processing (and be moved to the error queue).

Documentation: https://docs.particular.net/nservicebus/serialization/#security

@timbussmann timbussmann added this to the 7.7.0 milestone Feb 17, 2022
@timbussmann timbussmann merged commit 9263070 into release-7.7 Feb 17, 2022
@timbussmann timbussmann deleted the type-inference-backport branch February 17, 2022 17:54
@timbussmann timbussmann changed the title Disable type inference from message content Support disabling type inference from message content Feb 21, 2022
@DavidBoike DavidBoike changed the title Support disabling type inference from message content Added an option to disable type inference from message content Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants