- Lab
- Security

Validate User Input for C# Applications
In this lab, you’ll practice identifying and mitigating low-level vulnerabilities in C#, specifically buffer overflow and insecure deserialization. When you’re finished, you’ll have developed two console applications—one demonstrating a buffer overflows vulnerability with a memory-safe alternative, and another illustrating insecure deserialization with a secure solution using restricted serializers.

Path Info
Table of Contents
-
Challenge
Getting Started in the Lab Environment
Here are the initial instructions and explanation of the lab environment. Read this while your environment is busy creating itself from nothing. Yes, this violates physics; we know. How fun!
-
Challenge
Understanding Buffer Overflows & Insecure Deserialization in C#
You'll begin by reviewing core C# programming concepts related to secure coding practices.
-
Challenge
Buffer Overflow Vulnerability and Mitigation
You'll develop a C# console application that demonstrates a buffer overflow vulnerability using unsafe code.
-
Challenge
Insecure Deserialization Prevention in C#
You'll work with a C# console application that demonstrates insecure deserialization using BinaryFormatter class. Then, you'll secure the deserialization process by replacing BinaryFormatter with the restricted serializer DataContractJsonSerializer.
-
Challenge
Knowledge Check for Validate User Input for C# Applications
In this challenge, you will answer some assessment questions that will test your understanding of the concepts you learned throughout this lab.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.