Skip to content
KitploitKITPLOIT
ИнструментыЭксплойтыБлог
Log in
Отправить
ИнструментыЭксплойтыБлог
Отправить

Инструменты для хакинга, пентеста и кибербезопасности — ваш арсенал защиты!

Kitploit — это каталог инструментов для хакинга, кибербезопасности и пентестинга. Находите последние обновления проектов для поиска уязвимостей, анализа систем, автоматизации тестирования и усиления вашей безопасности.

ЛентыКонтактыКонфиденциальность© 2026 Kitploit

Каталог инструментов

Категории

Все категории
Loading categories
CVE-2026-126147 — Containerised PoC and lab for CVE-2026-126147, an unauthenticated path traversal in the FortiMail management API that enables arbitrary file write and root code execution. | Kitploit
Инструменты/GitHubGitHub/googlesky/cve-2026-126147
Container SecurityVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationLabs & Practice
GitHubgooglesky/cve-2026-126147

CVE-2026-126147

Containerised PoC and lab for CVE-2026-126147, an unauthenticated path traversal in the FortiMail management API that enables arbitrary file write and root code execution.

Репозиторий
6 дней назадЕщё не проверено
Поделиться
Контент недоступен на запрошенном языке. Показываем английскую версию.

CVE-2026-126147 — FortiMail management interface path traversal (arbitrary file write → command execution)

CVECVE-2026-126147
ComponentFortinet FortiMail — web management interface API
AdvisoryFortinet PSIRT FG-IR-26-199, published 2026-11-10
AffectedFortiMail 8.0.0 – 8.0.1, 7.6.0 – 7.6.6, 7.4.0 – 7.4.8, 7.2 all versions
Fixed inFortiMail 8.0.2, 7.6.7, 7.4.9; migrate off 7.2
CWECWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
ImpactUnauthenticated remote code execution as the appliance service account (root on the appliance)
VectorNetwork, unauthenticated — a crafted request to the management interface API
TriggerThe caller-supplied path component of a file write or file read request
CreditFortinet PSIRT

Fortinet's advisory (FG-IR-26-199) describes an improper limitation of a pathname to a restricted directory in FortiMail and states that the flaw "may allow an unauthenticated attacker to execute unauthorized code or commands via crafted requests". The component is the FortiMail API, and the vector is a request that carries a path the appliance is not supposed to leave its restricted data directory.

That is exactly the shape of the defect reproduced here. A management-interface request carries a caller-supplied path. The appliance joins it to a restricted root directory and hands the result to the file system. Nothing constrains the joined path to the root, so ../ leaves it. The file lands wherever the attacker chose, and on FortiMail that includes the directories the appliance reads and executes — which turns a directory traversal into "execute unauthorized code or commands" without any authentication, any prior access and any user interaction.

This repository contains a containerised laboratory that reproduces the flaw end to end, a differential against the patched behaviour, a payload and endpoint sweep against the patched line, and the result of testing the mitigation in the two forms it can take.


1. Scope and fidelity of this laboratory

FortiMail is proprietary software. None of its code, binaries or configuration are redistributed here, and Fortinet does not publish the management interface's endpoint list or its path handling. What is reproducible here is therefore:

  • the vendor's own statement of the defect — CWE-22, API component, unauthenticated, crafted requests, CVSS 9.8, and the affected/fixed version matrix — taken from FG-IR-26-199 and the CVE record;
  • the security-relevant behaviour of the management interface — a set of unauthenticated endpoints that accept a caller-supplied path, a restricted data directory, a linked data directory, and an appliance script directory that the maintenance task runner executes;
  • the file-system semantics that turn a traversal into code execution. These are properties of POSIX path resolution and of the appliance's own layout, not of FortiMail's source code.

Everything this repository asserts about the vendor product is sourced from the advisory. Everything it asserts about the model is labelled as such. The model is the only thing that runs in the laboratory, and it is built so that the vulnerable and the patched behaviour differ in the path handling alone.

The model lives in lab/fortimail_web.py and is selected with FML_MODE:

FML_MODEbehaviourversion reported
vulnthe caller-supplied path is joined to the restricted root with no normalisation and no containment check — the traversal escapes8.0.1
fixedthe joined path is resolved and the resolved path must stay inside the restricted root; every write and read that leaves it is refused8.0.2
fixed-partiala remediation shape that compares the un-normalised joined path against the root with a string prefix test8.0.2

