halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
33.2k stars 9.59k forks source link

Plugin Install Remote Code Execution #5502

Closed L1nyz-tel closed 14 hours ago

L1nyz-tel commented 6 months ago

系统信息

使用的哪种方式运行?

Source Code

发生了什么?

登陆之后,在安装插件的时候,上传恶意构造的 jar 包可以 rce

示例 jar 包 telllplugin.jar

相关日志输出

No response

附加信息

video 链接: attack.mov

guqing commented 6 months ago

我将 issue 中提到的视频链接转移到 github comment 便于观看:

https://github.com/halo-dev/halo/assets/38999863/daf3a0ed-8844-4e37-a113-14e0ebde384d

ruibaby commented 6 months ago

漏洞提交请遵循:https://github.com/halo-dev/halo/blob/main/SECURITY.md

JohnNiang commented 6 months ago

Hi @L1nyz-tel , thank you for reaching out here!

目前,Halo 主程序暂时没有对插件进行任何限制,等待插件系统稳定后,会慢慢考虑加固。

我这里有以下几个建议:

  1. 不要安装未知来源的插件
  2. 尽量用低权限用户运行 Halo 系统
  3. 尽量用 Docker 运行 Halo 系统
guqing commented 6 months ago

Hi @L1nyz-tel , thank you for reaching out here!

目前,Halo 主程序暂时没有对插件进行任何限制,等待插件系统稳定后,会慢慢考虑加固。

我这里有以下几个建议:

  1. 不要安装为止来源的插件
  2. 尽量用低权限用户运行 Halo 系统
  3. 尽量用 Docker 运行 Halo 系统

是的,总结非常到位🫡, 这也是我们很长一段时间都没有考虑提供 JAR 包给用户的原因之一,插件目前还可以操作文件,如果你

  1. 不使用 Docker 部署
  2. 使用高权限用户运行
  3. Halo 还安装未知来源的插件

那么你就会面临服务器重要文件被获取或者删除的风险

guqing commented 6 months ago

/kind needs-information /priority awaiting-more-evidence /area plugin

f2c-ci-robot[bot] commented 6 months ago

@guqing: The label(s) kind/needs-information cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/halo-dev/halo/issues/5502#issuecomment-1993773921): >/kind needs-information >/priority awaiting-more-evidence >/area plugin Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.