VYPR
Medium severity6.5NVD Advisory· Published Nov 17, 2011· Updated Apr 29, 2026

CVE-2011-4107

CVE-2011-4107

Description

The simplexml_load_string function in the XML import plug-in (libraries/import/xml.php) in phpMyAdmin 3.4.x before 3.4.7.1 and 3.3.x before 3.3.10.5 allows remote authenticated users to read arbitrary files via XML data containing external entity references, aka an XML external entity (XXE) injection attack.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
phpmyadmin/phpmyadminPackagist
>= 3.4.0, < 3.4.7.13.4.7.1
phpmyadmin/phpmyadminPackagist
>= 3.3.0, < 3.3.10.53.3.10.5

Affected products

5
  • cpe:2.3:a:phpmyadmin:phpmyadmin:*:*:*:*:*:*:*:*
    Range: >=3.3.0.0,<3.3.10.5
  • cpe:2.3:o:debian:debian_linux:5.0:*:*:*:*:*:*:*
  • cpe:2.3:o:fedoraproject:fedora:14:*:*:*:*:*:*:*+ 2 more
    • cpe:2.3:o:fedoraproject:fedora:14:*:*:*:*:*:*:*
    • cpe:2.3:o:fedoraproject:fedora:15:*:*:*:*:*:*:*
    • cpe:2.3:o:fedoraproject:fedora:16:*:*:*:*:*:*:*

Patches

4
34d99de000de

Disable XML loading plugins on old PHP

