Description
This entry has been deprecated because its abstraction was too low-level. See CWE-532.
Modes of Introduction:
Related Weaknesses
Consequences
This entry has been deprecated because its abstraction was too low-level. See CWE-532.
Modes of Introduction:
The software uses the singleton pattern when creating a resource within a multithreaded environment.
The use of a singleton pattern may not be thread-safe.
Modes of Introduction:
– Implementation
Other, Integrity: Other, Modify Application Data
Phase: Architecture and Design
Description:
Use the Thread-Specific Storage Pattern. See References.
Phase: Implementation
Description:
Do not use member fields to store information in the Servlet. In multithreading environments, storing user data in Servlet member fields introduces a data access race condition.
Phase: Implementation
Effectiveness: Limited
Description:
Avoid using the double-checked locking pattern in language versions that cannot guarantee thread safety. This pattern may be used to avoid the overhead of a synchronized call, but in certain versions of Java (for example), this has been shown to be unsafe because it still introduces a race condition (CWE-209).
The software does not use a standardized method for handling errors throughout the code, which might introduce inconsistent error handling and resultant weaknesses.
If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.
Modes of Introduction:
– Architecture and Design
Integrity, Other: Quality Degradation, Unexpected State, Varies by Context
Phase: Architecture and Design
Description:
define a strategy for handling errors of different severities, such as fatal errors versus basic log events. Use or create built-in language features, or an external package, that provides an easy-to-use API and define coding standards for the detection and handling of errors.
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
Serialization and deserialization refer to the process of taking program-internal object-related data, packaging it in a way that allows the data to be externally stored or transferred (“serialization”), then extracting the serialized data to reconstruct the original object (“deserialization”).
Modes of Introduction:
– Architecture and Design
Likelihood of Exploit: Medium
Integrity: Modify Application Data, Unexpected State
Attackers can modify unexpected objects or data that was assumed to be safe from modification.
Availability: DoS: Resource Consumption (CPU)
If a function is making an assumption on when to terminate, based on a sentry in a string, it could easily never terminate.
Other: Varies by Context
The consequences can vary widely, because it depends on which objects or methods are being deserialized, and how they are used. Making an assumption that the code in the deserialized object is valid is dangerous and can enable exploitation.
Phase: Architecture and Design, Implementation
Description:
If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
Phase: Implementation
Description:
When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
Phase: Implementation
Description:
Explicitly define a final object() to prevent deserialization.
Phase: Architecture and Design, Implementation
Description:
Phase: Implementation
Description:
Avoid having unnecessary types or gadgets available that can be leveraged for malicious ends. This limits the potential for unintended or unauthorized types and gadgets to be leveraged by the attacker. Add only acceptable classes to an allowlist. Note: new gadgets are constantly being discovered, so this alone is not a sufficient mitigation.
The application contains code that appears to be malicious in nature.
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.
Modes of Introduction:
– Implementation
Confidentiality, Integrity, Availability: Execute Unauthorized Code or Commands
Phase: Testing
Description:
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.
The software appears to contain benign or useful functionality, but it also contains code that is hidden from normal operation that violates the intended security policy of the user or the system administrator.
Modes of Introduction:
– Implementation
Confidentiality, Integrity, Availability: Execute Unauthorized Code or Commands
Phase: Operation
Description:
Most antivirus software scans for Trojan Horses.
Phase: Installation
Description:
Verify the integrity of the software that is being installed.
Non-replicating malicious code only resides on the target system or software that is attacked; it does not attempt to spread to other systems.
Modes of Introduction:
– Implementation
Confidentiality, Integrity, Availability: Execute Unauthorized Code or Commands
Phase: Operation
Description:
Antivirus software can help mitigate known malicious code.
Phase: Installation
Description:
Verify the integrity of the software that is being installed.
Replicating malicious code, including viruses and worms, will attempt to attack other systems once it has successfully compromised the target system or software.
Modes of Introduction:
– Implementation
Confidentiality, Integrity, Availability: Execute Unauthorized Code or Commands
Phase: Operation
Description:
Antivirus software scans for viruses or worms.
Phase: Installation
Description:
Always verify the integrity of the software that is being installed.
A software system that accepts path input in the form of multiple internal slash (‘/multiple//internal/slash/’) without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.
Modes of Introduction:
– Implementation
Confidentiality, Integrity: Read Files or Directories, Modify Files or Directories
Phase: Implementation
Description:
Inputs should be decoded and canonicalized to the application’s current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
A trapdoor is a hidden piece of code that responds to a special input, allowing its user access to resources without passing through the normal security enforcement mechanism.
Modes of Introduction:
– Architecture and Design
Confidentiality, Integrity, Availability, Access Control: Execute Unauthorized Code or Commands, Bypass Protection Mechanism
Phase: Installation
Description:
Always verify the integrity of the software that is being installed.
Phase: Testing
Description:
Identify and closely inspect the conditions for entering privileged areas of the code, especially those related to authentication, process invocation, and network communications.