Skip to content
OpenAdvisories

Weakness (CWE)

CWE-621: Variable Extraction Error

Variant Incomplete

The product uses external input to determine the names of variables into which information is extracted, without verifying that the names of the specified variables are valid.

How to prevent it (3 mitigations)
  1. Implementation

    Use allowlists of variable names that can be extracted.

  2. Implementation

    Consider refactoring your code to avoid extraction routines altogether.

  3. Implementation

    In PHP, call extract() with options such as EXTR_SKIP and EXTR_PREFIX_ALL; call import_request_variables() with a prefix argument. Note that these capabilities are not present in all PHP versions.

Source: MITRE CWE-621

1 result · Clear filters · Feed

  • Critical 9.8

    Multipart-file uploads call variables to be improperly registered in the global scope. In cases where variables are not…