# CVE-2018-12613: phpMyAdmin Improper Authentication

> Authenticated attackers can include arbitrary files to execute code or read data, with unauthenticated access possible under specific non-default configurations.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Jun 2018
- **Updated:** 5 Aug 2024
- **Also known as:** GHSA-x394-g9j8-x7mf

## What is CVE-2018-12613?

CVE-2018-12613 is a high-severity path traversal vulnerability in Phpmyadmin Phpmyadmin, published on 21 Jun 2018. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

An issue was discovered in phpMyAdmin 4.8.x before 4.8.2, in which an attacker can include (view and potentially execute) files on the server. The vulnerability comes from a portion of code where pages are redirected and loaded within phpMyAdmin, and an improper test for whitelisted pages. An attacker must be authenticated, except in the "$cfg['AllowArbitraryServer'] = true" case (where an attacker can specify any host he/she is already in control of, and execute arbitrary code on phpMyAdmin) and the "$cfg['ServerDefault'] = 0" case (which bypasses the login requirement and runs the vulnerable code without any authentication).

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2018-12613?

2 open source packages ship an affected version, including phpmyadmin/phpmyadmin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phpmyadmin/phpmyadmin` | Packagist | From 4.8 | 4.8.2 |
| `phpmyadmin/phpmyadmin` | Packagist | From 4.8 | 4.8.2 |

Products: Phpmyadmin Phpmyadmin.

## How do I fix CVE-2018-12613?

Upgrade phpmyadmin/phpmyadmin to 4.8.2 or later.

## Is CVE-2018-12613 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-12613 exists.

Public exploit code:

- PHPMyAdmin v4.8.0 and v.4.8.1 LFI exploit (github_poc): https://github.com/0x00-0x00/CVE-2018-12613
- Modified standalone exploit ported for Python 3 (github_poc): https://github.com/ivanitlearning/CVE-2018-12613
- 这篇文章将分享一个phpMyAdmin 4.8.1版本的文件包含漏洞，从配置到原理，再到漏洞复现进行讲解，更重要的是让大家了解这些真实漏洞背后的知识。基础性文章，希望对您有所帮助！ (github_poc): https://github.com/eastmountyxz/CVE-2018-12613-phpMyAdmin
- phpMyAdmin Authenticated Remote Code Execution (metasploit)
- phpMyAdmin 4.8.1 - (Authenticated) Local File Inclusion (1) (exploitdb)
- phpMyAdmin 4.8.1 - (Authenticated) Local File Inclusion (2) (exploitdb)

## Other vulnerabilities in Phpmyadmin Phpmyadmin

- [CVE-2008-7251](https://insights.sbomify.com/CVE-2008-7251/): Misconfiguration in n/a (critical 10.0)
- [CVE-2008-7252](https://insights.sbomify.com/CVE-2008-7252/): phpMyAdmin unsafely handles temporary files (critical 10.0)
- [CVE-2007-0203](https://insights.sbomify.com/CVE-2007-0203/): Other in n/a (critical 10.0)
- [CVE-2004-1147](https://insights.sbomify.com/CVE-2004-1147/): Command injection in n/a (critical 10.0)
- [CVE-2020-22452](https://insights.sbomify.com/CVE-2020-22452/): phpmyadmin contains SQL Injection vulnerability (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-12613 and fix it if it is affected.

What it is: CVE-2018-12613 is a high-severity path traversal vulnerability in Phpmyadmin Phpmyadmin, published on 21 Jun 2018. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-12613 exists.

Affected packages and fixed versions:
- phpmyadmin/phpmyadmin (Packagist): affected from 4.8; fixed in 4.8.2
- phpmyadmin/phpmyadmin (Packagist): affected from 4.8; fixed in 4.8.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2018-12613/ (Markdown: https://insights.sbomify.com/CVE-2018-12613/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2018-12613
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2018-12613
- OSV: https://osv.dev/vulnerability/CVE-2018-12613

---
From sbomify Insights: https://insights.sbomify.com/CVE-2018-12613/
Summaries are generated and may contain mistakes; the official description above is the record.
