CWE-1046: Creation of Immutable Text Using String Concatenation

BaseIncomplete

The product creates an immutable text string using string concatenation operations.

View on MITRE
Back to CWE Lookup

Extended Description

When building a string via a looping feature (e.g., a FOR or WHILE loop), the use of += to append to the existing string will result in the creation of a new object with each iteration. This programming pattern can be inefficient in comparison with use of text buffer data elements. This issue can make the product perform more slowly. If the relevant code is reachable by an attacker, then this could be influenced to create performance problem.

Technical Details

Structure
Simple

Applicable To

Languages
Platforms

Frequently Asked Questions

What is CWE-1046: Creation of Immutable Text Using String Concatenation?+

CWE-1046: Creation of Immutable Text Using String Concatenation is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product creates an immutable text string using string concatenation operations. When building a string via a looping feature (e.g., a FOR or WHILE loop), the use of += to append to the existing string will result in the creation of a new object with each iteration. This programming pattern can be inefficient in comparison with use of text buffer data elements. This issue can make the product perform more slowly. If the relevant code is reachable by an attacker, then this could be influenced to create performance problem.

What are the security consequences of Creation of Immutable Text Using String Concatenation?+

If exploited, CWE-1046 (Creation of Immutable Text Using String Concatenation) it can compromise Other, leading to outcomes such as Reduce Performance.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-1046 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More