Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-8053-MongoDB — Desc "CVE-2026-8053 CHECKER"-20260518-16h30-GMT+7 | Kitploit
Tools/GitHubGitHub/mgiay/cve-2026-8053-mongodb
Vulnerability ScannersVulnerability AnalysisConfiguration AuditingCloud SecurityDevSecOpsDatabase Security
GitHubmgiay/cve-2026-8053-mongodb

CVE-2026-8053-MongoDB

Desc "CVE-2026-8053 CHECKER"-20260518-16h30-GMT+7

View Repository
73 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-8053 — MongoDB Server Out-of-Bounds Write

Overview

AttributeValue
CVE IDCVE-2026-8053
Technical NameFlatBSON Duplicate Field Index Drift
Vulnerability TypeCWE-787 — Out-of-bounds Write
CVSS v4.08.7 (HIGH)
CVSS v3.18.8 (HIGH)
EPSS0.064% (20th percentile — low exploitation probability)
KEV (Known Exploited)Not recorded
Detection DateMongoDB Internal
Publication Date12/05/2026
Reserved Date06/05/2026
NVD StatusPUBLISHED / Awaiting Analysis

Detailed Description

Root Cause

The vulnerability exists in MongoDB Server's time-series collection system. Specifically, the error occurs due to:

An inconsistency in the mapping mechanism between field name and index inside the time-series bucket catalog.

When this mapping drifts, a write operation can cause an out-of-bounds write in the mongod process. Under certain conditions, this can escalate to Remote Code Execution.

Technical Context — FlatBSON & Time-Series Bucket Catalog

  • FlatBSON is an internal binary serialization format used by MongoDB, optimized over standard BSON for time-series operations.
  • Time-series bucket catalog is a data structure that manages "buckets" — each bucket contains multiple time-series data points grouped by time.
  • Inside this catalog, a mapping table (field-name → index) is maintained for fast field access. When this mapping suffers from duplicate or incorrect indexing (duplicate field index drift), subsequent write operations can write data outside the allocated memory range.

Exploitation Conditions

ConditionDescription
AuthenticationRequired — the attacker must have a valid MongoDB account
PrivilegesRequires write privilege to the database
User InteractionNone
NetworkExploitable remotely over network
ComplexityLow (attack complexity: LOW)

Affected Versions

MongoDB BranchAffected VersionsPatched Starting From
5.0< 5.0.33≥ 5.0.33
6.0< 6.0.28≥ 6.0.28
7.0< 7.0.34≥ 7.0.34
8.0< 8.0.23≥ 8.0.23
8.2< 8.2.9≥ 8.2.9
8.3< 8.3.2≥ 8.3.2

Note: Versions older than 5.0 (4.x, 3.x) are end-of-life (EOL). If you are running these versions, you must urgently upgrade to a supported branch.


Attack Vector (CVSS v4.0)```

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

root@kitploit:~
| Thành phần | Giá trị | Ý nghĩa |
|------------|---------|---------|
| AV (Attack Vector) | **Network (N)** | Remote exploitation over network |
| AC (Attack Complexity) | **Low (L)** | No special conditions required |
| AT (Attack Requirements) | **None (N)** | No prerequisites required |
| PR (Privileges Required) | **Low (L)** | Only a user with write privileges needed |
| UI (User Interaction) | **None (N)** | No victim interaction required |
| VC/VI/VA (Vulnerable System) | **High / High / High** | Entire CIA triad affected |
| SC/SI/SA (Subsequent System) | **None** | No impact on other systems |

---

## Remediation Guide

### 1. Primary measure: Upgrade MongoDB Server

This is the **only and thorough** measure. Upgrade MongoDB Server to the corresponding patched version:```bash
# Kiểm tra phiên bản hiện tại
mongod --version

# Debian/Ubuntu — nâng cấp qua APT
sudo apt update
sudo apt install -y mongodb-org=<phiên-bản-đã-vá>

# RHEL/CentOS/Rocky — nâng cấp qua YUM/DNF
sudo yum update mongodb-org-<phiên-bản-đã-vá>