https://github.com/phpmyadmin/phpmyadminMichal ČihařNov 7, 2011via ghsa
2 files changed · +16 6
  • libraries/import/ods.php+8 3 modified
    @@ -13,6 +13,13 @@
         exit;
     }
     
    +/**
    + * We need way to disable external XML entities processing.
    + */
    +if (!function_exists('libxml_disable_entity_loader')) {
    +    return;
    +}
    +
     /**
      * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
      */
    @@ -66,9 +73,7 @@
     /**
      * Disable loading of external XML entities.
      */
    -if (function_exists('libxml_disable_entity_loader')) {
    -    libxml_disable_entity_loader();
    -}
    +libxml_disable_entity_loader();
     
     /**
      * Load the XML string
    
  • libraries/import/xml.php+8 3 modified
    @@ -12,6 +12,13 @@
         exit;
     }
     
    +/**
    + * We need way to disable external XML entities processing.
    + */
    +if (!function_exists('libxml_disable_entity_loader')) {
    +    return;
    +}
    +
     /**
      * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
      */
    @@ -59,9 +66,7 @@
     /**
      * Disable loading of external XML entities.
      */
    -if (function_exists('libxml_disable_entity_loader')) {
    -    libxml_disable_entity_loader();
    -}
    +libxml_disable_entity_loader();
     
     /**
      * Load the XML string
    
2fbf631384fd

Disable XML loading plugins on old PHP

https://github.com/phpmyadmin/phpmyadminMichal ČihařNov 7, 2011via ghsa
2 files changed · +16 6
  • libraries/import/ods.php+8 3 modified
    @@ -13,6 +13,13 @@
         exit;
     }
     
    +/**
    + * We need way to disable external XML entities processing.
    + */
    +if (!function_exists('libxml_disable_entity_loader')) {
    +    return;
    +}
    +
     /**
      * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
      */
    @@ -64,9 +71,7 @@
     /**
      * Disable loading of external XML entities.
      */
    -if (function_exists('libxml_disable_entity_loader')) {
    -    libxml_disable_entity_loader();
    -}
    +libxml_disable_entity_loader();
     
     /**
      * Load the XML string
    
  • libraries/import/xml.php+8 3 modified
    @@ -12,6 +12,13 @@
         exit;
     }
     
    +/**
    + * We need way to disable external XML entities processing.
    + */
    +if (!function_exists('libxml_disable_entity_loader')) {
    +    return;
    +}
    +
     /**
      * The possible scopes for $plugin_param are: 'table', 'database', and 'server'
      */
    @@ -59,9 +66,7 @@
     /**
      * Disable loading of external XML entities.
      */
    -if (function_exists('libxml_disable_entity_loader')) {
    -    libxml_disable_entity_loader();
    -}
    +libxml_disable_entity_loader();
     
     /**
      * Load the XML string
    
a5e206fbd2ca

Disable loading of external XML entities when loading XML

https://github.com/phpmyadmin/phpmyadminMichal ČihařNov 7, 2011via ghsa
2 files changed · +33 19
  • libraries/import/ods.php+7 0 modified
    @@ -63,6 +63,13 @@
     
     unset($data);
     
    +/**
    + * Disable loading of external XML entities.
    + */
    +if (function_exists('libxml_disable_entity_loader')) {
    +    libxml_disable_entity_loader();
    +}
    +
     /**
      * Load the XML string
      *
    
  • libraries/import/xml.php+26 19 modified
    @@ -56,6 +56,13 @@
     
     unset($data);
     
    +/**
    + * Disable loading of external XML entities.
    + */
    +if (function_exists('libxml_disable_entity_loader')) {
    +    libxml_disable_entity_loader();
    +}
    +
     /**
      * Load the XML string
      *
    @@ -141,19 +148,19 @@
          * Get structures for all tables
          */
         $struct = $xml->children($namespaces['pma']);
    -    
    +
         $create = array();
    -    
    +
         foreach ($struct as $tier1 => $val1) {
             foreach($val1 as $tier2 => $val2) {
                 /* Need to select the correct database for the creation of tables, views, triggers, etc. */
                 /**
    -             * @todo    Generating a USE here blocks importing of a table 
    -             *          into another database. 
    +             * @todo    Generating a USE here blocks importing of a table
    +             *          into another database.
                  */
                 $attrs = $val2->attributes();
                 $create[] = "USE " . PMA_backquote($attrs["name"]);
    -            
    +
                 foreach ($val2 as $val3) {
                     /**
                      * Remove the extra cosmetic spacing
    @@ -163,7 +170,7 @@
                 }
             }
         }
    -    
    +
         $struct_present = true;
     }
     
    @@ -179,25 +186,25 @@
      */
     if (@count($xml->children())) {
         $data_present = true;
    -    
    +
         /**
          * Process all database content
          */
         foreach ($xml as $k1 => $v1) {
             $tbl_attr = $v1->attributes();
    -        
    +
             $isInTables = false;
             for ($i = 0; $i < count($tables); ++$i) {
                 if (! strcmp($tables[$i][TBL_NAME], (string)$tbl_attr['name'])) {
                     $isInTables = true;
                     break;
                 }
             }
    -        
    +
             if ($isInTables == false) {
                 $tables[] = array((string)$tbl_attr['name']);
             }
    -        
    +
             foreach ($v1 as $k2 => $v2) {
                 $row_attr = $v2->attributes();
                 if (! array_search((string)$row_attr['name'], $tempRow))
    @@ -206,17 +213,17 @@
                 }
                 $tempCells[] = (string)$v2;
             }
    -        
    +
             $rows[] = array((string)$tbl_attr['name'], $tempRow, $tempCells);
    -        
    +
             $tempRow = array();
             $tempCells = array();
         }
    -    
    +
         unset($tempRow);
         unset($tempCells);
         unset($xml);
    -    
    +
         /**
          * Bring accumulated rows into the corresponding table
          */
    @@ -227,17 +234,17 @@
                     if (! isset($tables[$i][COL_NAMES])) {
                         $tables[$i][] = $rows[$j][COL_NAMES];
                     }
    -                
    +
                     $tables[$i][ROWS][] = $rows[$j][ROWS];
                 }
             }
         }
    -    
    +
         unset($rows);
    -    
    +
         if (! $struct_present) {
             $analyses = array();
    -        
    +
             $len = count($tables);
             for ($i = 0; $i < $len; ++$i) {
                 $analyses[] = PMA_analyzeTable($tables[$i]);
    @@ -289,7 +296,7 @@
         if ($db_name === NULL) {
             $db_name = 'XML_DB';
         }
    -    
    +
         /* Set database collation/charset */
         $options = array(
             'db_collation' => $collation,
    
5fa86b8e8156

Disable loading of external XML entities when loading XML

https://github.com/phpmyadmin/phpmyadminMichal ČihařNov 7, 2011via ghsa
2 files changed · +33 19
  • libraries/import/ods.php+7 0 modified
    @@ -61,6 +61,13 @@
     
     unset($data);
     
    +/**
    + * Disable loading of external XML entities.
    + */
    +if (function_exists('libxml_disable_entity_loader')) {
    +    libxml_disable_entity_loader();
    +}
    +
     /**
      * Load the XML string
      *
    
  • libraries/import/xml.php+26 19 modified
    @@ -56,6 +56,13 @@
     
     unset($data);
     
    +/**
    + * Disable loading of external XML entities.
    + */
    +if (function_exists('libxml_disable_entity_loader')) {
    +    libxml_disable_entity_loader();
    +}
    +
     /**
      * Load the XML string
      *
    @@ -141,19 +148,19 @@
          * Get structures for all tables
          */
         $struct = $xml->children($namespaces['pma']);
    -    
    +
         $create = array();
    -    
    +
         foreach ($struct as $tier1 => $val1) {
             foreach($val1 as $tier2 => $val2) {
                 /* Need to select the correct database for the creation of tables, views, triggers, etc. */
                 /**
    -             * @todo    Generating a USE here blocks importing of a table 
    -             *          into another database. 
    +             * @todo    Generating a USE here blocks importing of a table
    +             *          into another database.
                  */
                 $attrs = $val2->attributes();
                 $create[] = "USE " . PMA_backquote($attrs["name"]);
    -            
    +
                 foreach ($val2 as $val3) {
                     /**
                      * Remove the extra cosmetic spacing
    @@ -163,7 +170,7 @@
                 }
             }
         }
    -    
    +
         $struct_present = true;
     }
     
    @@ -179,25 +186,25 @@
      */
     if (@count($xml->children())) {
         $data_present = true;
    -    
    +
         /**
          * Process all database content
          */
         foreach ($xml as $k1 => $v1) {
             $tbl_attr = $v1->attributes();
    -        
    +
             $isInTables = false;
             for ($i = 0; $i < count($tables); ++$i) {
                 if (! strcmp($tables[$i][TBL_NAME], (string)$tbl_attr['name'])) {
                     $isInTables = true;
                     break;
                 }
             }
    -        
    +
             if ($isInTables == false) {
                 $tables[] = array((string)$tbl_attr['name']);
             }
    -        
    +
             foreach ($v1 as $k2 => $v2) {
                 $row_attr = $v2->attributes();
                 if (! array_search((string)$row_attr['name'], $tempRow))
    @@ -206,17 +213,17 @@
                 }
                 $tempCells[] = (string)$v2;
             }
    -        
    +
             $rows[] = array((string)$tbl_attr['name'], $tempRow, $tempCells);
    -        
    +
             $tempRow = array();
             $tempCells = array();
         }
    -    
    +
         unset($tempRow);
         unset($tempCells);
         unset($xml);
    -    
    +
         /**
          * Bring accumulated rows into the corresponding table
          */
    @@ -227,17 +234,17 @@
                     if (! isset($tables[$i][COL_NAMES])) {
                         $tables[$i][] = $rows[$j][COL_NAMES];
                     }
    -                
    +
                     $tables[$i][ROWS][] = $rows[$j][ROWS];
                 }
             }
         }
    -    
    +
         unset($rows);
    -    
    +
         if (! $struct_present) {
             $analyses = array();
    -        
    +
             $len = count($tables);
             for ($i = 0; $i < $len; ++$i) {
                 $analyses[] = PMA_analyzeTable($tables[$i]);
    @@ -289,7 +296,7 @@
         if ($db_name === NULL) {
             $db_name = 'XML_DB';
         }
    -    
    +
         /* Set database collation/charset */
         $options = array(
             'db_collation' => $collation,
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

23

News mentions

0

No linked articles in our index yet.