songgaoye opened a new pull request, #3743:
URL: https://github.com/apache/brpc/pull/3743
### What problem does this PR solve?
Issue Number: resolve
Problem Summary:
Builtin `/dir` and hotspots pages render filesystem-derived names into HTML.
A malicious directory entry or historical profiler filename could inject HTML
into the builtin management UI.
### What is changed and the side effects?
Changed:
- Escape HTML link text and href values emitted by `Path`.
- Escape profiler filenames in HTML option values and visible text.
- Encode profiler `view` and `base` paths in generated URLs, then decode and
validate them in both profiler handlers.
- Add regression tests for hostile names and encoded profile paths.
Side effects:
- Performance effects: Negligible; escaping/encoding only occurs while
rendering builtin management pages.
- Breaking backward compatibility: No. Existing raw `view` and `base` query
parameters remain supported.
---
### Check List:
- Please make sure your changes are compilable.
- When providing us with a new feature, it is best to add related tests.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]