COMMON ATTACK PATTERN ENUMERATION AND CLASSIFICATIONLive MITRE record

CAPEC-242

Code Injection

An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

Abstraction

Meta

Typical severity

High

Likelihood of attack

High

Understand the attack

What is this attack pattern?

An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

Requirements

What does the attack require?

Prerequisites

  • The target software does not validate user-controlled input such that the execution of a process may be altered by sending code in through legitimate data channels, using no other mechanism.

Skills required

Not stated in the MITRE record.

Resources required

Not stated in the MITRE record.

Impact

What does a successful attack lead to?

Other

Affected scopes: Confidentiality, Integrity, Availability

Defence

How is it prevented and mitigated?

1
Utilize strict type, character, and encoding enforcement
2
Ensure all input content that is delivered to client is sanitized against an acceptable content specification.
3
Perform input validation for all content.
4
Enforce regular patching of software.
CAPEC-242: Code Injection — DayBreach Saldırı Sözlüğü · DayBreach