Common Weakness Enumeration

A Community-Developed Dictionary of Software Weakness Types

CWE/SANS Top 25 Most Dangerous Software Errors Common Weakness Scoring System
Common Weakness Risk Analysis Framework
Home > CWE List > CWE- Individual Dictionary Definition (2.7)  

Presentation Filter:

CWE-506: Embedded Malicious Code

Embedded Malicious Code
Weakness ID: 506 (Weakness Class)Status: Incomplete
+ Description

Description Summary

The application contains code that appears to be malicious in nature.

Extended Description

Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.

+ Terminology Notes

The term "Trojan horse" was introduced by Dan Edwards and recorded by James Anderson [18] to characterize a particular computer security threat; it has been redefined many times [4,18-20].

+ Time of Introduction
  • Implementation
+ Common Consequences

Technical Impact: Execute unauthorized code or commands

+ Demonstrative Examples

Example 1

In the example below, a malicous developer has injected code to send credit card numbers to his email address.

(Bad Code)
Example Language: Java 
boolean authorizeCard(String ccn) {
// Authorize credit card.

mailCardNumber(ccn, "");
+ Potential Mitigations

Phase: Testing

Remove the malicious code and start an effort to ensure that no more malicious code exists. This may require a detailed review of all code, as it is possible to hide a serious attack in only one or two lines of code. These lines may be located almost anywhere in an application and may have been intentionally obfuscated by the attacker.

+ Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfCategoryCategory505Intentionally Introduced Weakness
Development Concepts (primary)699
ChildOfCategoryCategory904SFP Cluster: Malware
Software Fault Pattern (SFP) Clusters (primary)888
ChildOfWeakness ClassWeakness Class912Hidden Functionality
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base507Trojan Horse
Development Concepts (primary)699
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base510Trapdoor
Development Concepts (primary)699
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base511Logic/Time Bomb
Development Concepts (primary)699
Research Concepts (primary)1000
ParentOfWeakness BaseWeakness Base512Spyware
Development Concepts (primary)699
Research Concepts (primary)1000
+ Taxonomy Mappings
Mapped Taxonomy NameNode IDFitMapped Node Name
+ Content History
Submission DateSubmitterOrganizationSource
Externally Mined
Modification DateModifierOrganizationSource
added/updated demonstrative examples
updated Time_of_Introduction
updated Description, Relationships, Other_Notes, Taxonomy_Mappings
updated Description, Other_Notes
updated Other_Notes, Terminology_Notes
updated Common_Consequences
updated Relationships
updated Potential_Mitigations
updated Relationships
Previous Entry Names
Change DatePrevious Entry Name
Page Last Updated: June 23, 2014