# Docker — pull image mới
docker pull mongo:<phiên-bản-đã-vá>

Specific patched versions for each branch:

BranchSample upgrade command (APT)
5.0sudo apt install -y mongodb-org=5.0.33
6.0sudo apt install -y mongodb-org=6.0.28
7.0sudo apt install -y mongodb-org=7.0.34
8.0sudo apt install -y mongodb-org=8.0.23
8.2sudo apt install -y mongodb-org=8.2.9
8.3sudo apt install -y mongodb-org=8.3.2

2. Temporary mitigation measures (if immediate upgrade is not possible)

  • Limit write permissions — Review and revoke unnecessary write permissions for database users: ```javascript // Kiểm tra user có quyền ghi vào time-series collections db.getUsers({ showCredentials: false });
    root@kitploit:~
  • Log monitoring — Monitor MongoDB logs to detect signs of anomalies: ```bash tail -f /var/log/mongodb/mongod.log | grep -iE "error|assert|abort|segfault"
    root@kitploit:~
  • Network segmentation — Restrict network access to the MongoDB port (default 27017), only allow from trusted IPs: ```bash

    Sử dụng firewall (iptables / nftables / firewalld)

    sudo ufw allow from to any port 27017
    root@kitploit:~
  • Enable authentication — Ensure MongoDB is configured with authorization: enabled in mongod.conf: ```yaml security: authorization: enabled
    root@kitploit:~
  • Temporarily disable time-series collections — If not using the time-series feature, consider disabling or not creating time-series collections until the patch is applied.

3. Verify after upgrade```bash

1. Xác nhận phiên bản mới

mongod --version

2. Kiểm tra trạng thái service

sudo systemctl status mongod

3. Kết nối và kiểm tra

mongosh --eval "db.version()"

4. Chạy script scan (đính kèm trong repo này)

sudo bash CVE-2026-8053-MongoDB-Fixed.sh

root@kitploit:~
---

## Scanning Tool: `CVE-2026-8053-MongoDB-Fixed.sh`

Bash script that automatically scans and assesses whether a MongoDB Server is affected by CVE-2026-8053. The script is designed to run safely on **production** — all operations are **read-only**, no data is written to MongoDB.

### Key Features

| Feature | Description |
|---------|-------------|
| Installation detection | Automatically finds `mongod` binary path and shell (`mongosh`/`mongo`) |
| Version comparison | Checks installed version against the affected list (6 branches) |
| EOL detection | Alerts if MongoDB belongs to an end‑of‑life branch (4.4 and below) |
| Time‑series scan | Lists all time‑series collections across the entire cluster |
| Permission check | Lists users with write permissions — potential vulnerability exploit targets |
| Security check | Assesses `authorization`, `bindIp`, `TLS/SSL` configuration |
| Replica set support | Connects via connection string `mongodb://host:port/?replicaSet=name` |
| Multiple output modes | Normal (color), quiet (exit code), JSON (CI/CD) |
| Absolute safety | **0 write operations** — all MongoDB commands are read‑only |

### System Requirements

| Requirement | Detail |
|-------------|--------|
| Operating System | Linux (Ubuntu, Debian, RHEL, CentOS, Rocky, Alma, etc.) |
| Bash | ≥ 4.0 (supports associative arrays) |
| MongoDB Shell | `mongosh` (recommended) or `mongo` (legacy) |
| OS privileges | `sudo` / `root` (to read config file `/etc/mongod.conf`) |
| MongoDB privileges | User with read access to `system.users` and ability to run `listDatabases` |

### Command‑Line Options (CLI)

