[bug](http) MetaInfoAction.getAllDatabases() leaks unfiltered db list, bypassing SHOW privilege
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu trong fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java tại getAllDatabases(), sau đó so sánh luồng lọc và phân trang trong fe/fe-core/src/main/java/org/apache/doris/httpv2/restv2/MetaInfoActionV2.java. Công việc được xem là hoàn tất khi endpoint v1 sắp xếp và chỉ trả về các tên cơ sở dữ liệu được SHOW cho phép, mà không sử dụng danh sách chưa lọc trong phản hồi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
MetaInfoAction.getAllDatabases() (the v1 HTTP metadata interface) returns the full list of database names regardless of the caller's SHOW privilege. The privilege-filtered result (dbNameSet) is computed but never used; the method sorts and returns the unfiltered dbNames.
This is distinct from PR #65126 — it is a pre-existing master bug, not introduced by that PR. The only change PR #65126 made to this method was the line:
- List<String> dbNames = catalog.getDbNames();
+ List<String> dbNames = new ArrayList<>(catalog.getDbNames());
which was needed to fix an UnsupportedOperationException after getDbNames() started returning an immutable list. It is unrelated to the privilege-filtering bug.
Affected code
fe/fe-core/src/main/java/org/apache/doris/httpv2/rest/MetaInfoAction.java
List<String> dbNames = new ArrayList<>(catalog.getDbNames()); // L108 all db names
List<String> dbNameSet = Lists.newArrayList(); // L109
for (String db : dbNames) {
if (!Env.getCurrentEnv().getAccessManager()
.checkDbPriv(ConnectContext.get(), InternalCatalog.INTERNAL_CATALOG_NAME, db,
PrivPredicate.SHOW)) {
continue; // skip db without SHOW
}
dbNameSet.add(db); // L116 filtered result
}
Collections.sort(dbNames); // L119 sorts dbNames (unfiltered)
Pair<Integer, Integer> fromToIndex = getFromToIndex(request, dbNames.size());
return ResponseEntityBuilder.ok(dbNames.subList(...)); // L123 returns UNFILTERED dbNames
dbNameSet is dead code; the response returns the unfiltered, all-privilege dbNames.
Auth surface / impact
checkWithCookiealways requires a valid authenticated session (Authorization header or valid cookie), so this is not anonymous access.enable_all_http_authdefaults tofalsein most deployments. With the default, any authenticated non-admin user hitting/api/meta/{ns}/databasescan enumerate every database name in the catalog, bypassingSHOWprivilege.- When
enable_all_http_auth = true, only admin can reach the endpoint, so the leakage is limited to admins.
Impact: information disclosure / privilege bypass at the metadata-enumeration level (database names only; table/column data is gated by other checks).
Correct reference (v2)
MetaInfoActionV2.getAllDatabases() does this correctly — it accumulates into filteredDbNames, sorts it, and returns it:
fe/fe-core/src/main/java/org/apache/doris/httpv2/restv2/MetaInfoActionV2.java (lines ~130–145)
List<String> filteredDbNames = Lists.newArrayList();
// ... checkDbPriv(SHOW) -> filteredDbNames.add(db)
Collections.sort(filteredDbNames);
return ResponseEntityBuilder.ok(filteredDbNames.subList(...));
Suggested fix
Align v1 with v2: return the privilege-filtered (and sorted) dbNameSet / filteredDbNames instead of dbNames, and drop the dead code. This is outside the scope of PR #65126 (external metadata cache refactor) and is tracked separately here.
Related
- PR #65126 (
[refactor](meta cache) Refactor external metadata cache with MetaCacheEntry)
- Ngôn ngữ chính
- Java
- Star
- 16.1k
- Fork
- 4k
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 686
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/doris
-
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
4.1.4.1 Release NoteĐang mởrelease notes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] FE metric http_copy_into_query_err_total is registered under the upload error nameCó thể đã có người làm @manesioz đã nhận 23 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
apache/doris#68505 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
NullPointerException when a `DeserializationProblemHandler` returns `null` for `byte[]` (single value unwrapped) and `char[]` elementsCó thể đã có người làm @Marti2203 đã nhận hôm nay. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 88/100
FasterXML/jackson-databind#6300 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
cpinitiative/usaco-guide#6699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
carlos-emr/carlos#4933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq-dashboard#6925 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Vakore/ZappierGames#147 ·