András Tóth‘s professional blog
banditoth.net

Hey there 👋, I’m banditoth a .NET MAUI developer from Hungary.
I write about software development with .NET technologies.

You can find me on:
LinkedIn | Github | StackOverflow | X / Twitter | Threads

Tag: exception

  • .NET Core: Type serialization denied

    This content has 4 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

    When trying to return with a complex object in .NET Core API, which has a Type property in it, the serializer gives the following exception :

    System.NotSupportedException: Serialization and deserialization of 'System.Type' instances are not supported and should be avoided since they can lead to security issues.
    

    Passing Type, DataSet, DataTable through the JSON or XML serializer gives possibility to remote code execution for attackers. More information available at https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/dataset-datatable-dataview/security-guidance

    Workaround:
    Declare an enumeration for your types (ex: enum { string, int, etc }) you can parse the value for the requested type explicitly.

  • [Fun] Android: My favourite exception ever

    This content has 5 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.
    10-12 11:31:09.871 E/AndroidRuntime(10069): DeadSystemException: The system died; earlier logs will point to the root cause