You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "RockteMQ-AI (via GitHub)" <gi...@apache.org> on 2026/08/27 05:50:21 UTC
[PR] fix: prevent directory traversal via date parameter in DashboardCollectServiceImpl [rocketmq-dashboard]
RockteMQ-AI opened a new pull request, #2633:
URL: https://github.com/apache/rocketmq-dashboard/pull/2633
## Problem
`DashboardCollectServiceImpl.getBrokerCache(date)` and `getTopicCache(date)` construct file paths by direct string concatenation: `new File(dataLocationPath + date + ".json")`. The `date` parameter originates from user input via `DashboardController` and is never validated, enabling directory traversal attacks (e.g., `../../xxx`).
Fixes #2625
## Changes
- Added `DATE_PATTERN` whitelist regex (`^\d{4}-\d{2}-\d{2}$`) matching the expected `yyyy-MM-dd` format
- Added `checkDateParam()` method that throws `ServiceException(-1, ...)` for invalid date values
- Called `checkDateParam(date)` at entry of both `getBrokerCache()` and `getTopicCache()`
## Verification
- Valid dates (`2024-01-01`) continue to work normally
- Invalid dates (`../../etc/passwd`, `abc`, `2024/01/01`) now return error responses
- 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: [PR] fix: prevent directory traversal via date parameter in DashboardCollectServiceImpl [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #2633: fix: prevent directory traversal via date parameter in DashboardCollectServiceImpl
URL: https://github.com/apache/rocketmq-dashboard/pull/2633
--
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: [PR] fix: prevent directory traversal via date parameter in DashboardCollectServiceImpl [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #2633:
URL: https://github.com/apache/rocketmq-dashboard/pull/2633#issuecomment-5435255616
Same as #2626: this targets master (legacy dashboard) for the #2625 directory traversal issue. rocketmq-studio has no corresponding code path, so nothing applies here. Closing for studio; please direct the fix at master.
--
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