You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "enkilee (via GitHub)" <gi...@apache.org> on 2026/08/26 08:24:07 UTC
[I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
enkilee opened a new issue, #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625
Problem
DashboardController 接收用户可控的 date 参数,未做任何校验直接拼接到文件路径,导致路径遍历:攻击者可传入 ../../xxx 读取数据目录之外的任意 .json 文件。
Evidence
调用链中 date 全程无校验:
DashboardController.broker(@RequestParam String date) // 用户输入,无校验
→ DashboardServiceImpl.queryBrokerData(date) // 透传
→ DashboardCollectServiceImpl.getBrokerCache(date)
new File(dataLocationPath + date + ".json") // ← 直接拼接,无校验
Fix
在路径构造的边界(DashboardCollectServiceImpl,所有调用方的必经点)增加白名单校验:
•新增 DATE_PATTERN = \d{4}-\d{2}-\d{2}(与项目文档约定的 yyyy-MM-dd 格式一致)
•新增 checkDateParam():date 为 null/空或格式不匹配时抛 ServiceException(-1, ...)(由现有 GlobalExceptionHandler 统一转为 JSON 错误响应)
•getBrokerCache() 和 getTopicCache() 入口各调用一次。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625#issuecomment-5434941089
Fix PR created: https://github.com/apache/rocketmq-dashboard/pull/2633
**Summary:** Added `DATE_PATTERN` whitelist validation (`^\d{4}-\d{2}-\d{2}$`) in `DashboardCollectServiceImpl`. Both `getBrokerCache()` and `getTopicCache()` now call `checkDateParam()` before constructing file paths, rejecting any `date` value that doesn't match the expected `yyyy-MM-dd` format.
Single file change, minimal surface area.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "enkilee (via GitHub)" <gi...@apache.org>.
enkilee commented on issue #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625#issuecomment-5433569432
/approve
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625#issuecomment-5423134532
**Issue Evaluation**
Category: `type/bug` | Status: **Confirmed**
This is a valid **security vulnerability** — directory traversal via the `date` parameter in `DashboardController`. The evidence is clear: the user-controlled `date` parameter is concatenated directly into a file path without any sanitization, allowing an attacker to read arbitrary `.json` files outside the data directory.
**Root Cause:** Missing input validation at `DashboardCollectServiceImpl.getBrokerCache(date)` / `getTopicCache(date)` where `date` is concatenated into `new File(dataLocationPath + date + ".json")`.
**Impact:** Any unauthenticated user can read arbitrary files on the server that end with `.json`, potentially exposing sensitive data.
**Severity:** **High** — This is a CWE-22 (Path Traversal) vulnerability that should be fixed promptly.
**Proposed fix assessment:** The suggested fix (whitelist validation with `DATE_PATTERN = \d{4}-\d{2}-\d{2}`) is appropriate and minimal. Adding validation at the service layer boundary is the correct approach.
An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #2625: [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal
URL: https://github.com/apache/rocketmq-dashboard/issues/2625
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625#issuecomment-5533800683
This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Studio][Bug] DashboardController receives the user-controllable date parameter and concatenates it directly to the file path without any verification, resulting in directory traversal [rocketmq-dashboard]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #2625:
URL: https://github.com/apache/rocketmq-dashboard/issues/2625#issuecomment-5440274875
**Issue Evaluation**
Category: / | Status: **Confirmed — High Severity**
This is a valid directory traversal vulnerability. The Thu Aug 27 22:03:40 CST 2026 parameter in is concatenated directly into a file path without sanitization, allowing an attacker to read arbitrary files outside the data directory via sequences.
**Root Cause:** Missing input validation on the Thu Aug 27 22:03:40 CST 2026 path parameter — no check for path traversal sequences (, ).
**Impact:** Unauthorized file read within the server filesystem (any file accessible to the process).
**Severity:** **High** — This is a security vulnerability that should be patched promptly.
**Suggested fix:** Validate the Thu Aug 27 22:03:40 CST 2026 parameter against a strict pattern (e.g., ) and reject any value containing path separators or sequences. Alternatively, use and verify the resolved path stays within the expected data directory.
This issue should be prioritized for the next release.
---
*Automated evaluation by github-manager*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org