Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SimpleMessage(or ReusableSimpleMessage) for log4j #1728

Closed
AdoptOSS opened this issue Dec 12, 2021 · 3 comments
Closed

Use SimpleMessage(or ReusableSimpleMessage) for log4j #1728

AdoptOSS opened this issue Dec 12, 2021 · 3 comments
Labels
t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:question 标签: 需要更多信息

Comments

@AdoptOSS
Copy link
Contributor

AdoptOSS commented Dec 12, 2021

SimpleMessage可以阻止log4j对输出内容进行参数求解
考虑到Mirai在使用log4j时从来没有使用参数求解的特性
可以传递SimpleMessage停用参数求解,这可以规避不必要的错误,并修复潜在的远程执行漏洞(#1724

@AdoptOSS AdoptOSS added the t:feature 类型: 新特性 label Dec 12, 2021
@Him188
Copy link
Member

Him188 commented Dec 12, 2021

这不属于 mirai应该做的事情,只需要更新 log4j 版本,或者不使用 log4j core 就行。

mirai 只使用 log4j-api 并且默认使用 mirai 自己的实现(MiraiLogger),不会有日志相关问题;如果用户选择使用 log4j 接管 mirai 日志系统,那么用户需要承担该决策引入的 log4j core 可能导致的安全问题。

@Him188 Him188 added t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:question 标签: 需要更多信息 and removed t:feature 类型: 新特性 labels Dec 12, 2021
@AdoptOSS
Copy link
Contributor Author

Log4jLoggerAdapter被实现在 Mirai 内部,而目前的实现有将完全不需要参数求解的log(这是MiraiLogger的语义)传递给log4j参数求解器的隐患

@Him188
Copy link
Member

Him188 commented Dec 12, 2021

Log4jLoggerAdapter被实现在 Mirai 内部,而目前的实现有将完全不需要参数求解的log(这是MiraiLogger的语义)传递给log4j参数求解器的隐患

这个确实是一个问题,但它的解决方式还有待讨论。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:problem 类型: 不容易归类为特性或 bug 的综合问题 x:question 标签: 需要更多信息
Projects
None yet
Development

No branches or pull requests

2 participants