C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
Security - Lesson 4: XSS & CSRF Protection Quiz
Answer all questions to test your understanding
1
What is Cross-Site Scripting (XSS)?
Malicious scripts injected into trusted websites
A type of database backup
A network protocol
A CSS framework
2
How does Razor Pages prevent XSS?
By automatically encoding output
By deleting scripts
By blocking JavaScript
By disabling HTML
3
What is Cross-Site Request Forgery (CSRF)?
Tricking a user into performing unwanted actions
A type of virus
A network attack
A database attack
4
How does ASP.NET Core prevent CSRF?
Using anti-forgery tokens
Using passwords
Using email verification
Using cookies
5
What does the [ValidateAntiForgeryToken] attribute do?
Validates the anti-forgery token in POST requests
Validates user login
Validates email addresses
Validates passwords
Submit Quiz