First Move (11~18) - Code, Learn, Build
🧭 Career CompassDashboardProgress
Loading...
First Move (11~18) - Code, Learn, Build

Structured, level-based technology learning paths from foundational exploration to industry mastery.

Learning Domains

  • Python Programming (Active)
  • Computer Science Core
  • Web Development
  • AI & Machine Learning

Platform Architecture

  • Level-Based Progression
  • Decoupled Content Schema
  • Modular Code Execution Engine
  • Curated Official Resources

© 2026 First Move (11~18) • CODE • LEARN • BUILD. Built with Next.js App Router.

Readability & Accessibility First

← Web Security & OWASP Defense|Level 2: OWASP Top 10 Vulnerabilities & Code Defenses

3. SQL Injection (SQLi) & Cross-Site Scripting (XSS) Mitigation

Lesson 3 of 6
Saved Locally (Guest)
Progress
0%

SQL Injection (SQLi) & Cross-Site Scripting (XSS) Mitigation

Prevent SQL injection using parameterized prepared statements, and stop XSS attacks with context-aware HTML escaping and HttpOnly cookies.

SQLi & XSS Attack Mechanics

### Vulnerability Defenses - **SQL Injection (SQLi)**: Occurs when untrusted user input is concatenated into raw SQL strings. Defended using **Parameterized Prepared Statements**. - **Cross-Site Scripting (XSS)**: Occurs when malicious scripts execute in victim browsers. Defended using **HTML Entity Encoding** and **HttpOnly Cookies** (blocking `document.cookie` access from JavaScript).
💻 Ready to test your knowledge with code?
Solve the hands-on coding exercise in the interactive code editor.