fixed-partial is not a claim about the vendor's patch. It is the shape a hurried fix takes, and it exists here so that the sweep has a target that is neither the vulnerable build nor a correct one.

Three properties of the model are worth stating explicitly, because each of them changes what an attacker can do and each of them is a property of the appliance rather than of the exploit:

  • the management interface decodes the caller-supplied path a second time before using it, so a percent-encoded traversal is decoded twice in total;
  • the path handling truncates at a NUL byte, the way a C implementation of it does;
  • the restricted data directory contains a linked data directory (shared-link) that points at the appliance script directory.

2. Root cause

The whole defect is the path handling. In the model it is three functions, and the vulnerable and the patched build differ in one of them.

The vulnerable build joins the caller-supplied name to the restricted root and returns the result, with no normalisation and no containment check — lab/fortimail_web.py:141:

    if MODE == "vuln":
        # FortiMail 8.0.1 model: the caller-supplied name is appended to the
        # restricted root and handed to the file system as it is.
        try:
            return os.path.join(ROOT, name), None
        except (OSError, ValueError) as exc:
            return None, "invalid path: %s" % exc

os.path.join() is a string operation. It does not resolve .., it does not notice that the second component is absolute, and it does not care that the result leaves the directory it was supposed to stay in. For the name ../exec/pwn.sh and the root /opt/lab/store it returns:

/opt/lab/store/../exec/pwn.sh

which the file system resolves to:

/opt/lab/exec/pwn.sh

The patched build resolves the path first and then requires containment — lab/fortimail_web.py:156:

    # FortiMail 8.0.2 model: resolve, then require containment.
    try:
        target = os.path.realpath(os.path.join(ROOT, name))
    except (OSError, ValueError) as exc:
        return None, "invalid path: %s" % exc
    if not _inside(target):
        return None, "path outside the restricted directory"
    return target, None

with the containment test at lab/fortimail_web.py:122:

def _inside(path):
    try:
        root = os.path.realpath(ROOT)
        real = os.path.realpath(path)
    except (OSError, ValueError):
        return False
    return real == root or real.startswith(root + os.sep)

realpath() is what makes the check meaningful. It collapses .., it resolves symlinks, and it makes the comparison against the root a comparison of two absolute, fully-resolved paths. A path that merely starts with the root is not inside the root, and the patched build refuses it with HTTP 403.

The write itself carries no authorization. The management interface in the model serves the API without an authentication gate, because the advisory rates the flaw AV:N/AC:L/PR:N/UI:N — the request is processed before any authentication decision. lab/fortimail_web.py:371:

            target, perr = resolve_write(name)
            record_write(route, name, target, perr)
            if perr:
                self._json(403, {"error": perr, "path": name})
                return
            werr = write_file(target, data)

The sink

The traversal becomes code execution because the appliance executes what lands in its script directory. lab/fortimail_web.py:219:

Скачать инструмент

Популярное

Смотреть все →

Откройте для себя самые используемые инструменты нашего сообщества.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 Полный набор инструментов OSINT: граф расследования, оценка достоверности, семейства псевдонимов, карта, временная шкала и отчёты. 49 модулей, более 400 сайтов, API-ключи не требуются.

    938
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Приложение GhostLock с запуском в один клик (CVE-2026-43499)

    556
  • 3

    redforge

    cybersecurity91/redforge

    Браузерный инструментарий для red team с 102 офлайн-инструментами для разведки, генерации полезной нагрузки, атак на учётные данные, криптографии, кодирования и отчётности по проектам.

    352
  • 4

    ARTEX

    baarai/artex

    Платформа автономного тестирования на проникновение на основе мультиагентной LLM с агентами-планировщиками и агентами-исполнителями, графами активов и исследования, записью MITM-трафика и повторной проверкой уязвимостей.

    343
  • 5

    looking-glass

    anonghosty/looking-glass

    Платформа CSIRT, которая загружает отчёты Shadowserver в MongoDB и воспроизводит их в виде интерактивных карт, аналитики, результатов, рекомендаций и исполнительных дашбордов.

    336
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    Система действий для кибербезопасности на базе ИИ — где намерение превращается в управляемое исполнение, доказательства становятся оперативной памятью, а каждая операция улучшает следующую.

    291

Изучить все инструменты

Просмотрите нашу коллекцию инструментов

Смотреть все инструменты →