Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-627:Dynamic Variable Evaluation
Weakness ID:627
Version:v4.17
Weakness Name:Dynamic Variable Evaluation
Vulnerability Mapping:Allowed
Abstraction:Variant
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.

▼Extended Description

The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.

▼Alternate Terms
Dynamic evaluation

▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowedB914Improper Control of Dynamically-Identified Variables
PeerOfAllowedB183Permissive List of Allowed Inputs
Nature: ChildOf
Mapping: Allowed
Type: Base
ID: 914
Name: Improper Control of Dynamically-Identified Variables
Nature: PeerOf
Mapping: Allowed
Type: Base
ID: 183
Name: Permissive List of Allowed Inputs
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedV884CWE Cross-section
MemberOfProhibitedC990SFP Secondary Cluster: Tainted Input to Command
MemberOfProhibitedC1409Comprehensive Categorization: Injection
Nature: MemberOf
Mapping: Prohibited
Type:View
ID: 884
Name: CWE Cross-section
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 990
Name: SFP Secondary Cluster: Tainted Input to Command
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1409
Name: Comprehensive Categorization: Injection
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-250Weaknesses in Software Written in Perl
MemberOfProhibitedBSBOSS-279Input Validation Strategy
MemberOfProhibitedBSBOSS-281Refactoring Strategy
MemberOfProhibitedBSBOSS-311Execute Unauthorized Code or Commands (impact)
MemberOfProhibitedBSBOSS-318Modify Application Data (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-250
Name: Weaknesses in Software Written in Perl
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-279
Name: Input Validation Strategy
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-281
Name: Refactoring Strategy
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-311
Name: Execute Unauthorized Code or Commands (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-318
Name: Modify Application Data (impact)
▼Relevant To View
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC990SFP Secondary Cluster: Tainted Input to Command
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 990
Name: SFP Secondary Cluster: Tainted Input to Command
▼Background Detail

Many interpreted languages support the use of a "$$varname" construct to set a variable whose name is specified by the $varname variable. In PHP, these are referred to as "variable variables." Functions might also be invoked using similar syntax, such as $$funcname(arg1, arg2).

▼Common Consequences
ScopeLikelihoodImpactNote
ConfidentialityIntegrityAvailabilityN/AModify Application DataExecute Unauthorized Code or Commands

An attacker could gain unauthorized access to internal program variables and execute arbitrary code.

Scope: Confidentiality, Integrity, Availability
Likelihood: N/A
Impact: Modify Application Data, Execute Unauthorized Code or Commands
Note:

An attacker could gain unauthorized access to internal program variables and execute arbitrary code.

▼Potential Mitigations
Phase:Implementation
Mitigation ID:
Strategy: Refactoring
Effectiveness:
Description:

Refactor the code to avoid dynamic variable evaluation whenever possible.

Note:


Phase:Implementation
Mitigation ID:
Strategy: Input Validation
Effectiveness:
Description:

Use only allowlists of acceptable variable or function names.

Note:


Phase:Implementation
Mitigation ID:
Strategy:
Effectiveness:
Description:

For function names, ensure that you are only calling functions that accept the proper number of arguments, to avoid unexpected null arguments.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
Languages
Class: PHP(Undetermined Prevalence)
Class: Perl(Undetermined Prevalence)
▼Demonstrative Examples
▼Observed Examples
ReferenceDescription
CVE-2009-0422
Chain: Dynamic variable evaluation allows resultant remote file inclusion and path traversal.
CVE-2007-2431
Chain: dynamic variable evaluation in PHP program used to modify critical, unexpected $_SERVER variable for resultant XSS.
CVE-2006-4904
Chain: dynamic variable evaluation in PHP program used to conduct remote file inclusion.
CVE-2006-4019
Dynamic variable evaluation in mail program allows reading and modifying attachments and preferences of other users.
Reference: CVE-2009-0422
Description:
Chain: Dynamic variable evaluation allows resultant remote file inclusion and path traversal.
Reference: CVE-2007-2431
Description:
Chain: dynamic variable evaluation in PHP program used to modify critical, unexpected $_SERVER variable for resultant XSS.
Reference: CVE-2006-4904
Description:
Chain: dynamic variable evaluation in PHP program used to conduct remote file inclusion.
Reference: CVE-2006-4019
Description:
Dynamic variable evaluation in mail program allows reading and modifying attachments and preferences of other users.
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      Primary
      N/A
      Ordinality: Primary
      Description:
      N/A
      ▼Detection Methods
      ▼Vulnerability Mapping Notes
      Usage:Allowed
      Reason:Acceptable-Use
      Rationale:

      This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

      Comments:

      Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

      Suggestions:
      ▼Notes
      Research Gap

      Under-studied, probably under-reported. Few researchers look for this issue; most public reports are for PHP, although other languages are affected. This issue is likely to grow in PHP as developers begin to implement functionality in place of register_globals.

      N/A

      ▼Taxonomy Mappings
      Taxonomy NameEntry IDFitEntry Name
      ▼Related Attack Patterns
      IDName
      ▼References
      Reference ID: REF-517
      Title: Dynamic Evaluation Vulnerabilities in PHP applications
      Author: Steve Christey
      Section:
      Publication:
      Full-Disclosure
      Publisher:
      Edition:
      URL:https://seclists.org/fulldisclosure/2006/May/35
      URL Date:2023-04-07
      Day:03
      Month:05
      Year:2006
      Reference ID: REF-518
      Title: A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications
      Author: Shaun Clowes
      Section:
      Publication:
      Publisher:
      Edition:
      URL:https://securereality.com.au/study-in-scarlett/
      URL Date:2023-04-07
      Day:N/A
      Month:N/A
      Year:N/A
      Details not found