| Short Option | Long Option | Argument | Default | Description |
|--------------|-------------|----------|---------|-------------|
| `-h` | `--help` | — | — | Display help and exit |
| `-q` | `--quiet` | — | `false` | Output only essential results, use exit code to determine status |
| `-j` | `--json` | — | `false` | Output results as JSON (suitable for CI/CD pipelines) |
| `-H` | `--host` | `HOST` | `localhost` | MongoDB server address |
| `-P` | `--port` | `PORT` | `27017` | MongoDB port |
| `-u` | `--user` | `USER` | `super_admin` | MongoDB login name |
| `-p` | `--pass` | `PASS` | *(internal default value)* | MongoDB password |
| `-r` | `--replica-set` | `NAME` | `rs_cams` | Replica set name (if applicable) |
| — | `--auth-db` | `DB` | `admin` | Authentication database |
| — | `--no-color` | — | `false` | Disable ANSI color in output |

### 6‑Step Scanning Process

The script executes 6 sequential steps. Each step logs status with `[INFO]` / `[OK]` / `[WARN]` / `[ERROR]`.```
Bước 1: Phát hiện MongoDB installation
  ├─ Tìm mongod trong $PATH
  ├─ Duyệt các thư mục phổ biến:
  │   /usr/bin, /usr/local/bin, /opt/mongodb/bin, /usr/lib/mongodb, /snap/bin
  └─ Thất bại → exit 0 (không cài đặt = không bị ảnh hưởng)

Bước 2: Lấy phiên bản MongoDB
  ├─ Chạy: mongod --version
  ├─ Parse output: "db version v6.0.15" → "6.0.15"
  └─ Thất bại → exit 2 (lỗi không xác định)

Bước 3: So sánh phiên bản với danh sách bị ảnh hưởng
  ├─ Tách major.minor.patch bằng regex
  ├─ Kiểm tra EOL (4.4, 4.2, 4.0, 3.6, ...)
  ├─ Đối chiếu với bảng PATCHED_VERSIONS:
  │   ┌────────────┬──────────────┬────────┐
  │   │ Nhánh      │ Ngưỡng vá    │ Ví dụ  │
  │   ├────────────┼──────────────┼────────┤
  │   │ 5.0        │ patch ≥ 33   │ 5.0.33 │
  │   │ 6.0        │ patch ≥ 28   │ 6.0.28 │
  │   │ 7.0        │ patch ≥ 34   │ 7.0.34 │
  │   │ 8.0        │ patch ≥ 23   │ 8.0.23 │
  │   │ 8.2        │ patch ≥ 9    │ 8.2.9  │
  │   │ 8.3        │ patch ≥ 2    │ 8.3.2  │
  │   └────────────┴──────────────┴────────┘
  ├─ Nhánh ≥ 8.4 → mặc định AN TOÀN
  └─ Kết quả: SAFE | VULNERABLE | EOL | UNKNOWN

Bước 4: Kiểm tra trạng thái mongod
  ├─ pgrep -x mongod
  ├─ systemctl is-active mongod
  ├─ ss / netstat kiểm tra port đang listen
  └─ Kết quả: đang chạy / không chạy

Bước 5: Kiểm tra time-series collections & quyền người dùng
  │ (chỉ thực hiện nếu mongod đang chạy và kết nối được)
  ├─ check_timeseries_collections():
  │   ├─ listDatabases → lấy danh sách tất cả database
  │   ├─ getCollectionInfos({ type: "timeseries" }) → từng database
  │   └─ Output: JSON array [{ database, collection, timeseries }]
  │
  ├─ check_user_privileges():
  │   ├─ Đọc admin.system.users
  │   ├─ Lọc user có role ghi: readWrite, dbOwner, root,
  │   │   readWriteAnyDatabase, dbAdmin, userAdmin, backup,
  │   │   restore, clusterAdmin, hostManager, __system
  │   ├─ Output: JSON array [{ user, database, roles }]
  │   └─ Đây là những user CÓ THỂ khai thác lỗ hổng
  │
  └─ Kết nối thất bại → gợi ý dùng -u -p để xác thực

Bước 6: Kiểm tra cấu hình bảo mật
  ├─ Tìm file mongod.conf (/etc/mongod.conf, /etc/mongodb.conf, ...)
  ├─ Fallback: đọc /proc/<pid>/cmdline nếu không tìm thấy file
  ├─ Kiểm tra 3 hạng mục:
  │   ├─ authorization: enabled  → [OK] / [WARN]
  │   ├─ bindIp: 127.0.0.1       → [OK] / [WARN] (public)
  │   └─ TLS/SSL: requireTLS     → [OK] / [WARN]
  └─ Kết quả: "OK" hoặc danh sách vấn đề (authorization_disabled, ...)

Main function details

detect_mongod_path()

Detects the mongod binary path on the system.

  • Priority 1: Search in $PATH using command -v mongod
  • Priority 2: Iterate through a fixed directory list: /usr/bin, /usr/local/bin, /opt/mongodb/bin, /usr/lib/mongodb, /snap/bin
  • Returns: Absolute path or empty (not found)

get_mongod_version()

Extracts the version from the output of mongod --version.

  • Input: mongod path
  • Processing: Parse first line, use regex v?\K\d+\.\d+\.\d+
  • Example: db version v6.0.15 → 6.0.15
  • Returns: Version string X.Y.Z or empty

check_version_vulnerable()

Compares the MongoDB version against the vulnerability database.

  • Logic:
    1. Split version into major.minor and patch using regex ^(\d+)\.(\d+)\.(\d+)$
    2. Check EOL: compare against EOL_BRANCHES[]
    3. Look up PATCHED_VERSIONS[associative_array]
    4. If branch not in DB → check ≥ 8.4 (default safe)
    5. Arithmetic comparison: patch < threshold → VULNERABLE
  • Exit code: 0 = SAFE, 1 = VULNERABLE, 2 = EOL/UNKNOWN

build_mongo_cmd()

Builds a complete MongoDB shell connection command.

  • Shell: mongosh (preferred) → mongo (fallback)
  • Replica set: If MONGOD_REPLICA_SET is set, use connection string "mongodb://HOST:PORT/?replicaSet=NAME" — --host / --port parameters are ignored (already in URI)
  • Standalone: Append --host (if not localhost) and --port (if not 27017)
  • Authentication: --username, --password, --authenticationDatabase (if MONGOD_USER is set)
  • Example output: ``` mongosh --quiet "mongodb://localhost:27017/?replicaSet=rs_cams"
    --username super_admin --password *** --authenticationDatabase admin
    root@kitploit:~

