Class · High

CWE-1229: Creation of Emergent Resource

The product manages resources or behaves in a way that indirectly creates a new, distinct resource that can be used by attackers in violation of the intended policy.

CWE-1229 · Class Level

Description

The product manages resources or behaves in a way that indirectly creates a new, distinct resource that can be used by attackers in violation of the intended policy.

A product is only expected to behave in a way that was specifically intended by the developer. Resource allocation and management is expected to be performed explicitly by the associated code. However, in systems with complex behavior, the product might indirectly produce new kinds of resources that were never intended in the original design. For example, a covert channel is a resource that was never explicitly intended by the developer, but it is useful to attackers. "Parasitic computing," while not necessarily malicious in nature, effectively tricks a product into performing unintended computations on behalf of another party.

Potential Impact

Other

Varies by Context

Demonstrative Examples

In this example, the attacker observes how long an authentication takes when the user types in the correct password.
When the attacker tries their own values, they can first try strings of various length. When they find a string of the right length, the computation will take a bit longer, because the for loop will run at least once. Additionally, with this code, the attacker can possibly learn one character of the password at a time, because when they guess the first character right, the computation will take longer than a wrong guesses. Such an attack can break even the most sophisticated password with a few hundred guesses.
Bad
def validate_password(actual_pw, typed_pw):
		 
                   if len(actual_pw) <> len(typed_pw):
		   return 0
                   for i in len(actual_pw):
		   if actual_pw[i] <> typed_pw[i]:
		   return 0
                   
                   return 1
Note that in this example, the actual password must be handled in constant time as far as the attacker is concerned, even if the actual password is of an unusual length. This is one reason why it is good to use an algorithm that, among other things, stores a seeded cryptographic one-way hash of the password, then compare the hashes, which will always be of the same length.

Frequently Asked Questions

What is CWE-1229?

CWE-1229 (Creation of Emergent Resource) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Class-level weakness. The product manages resources or behaves in a way that indirectly creates a new, distinct resource that can be used by attackers in violation of the intended policy.

How can CWE-1229 be exploited?

Attackers can exploit CWE-1229 (Creation of Emergent Resource) to varies by context. This weakness is typically introduced during the Implementation, Architecture and Design phase of software development.

How do I prevent CWE-1229?

Follow secure coding practices, conduct code reviews, and use automated security testing tools (SAST/DAST) to detect this weakness early in the development lifecycle.

What is the severity of CWE-1229?

CWE-1229 is classified as a Class-level weakness (High abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.