[1.3.x] Advance Importer

Created on 29 May 2024, 28 days ago

Advance importer is migration tool to import contents via JSON, XML & CSV format. Can be also export as JSON, XML & CSV.

On XML import, found simplexml_load_file function has vulnerability https://nvd.nist.gov/vuln/detail/CVE-2021-21707
CVE-2021-21707 Detail
Description
In PHP versions 7.3.x below 7.3.33, 7.4.x below 7.4.26 and 8.0.x below 8.0.13, certain XML parsing functions, like simplexml_load_file(), URL-decode the filename passed to them. If that filename contains URL-encoded NUL character, this may cause the function to interpret this as the end of the filename, thus interpreting the filename differently from what the user intended, which may lead it to reading a different file than intended.

src/Plugin/Processor/XML.php

  /**
   * Get contents from xml file.
   *
   * @return array
   *   The key|value.
   * */
  public function getContents($start, $end) {
    $content = [];
    $xml = simplexml_load_file($this->getFilePath());
    if (empty($xml)) {
      return FALSE;
    }
    $contents = json_decode(json_encode($xml), TRUE);
    foreach ($contents['ITEM'] as $count => $fields) {
      if ($count >= $start && $count < $end) {
        $content[] = $this->parseFields($fields);
      }
    }
    return $content;
  }

Project link

https://www.drupal.org/project/advance_importer →

📌 Task
Status

Needs work

Component

module

Created by

🇵🇭Philippines _renify_ cebu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024