check_timeseries_collections()

Scans the entire cluster for time-series collections.

  • Process:
    1. adminDb.adminCommand({ listDatabases: 1, nameOnly: true }) — lists all databases
    2. For each DB: db.getCollectionInfos({ type: "timeseries" }) — filters time-series
    3. Aggregates results: { database, collection, timeseries }
  • Timeout: 30 seconds
  • Output: JSON array — empty [] if no time-series collections exist

check_user_privileges()

Lists users with write privileges — potential targets for CVE exploitation.

  • Data source: admin.system.users.find()
  • List of risky roles:
    • readWrite — write to a specific database
    • readWriteAnyDatabase — write to all databases
    • dbAdmin, dbOwner — database administration
    • userAdmin, userAdminAnyDatabase — user management
    • root — full privileges
    • __system, backup, restore, clusterAdmin, hostManager — system privileges
  • Output: JSON array [{ user, database, roles }]
  • Timeout: 30 seconds

check_security_config()

Evaluates security configuration from the mongod.conf file.

  • Find config file: Scan standard directory list → fallback to reading /proc/<pid>/cmdline
  • 3 check items:
    ItemGrep PatternRisk if missing
    Authorizationauthorization: enabledAnyone can connect without authentication
    Bind IPbindIp: 127.0.0.1 or bindIpAll: falseExposed to public network
    TLS/SSLmode: requireTLS or ssl: requireSSLData transmitted without encryption
  • Returns: "OK" (perfect) or list of issues (e.g., authorization_disabled\ntls_disabled)

Output mode

The script supports 3 output modes, serving different purposes:

1. Normal mode (default)```bash

sudo bash CVE-2026-8053-MongoDB-Fixed.sh

root@kitploit:~
Full output with ANSI colors: banner, step-by-step log, summary table, detailed recommendations.```
==============================================
  CVE-2026-8053 Scanner v1.0.0
  CVE-2026-8053: FlatBSON Duplicate Field Index Drift
  Ngay quet: 2026-05-18 14:30:00
==============================================

[INFO] Buoc 1/6: Phat hien MongoDB installation...
[OK] Tim thay mongod tai: /usr/bin/mongod
[INFO] Buoc 2/6: Kiem tra phien ban MongoDB...
[INFO] Phien ban cai dat: 7.0.32
[INFO] Buoc 3/6: So sanh voi danh sach phien ban bi anh huong...
[ERROR] MongoDB 7.0.32 BI ANH HUONG boi CVE-2026-8053 — CAN NANG CAP NGAY!
...

==============================================
  KET QUA QUET
==============================================

  Phien ban MongoDB       : 7.0.32
  mongod dang chay        : Co
  Replica Set             : rs_cams
  Trang thai CVE-2026-8053: NGUY HIEM — CO LO HONG

==============================================
  KHUYEN NGHI
==============================================

  [!!!] HANH DONG KHAN CAP:
  1. Nang cap MongoDB Server NGAY LAP TUC len phien ban da va:
     -> Nang cap len 7.0.34 hoac moi hon
  ...

2. Quiet mode (-q)```bash

sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q

root@kitploit:~
Only show `[ERROR]` / `[WARN]` / `[OK]` lines — suitable for quick checks. Only rely on **exit code**:

| Exit Code | Meaning | Action |
|-----------|---------|--------|
| `0` | **SAFE** — MongoDB is patched | No action needed |
| `1` | **VULNERABLE** — Vulnerability exists | Upgrade immediately |
| `2` | **EOL / ERROR** — End-of-life version or detection error | Urgent upgrade |

#### 3. JSON mode (`-j`)```bash
sudo bash CVE-2026-8053-MongoDB-Fixed.sh -j -q

Pure JSON output — suitable for integration with CI/CD pipeline, monitoring system.```json { "cve": "CVE-2026-8053", "title": "FlatBSON Duplicate Field Index Drift", "scan_date": "2026-05-18T14:30:00+07:00", "host": "localhost", "port": "27017", "replica_set": "rs_cams", "mongodb": { "installed": true, "version": "7.0.32", "running": true, "vulnerable": true, "status": "VULNERABLE" }, "time_series_collections": [ { "database": "iot", "collection": "sensor_readings", "timeseries": { "timeField": "ts", "metaField": "sensorId" } } ], "risky_users": [ { "user": "app_user", "database": "admin", "roles": ["readWriteAnyDatabase"] }, { "user": "super_admin", "database": "admin", "roles": ["root"] } ], "security_config": ["authorization_disabled", "tls_disabled"], "remediation": { "action": "UPGRADE", "patched_versions": { "5.0": "5.0.33", "6.0": "6.0.28", "7.0": "7.0.34", "8.0": "8.0.23", "8.2": "8.2.9", "8.3": "8.3.2" } } }

root@kitploit:~
### Safety Assurance — Read-Only

The script **does not perform any write operations** on the MongoDB cluster. All MongoDB commands used:

| Command | Purpose | Type |
|---------|---------|------|
| `db.version()` | Check connection + runtime version | **Read** |
| `adminCommand({ listDatabases: 1, nameOnly: true })` | List database names | **Read** (Admin Command) |
| `db.getCollectionInfos({ type: "timeseries" })` | Get collection metadata | **Read** |
| `admin.system.users.find({})` | Read user & role list | **Read** (System Collection) |

There are no `insert`, `update`, `delete`, `createCollection`, `drop`, `grantRolesToUser`, `replSetReconfig`, or any write commands. **The script is safe to run on a production cluster.**

### Usage Example```bash
# 1. Quét cơ bản trên localhost (yêu cầu sudo để đọc /etc/mongod.conf)
sudo bash CVE-2026-8053-MongoDB-Fixed.sh

# 2. Quét với thông tin xác thực tùy chỉnh
sudo bash CVE-2026-8053-MongoDB-Fixed.sh \
  -H 10.0.0.5 -P 27017 \
  -u myadmin -p 'MyStr0ngP@ss'

# 3. Quét replica set với auth
sudo bash CVE-2026-8053-MongoDB-Fixed.sh \
  -H 10.0.0.5 -P 27017 \
  -u app_user -p 'pass123' \
  -r rs_production

# 4. Chỉ lấy exit code, không hiển thị log (dùng trong script)
sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q
if [ $? -eq 0 ]; then
    echo "MongoDB an toan"
else
    echo "CAN NANG CAP MongoDB NGAY!"
fi

# 5. Output JSON cho CI/CD pipeline
sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q -j > scan_result.json

# 6. Dùng jq để trích xuất thông tin từ JSON
sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q -j | jq -r '.mongodb.status'
sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q -j | jq '.risky_users | length'

# 7. Tích hợp vào cron job (quét hàng ngày lúc 7h sáng)
# Thêm vào /etc/cron.d/mongodb-cve-scan:
# 0 7 * * * root /opt/scripts/CVE-2026-8053-MongoDB-Fixed.sh -q -j | \
#   tee /var/log/mongodb-cve-scan/$(date +\%Y\%m\%d).json

Monitoring Integration (Monitoring)```bash

Nagios / Icinga / Zabbix — check qua exit code

/opt/scripts/CVE-2026-8053-MongoDB-Fixed.sh -q exit $? # 0=OK, 1=CRITICAL, 2=WARNING

Prometheus node_exporter textfile collector

sudo bash CVE-2026-8053-MongoDB-Fixed.sh -q -j |
jq '{cve_2026_8053_vulnerable: (.mongodb.vulnerable | if . then 1 else 0 end), cve_2026_8053_risky_users: (.risky_users | length), cve_2026_8053_ts_collections: (.time_series_collections | length)}' \

/var/lib/node_exporter/textfile_collector/mongodb_cve.prom

root@kitploit:~
---

## Real-world Impact

| Aspect | Assessment |
|--------|------------|
| **Exploit availability** | No public PoC available (at the time of disclosure) |
| **Exploit difficulty** | Medium — requires deep understanding of FlatBSON internals |
| **Impact scope** | All MongoDB servers with time-series collections deployed |
| **High-risk targets** | Systems allowing multiple users with write permissions, MongoDB exposed to the Internet |

---

## Timeline

| Date | Event |
|------|-------|
| 06/05/2026 | CVE reserved |
| 12/05/2026 | MongoDB publishes advisory and releases patch |
| 12/05/2026 | GitHub Advisory (GHSA-pr63-cc36-q84h) published |
| 13/05/2026 | Updates on NVD, Tenable, Snyk, Debian Security Tracker |

---

## References

- [MongoDB Jira — SERVER-126021](https://jira.mongodb.org/browse/SERVER-126021)
- [NVD — CVE-2026-8053](https://nvd.nist.gov/vuln/detail/CVE-2026-8053)
- [GitHub Advisory — GHSA-pr63-cc36-q84h](https://github.com/advisories/ghsa-pr63-cc36-q84h)
- [MongoDB Community Forum — Important patch May 2026](https://www.mongodb.com/community/forums/t/important-mongodb-patch-available-may-2026/339172)
- [Tenable — CVE-2026-8053](https://www.tenable.com/cve/CVE-2026-8053)
- [Snyk — SNYK-UNMANAGED-MONGODB-16678063](https://security.snyk.io/vuln/SNYK-UNMANAGED-MONGODB-16678063)
- [Debian Security Tracker — CVE-2026-8053](https://security-tracker.debian.org/tracker/CVE-2026-8053)
- [Cyber Security News — Critical MongoDB RCE](https://cybersecuritynews.com/mongodb-rce-vulnerability/)
Download Tool