# CVE-2018-15727: Grafana Authentication Bypass

> Attackers can bypass authentication and take over accounts by generating valid remember-me cookies for LDAP or OAuth users.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Aug 2018
- **Updated:** 5 Aug 2024
- **Also known as:** CVE-2018-558213, GHSA-rgjg-66cx-5x9m, GO-2022-0707, RHSA-2018:3829, UBUNTU-CVE-2018-15727

## What is CVE-2018-15727?

CVE-2018-15727 is a critical authentication bypass vulnerability in Grafana Grafana, published on 29 Aug 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Grafana 2.x, 3.x, and 4.x before 4.6.4 and 5.x before 5.2.3 allows authentication bypass because an attacker can generate a valid "remember me" cookie knowing only a username of an LDAP or OAuth user.

Weakness: CWE-287 (Improper Authentication)

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

5 open source packages ship an affected version, including github.com/grafana/grafana. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/grafana/grafana` | Go | All versions | 4.6.4+incompatible, 5.2.3+incompatible |
| `github.com/grafana/grafana` | Go | All versions | 4.6.4 |
| `github.com/grafana/grafana` | Go | All versions | 4.6.4 |
| `github.com/grafana/grafana` | Go | From 5.0.0 | 5.2.3 |
| `github.com/grafana/grafana` | Go | From 5.0.0 | 5.2.3 |
| `tendrl-gluster-integration` | Red Hat:storage:3.4:na:el7 | All versions | 0:1.6.3-13.el7rhgs |
| `tendrl-node-agent` | Red Hat:storage:3.4:na:el7 | All versions | 0:1.6.3-11.el7rhgs |
| `grafana` | Red Hat:storage:3.4:wa:el7 | All versions | 0:4.6.4-1.el7rhgs |
| `tendrl-ansible` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-10.el7rhgs |
| `tendrl-api` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-8.el7rhgs |
| `tendrl-api-httpd` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-8.el7rhgs |
| `tendrl-grafana-plugins` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-16.el7rhgs |
| `tendrl-monitoring-integration` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-16.el7rhgs |
| `tendrl-node-agent` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-11.el7rhgs |
| `tendrl-ui` | Red Hat:storage:3.4:wa:el7 | All versions | 0:1.6.3-14.el7rhgs |

Products: Grafana Grafana, Redhat Ceph Storage.

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

Upgrade github.com/grafana/grafana to a fixed version for your release line: 4.6.4+incompatible, 5.2.3+incompatible, 4.6.4 or 5.2.3.

## Is CVE-2018-15727 being exploited?

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

Public exploit code:

- a small utility to generate a cookie in order to exploit a grafana vulnerability (CVE-2018-15727) (github_poc): https://github.com/u238/grafana-CVE-2018-15727
- Grafana 2.0 through 5.2.2 authentication bypass for LDAP and OAuth (metasploit)

## Other vulnerabilities in Grafana Grafana

- [CVE-2021-43798](https://insights.sbomify.com/CVE-2021-43798/): Grafana Path Traversal (high 7.5, exploited in the wild)
- [CVE-2025-41115](https://insights.sbomify.com/CVE-2025-41115/): Incorrect privilege assignment (critical 10.0)
- [CVE-2022-39328](https://insights.sbomify.com/CVE-2022-39328/): Grafana vulnerable to race condition allowing privilege escalation (critical 9.8)
- [CVE-2022-28660](https://insights.sbomify.com/CVE-2022-28660/): Auth bypass in n/a (critical 9.8)
- [CVE-2022-26148](https://insights.sbomify.com/CVE-2022-26148/): Information disclosure in n/a (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2018-15727 is a critical authentication bypass vulnerability in Grafana Grafana, published on 29 Aug 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2018-15727 exists.

Affected packages and fixed versions:
- github.com/grafana/grafana (Go): affected all versions; fixed in 4.6.4+incompatible, 5.2.3+incompatible
- github.com/grafana/grafana (Go): affected all versions; fixed in 4.6.4
- github.com/grafana/grafana (Go): affected all versions; fixed in 4.6.4
- github.com/grafana/grafana (Go): affected from 5.0.0; fixed in 5.2.3
- github.com/grafana/grafana (Go): affected from 5.0.0; fixed in 5.2.3

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-15727/ (Markdown: https://insights.sbomify.com/CVE-2018-15727/index.md)
```

## Sources

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

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