🥷
Red
  • 🟥Overview
  • 📚Education
    • 🧐Guides
    • 🏋️Training
    • 📕Books
    • 🥳Conventions
    • 📰News
    • 🗝️Physical Tools
    • 🗣️Podcasts
    • 📹YT Channels
  • Setup
    • ctf setup
    • Exploitation Frameworks
    • Learning Offense
    • rando
  • ⭕Attacker Lifecycle
    • Steps
      • Engagement
      • 🔬Recon
        • OSINT
        • Active Recon / footprinting
      • 👀Initial Access
        • Exploit
          • SMB
        • Internal Recon
        • Linux Custom Enum Script
        • enumerate Script
        • Windows Privilege Escalation
      • 🧞Privilege Escalation
        • Ways To Privelege Escalate
      • Data Exfil
        • Data Exfil 1
      • Reporting
  • Bug Bounty
    • Bug Bounty Sites
    • OWASP Top 10
      • Injection
      • Broken Authentication
      • Sensitive Data Exposure
      • XML External Entities (XXE)
      • Broken Access Control
      • Security Misconfigurations
      • Cross-Site Scripting (XSS)
      • Insecure Deserialization
      • Using Components with Known Vulnerabilities
      • Insufficient Logging and Monitoring
Powered by GitBook
On this page
  1. Bug Bounty
  2. OWASP Top 10

Injection

Injection flaws occur when untrusted data is sent to an interpreter as part of a command or query. This can lead to attackers executing unintended commands or accessing unauthorized data.

# Vulnerable code
username = request.getParameter("username")
password = request.getParameter("password")
query = "SELECT * FROM users WHERE username='" + username + "' AND password='" + password + "'"
result = executeQuery(query)

# Secure code (using parameterized queries or prepared statements)
username = request.getParameter("username")
password = request.getParameter("password")
query = "SELECT * FROM users WHERE username=? AND password=?"
result = executeQuery(query, [username, password])
PreviousOWASP Top 10NextBroken Authentication

Last updated 2 years ago