CWEweakness

CWE-1109 Use of Same Variable for Multiple Purposes

Official page ↗
Abstraction
Base
Structure
Simple
Status
Incomplete
Languages
Not Language-Specific, Python
CWE version
5.0

Description

The code contains a callable, block, or other code element in which the same variable is used to control more than one unique task or store more than one instance of data.

Common consequences

• Other: Reduce Maintainability — This issue makes it more difficult to maintain the product, which indirectly affects security by making it more difficult or time-consuming to find and/or fix vulnerabilities. It also might make it easier to introduce vulnerabilities. • Other: Increase Analytical Complexity — Use of the same variable for multiple purposes can make it more difficult for a person to read or understand the code, potentially hiding other quality issues.

Observed examples

• CVE-2023-26463: Chain: IPSec VPN product uses the same variable for multiple purposes in the same function (CWE-1109), leading to incorrect access control (CWE-284) and expired pointer dereference (CWE-825)

Related

Observed example · CVE (1)

  • CVE-2023-26463 strongSwan 5.9.8 and 5.9.9 potentially allows remote code execution because it uses a variable named "public" for two different purposes… vulnerability

Child of · CWE (1)

  • CWE-1078 Inappropriate Source Code Style or Formatting weakness