Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (47 loc) · 2.72 KB

README.md

File metadata and controls

64 lines (47 loc) · 2.72 KB

A03 - Injection

Introduction and background

Injection was previously on the first position on OWASP 10. However, in 2021 OWASP rated this to the third position. 94% of tested applications were tested for some form of injection with a max incidence rate of 19%, an average incidence rate of 3%, and 274k occurrences.

An application is vulnerable to attack when:

  • User-supplied data is not validated, filtered, or sanitized by the application.
  • Dynamic queries or non-parameterized calls without context-aware escaping are used directly in the interpreter.
  • Hostile data is used within object-relational mapping (ORM) search parameters to extract additional, sensitive records.
  • Hostile data is directly used or concatenated. The SQL or command contains the structure and malicious data in dynamic queries, commands, or stored procedures.

CWEs

Notable Common Weakness Enumerations (CWEs):

  • CWE-79: Cross-site Scripting
  • CWE-89: SQL Injection
  • CWE-73: External Control of File Name or Path
  • and many more ...

CVEs

Examples of CVEs :

Examples of attacker scenarios using juice shop

  • Login Bender - Log in with Bender's user account
    • Use domain name and user name - (find domain name in application-configuration)
    • You are familiar with the vulnerability in the e-mail field
  • Login Jim - Log in with Jim's user account.
    • Hint injection vulnerability in the search box
    • A user table named User with columns id,email,password exist
  • Expired coupon - Successfully redeem an expired campaign coupon code
  • Payback time - Place an order that makes you rich

Primary defenses

OWASP's Injection prevention - injection prevent rules :

  • Rule #1 (Perform proper input validation)
  • Rule #2 (Use a safe API)
  • Rule #3 (Contextually escape user data)

Other relevant cheat sheets: