CVE-2020-22278: phpMyAdmin CSV Injection Vulnerability

phpmyadmin Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2020-22278: phpMyAdmin through 5.0.2 allows CSV injection via Export Section. Affects phpmyadmin versions < 5.0.3. Fixed in 5.0.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

phpMyAdmin is a popular open-source tool for managing MySQL databases. It provides a web-based interface that allows users to perform various database management tasks, such as creating tables, executing queries, and exporting data. This vulnerability affects phpMyAdmin versions up to 5.0.2.

Vulnerability Detail

The vulnerability, identified as CVE-2020-22278, involves CSV injection via the Export Section of phpMyAdmin. This means that an attacker can manipulate the exported CSV file to inject malicious content into it. The vendor disputes this claim, stating that the CSV file is accurately generated based on the database contents. However, independent analysis confirms the presence of this vulnerability.

How To Fix

Minimum fixed version

5.0.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to immediately update phpMyAdmin, you can implement a workaround by manually sanitizing the exported CSV files. This involves inspecting the exported data and removing any potentially malicious content before using the file. Here is an example code snippet in PHP that demonstrates how to sanitize a CSV file:

<?php
function sanitizeCSV($filePath) {
  $file = fopen($filePath, 'r');
  $sanitizedData = '';

  while (($data = fgetcsv($file)) !== false) {
    // Sanitize each row of data
    $sanitizedRow = array_map('sanitizeValue', $data);
    $sanitizedData .= implode(',', $sanitizedRow) . "\n";
  }

  fclose($file);

  // Write the sanitized data back to the file
  file_put_contents($filePath, $sanitizedData);
}

function sanitizeValue($value) {
  // Implement your sanitization logic here
  // e.g., remove any characters that could be used for injection
  return $value;
}

sanitizeCSV('path/to/exported.csv');

Make sure to customize the sanitizeValue function according to your specific sanitization requirements.

Conclusion

In conclusion, phpMyAdmin versions up to 5.0.2 are vulnerable to CSV injection, allowing attackers to manipulate exported CSV files. To mitigate this issue, it is recommended to update phpMyAdmin to the latest version or apply the provided workaround. Remember to sanitize any exported CSV files manually if immediate updates are not possible. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for phpmyadmin →

Share this vulnerability

FAQ

CSV injection is a technique where an attacker manipulates the content of a CSV file to execute arbitrary commands or inject malicious code when the file is opened or imported by a vulnerable application.

If successfully exploited, an attacker could inject malicious content into the exported CSV file. When opened or imported by another application, this content could lead to various security issues, such as code execution, data manipulation, or unauthorized access.

At the time of this report, there is no evidence of active exploitation of this vulnerability. However, it is crucial to apply the necessary patches or workarounds to prevent potential attacks.

While firewalls and other security measures can help protect your system from external threats, they cannot directly mitigate this specific vulnerability. It is recommended to update phpMyAdmin or apply the provided workaround to address the issue.

You can find more information about this vulnerability, including technical details and the latest updates, in the official vulnerability report available at: https://github.com/bitnami/vulndb/tree/main/data/phpmyadmin/BIT-phpmyadmin-2020-22278.json

Related vulnerabilities

Recent vulnerabilities recorded for phpmyadmin.

How To Fix

Minimum fixed version

5.0.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback