
Desc "CVE-2026-8053 CHECKER"-20260518-16h30-GMT+7
| Attribute | Value |
|---|
| CVE ID | CVE-2026-8053 |
| Technical Name | FlatBSON Duplicate Field Index Drift |
| Vulnerability Type | CWE-787 — Out-of-bounds Write |
| CVSS v4.0 | 8.7 (HIGH) |
| CVSS v3.1 | 8.8 (HIGH) |
| EPSS | 0.064% (20th percentile — low exploitation probability) |
| KEV (Known Exploited) | Not recorded |
| Detection Date | MongoDB Internal |
| Publication Date | 12/05/2026 |
| Reserved Date | 06/05/2026 |
| NVD Status | PUBLISHED / Awaiting Analysis |
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.
| Condition | Description |
|---|---|
| Authentication | Required — the attacker must have a valid MongoDB account |
| Privileges | Requires write privilege to the database |
| User Interaction | None |
| Network | Exploitable remotely over network |
| Complexity | Low (attack complexity: LOW) |
| MongoDB Branch | Affected Versions | Patched 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.
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
| 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:
| Branch | Sample upgrade command (APT) |
|---|---|
| 5.0 | sudo apt install -y mongodb-org=5.0.33 |
| 6.0 | sudo apt install -y mongodb-org=6.0.28 |
| 7.0 | sudo apt install -y mongodb-org=7.0.34 |
| 8.0 | sudo apt install -y mongodb-org=8.0.23 |
| 8.2 | sudo apt install -y mongodb-org=8.2.9 |
| 8.3 | sudo apt install -y mongodb-org=8.3.2 |
authorization: enabled in mongod.conf: ```yaml
security:
authorization: enabled
mongod --version
sudo systemctl status mongod
mongosh --eval "db.version()"
sudo bash CVE-2026-8053-MongoDB-Fixed.sh
---
## 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, ...)
detect_mongod_path()Detects the mongod binary path on the system.
$PATH using command -v mongod/usr/bin, /usr/local/bin, /opt/mongodb/bin, /usr/lib/mongodb, /snap/binget_mongod_version()Extracts the version from the output of mongod --version.
mongod pathv?\K\d+\.\d+\.\d+db version v6.0.15 → 6.0.15check_version_vulnerable()Compares the MongoDB version against the vulnerability database.
major.minor and patch using regex ^(\d+)\.(\d+)\.(\d+)$EOL_BRANCHES[]PATCHED_VERSIONS[associative_array]patch < threshold → VULNERABLE0 = SAFE, 1 = VULNERABLE, 2 = EOL/UNKNOWNbuild_mongo_cmd()Builds a complete MongoDB shell connection command.
mongosh (preferred) → mongo (fallback)MONGOD_REPLICA_SET is set, use connection string "mongodb://HOST:PORT/?replicaSet=NAME" — --host / --port parameters are ignored (already in URI)--host (if not localhost) and --port (if not 27017)--username, --password, --authenticationDatabase (if MONGOD_USER is set)check_timeseries_collections()Scans the entire cluster for time-series collections.
adminDb.adminCommand({ listDatabases: 1, nameOnly: true }) — lists all databasesdb.getCollectionInfos({ type: "timeseries" }) — filters time-series{ database, collection, timeseries }[] if no time-series collections existcheck_user_privileges()Lists users with write privileges — potential targets for CVE exploitation.
admin.system.users.find()readWrite — write to a specific databasereadWriteAnyDatabase — write to all databasesdbAdmin, dbOwner — database administrationuserAdmin, userAdminAnyDatabase — user managementroot — full privileges__system, backup, restore, clusterAdmin, hostManager — system privileges[{ user, database, roles }]check_security_config()Evaluates security configuration from the mongod.conf file.
/proc/<pid>/cmdline| Item | Grep Pattern | Risk if missing |
|---|---|---|
| Authorization | authorization: enabled | Anyone can connect without authentication |
| Bind IP | bindIp: 127.0.0.1 or bindIpAll: false | Exposed to public network |
| TLS/SSL | mode: requireTLS or ssl: requireSSL | Data transmitted without encryption |
"OK" (perfect) or list of issues (e.g., authorization_disabled\ntls_disabled)The script supports 3 output modes, serving different purposes:
sudo bash CVE-2026-8053-MongoDB-Fixed.sh
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
...
-q)```bashsudo bash CVE-2026-8053-MongoDB-Fixed.sh -q
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" } } }
### 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
/opt/scripts/CVE-2026-8053-MongoDB-Fixed.sh -q exit $? # 0=OK, 1=CRITICAL, 2=WARNING
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
---
## 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/)