🎄 Join our Annual Holiday wargame and win prizes!


Code Injection

Code injection is a vulnerability that occurs when an application passes untrusted input directly into a code interpreter, such as a shell, database, or programming language runtime. This allows attackers to execute arbitrary commands or scripts, potentially leading to data breaches, system compromise, or unauthorised access.

Remediation

To remediate, always validate and sanitise user input, avoid dynamic code execution with user-controlled data, and use safe APIs or libraries that separate code from data. Employing least privilege principles and input encoding can further reduce risk.

Metadata

  • Severity: high
  • Slug: code-injection

CWEs

  • 94: Improper Control of Generation of Code ('Code Injection')

OWASP

  • A03:2021: Injection

Available Labs

Open Javascript labs in SecDim Play for this vulnerability.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more