- Lab
- Security

Sanitize User Input for Java Applications
In this lab, you’ll practice sanitizing user input in Java to prevent common cyber attacks such as SQL injection, cross-site scripting (XSS), and cross-site request forgery (CSRF). When you’re finished, you’ll be able to sanitize input effectively to reduce security risks in your applications.

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
Conceptual Learning
In this challenge, you'll learn about the significance of security vulnerabilities that enable SQL injection, cross-site scripting (XSS), and cross-site request forgery (XSS).
-
Challenge
SQL Injection
In this challenge, you will learn how to create a database, perform a SQL injection, and then prevent SQL injections using parameterized queries.
-
Challenge
Cross Site Scripting and CSRF in Java
In this challenge, you will see a practical demonstration of XSS and CSRF in Java applications. Then, you will prevent these attacks by using input validation to sanitize user input.
-
Challenge
Assess Your Understanding
In this challenge, you will answer questions to reinforce the concepts covered throughout the 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.