首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >出于安全考虑,更新netty及其组件的正确方法是什么?

出于安全考虑,更新netty及其组件的正确方法是什么?
EN

Stack Overflow用户
提问于 2021-10-15 08:46:53
回答 1查看 6.3K关注 0票数 3

我们的spring引导(云)应用程序使用rx,其版本是0.4.20。它将netty及其组件设置为4.1.5.Final版本。

目前,我们的安全审计系统发现当前的netty版本(4.1.52.Final)易受攻击,建议我们升级到4.1.68+版本。

我试图将pom.xml中的pom.xml锁定为4.1.68.Final,但后来发现其他netty组件(如netty-buffernetty-handler )仍然停留在4.1.52中。

我想知道:

  • 我应该把所有的网络组件都放在同一个版本上吗?
  • 升级单个易受攻击组件的正确方法是什么?

谢谢

更新:

mvn dependency:tree

代码语言:javascript
运行
复制
...
[INFO] +- io.reactivex:rxnetty-contexts:jar:0.4.20:compile
[INFO] +- io.reactivex:rxnetty-servo:jar:0.4.20:compile
[INFO] |  \- com.netflix.servo:servo-core:jar:0.12.21:runtime
[INFO] +- io.reactivex:rxnetty:jar:0.4.20:compile
[INFO] |  +- io.netty:netty-codec-http:jar:4.1.69.Final:runtime
[INFO] |  |  +- io.netty:netty-common:jar:4.1.69.Final:runtime
[INFO] |  |  +- io.netty:netty-buffer:jar:4.1.52.Final:runtime
[INFO] |  |  +- io.netty:netty-transport:jar:4.1.52.Final:runtime
[INFO] |  |  \- io.netty:netty-codec:jar:4.1.52.Final:runtime
[INFO] |  +- io.netty:netty-handler:jar:4.1.69.Final:runtime
[INFO] |  |  \- io.netty:netty-resolver:jar:4.1.52.Final:runtime
[INFO] |  +- io.netty:netty-transport-native-epoll:jar:4.1.69.Final:runtime
[INFO] |  |  \- io.netty:netty-transport-native-unix-common:jar:4.1.52.Final:runtime
...
EN

回答 1

Stack Overflow用户

发布于 2021-10-15 09:36:30

注意: Spring版本2.5.5使用netty 4.1.68.Final,所以如果您将spring-boot-starter-parent升级到2.5.5,您应该没事。

话虽如此:

如何在spring中升级到更高/更低版本的依赖项:

  • 查看在spring-boot-dependencies中配置的属性
  • 用想要的版本更改我的pom.xml中的属性

在这种情况下,将netty.version:4.1.69.Final添加到属性中:

代码语言:javascript
运行
复制
    <properties>
        <java.version>11</java.version>
        <netty.version>4.1.69.Final</netty.version>
        
    </properties>

更新:

当将<netty.version>4.1.69.Final</netty.version>spring-boot-starter-parent:2.2.10.RELEASE一起使用时,参考Gist netty升级

执行mvn dependency:tree时,可以看到每个netty依赖项都升级到4.1.69.Final

输出过滤在'netty‘上

代码语言:javascript
运行
复制
    Regel 1: [INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ netty-upgrade ---
    Regel 2: [INFO] com.example:netty-upgrade:jar:0.0.1-SNAPSHOT
    Regel 25: [INFO] |  +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.2.10.RELEASE:compile
    Regel 26: [INFO] |  |  +- io.projectreactor.netty:reactor-netty:jar:0.9.12.RELEASE:compile
    Regel 26: [INFO] |  |  +- io.projectreactor.netty:reactor-netty:jar:0.9.12.RELEASE:compile
    Regel 27: [INFO] |  |  |  +- io.netty:netty-codec-http2:jar:4.1.69.Final:compile
    Regel 27: [INFO] |  |  |  +- io.netty:netty-codec-http2:jar:4.1.69.Final:compile
    Regel 28: [INFO] |  |  |  +- io.netty:netty-handler-proxy:jar:4.1.69.Final:compile
    Regel 28: [INFO] |  |  |  +- io.netty:netty-handler-proxy:jar:4.1.69.Final:compile
    Regel 29: [INFO] |  |  |  |  \- io.netty:netty-codec-socks:jar:4.1.69.Final:compile
    Regel 29: [INFO] |  |  |  |  \- io.netty:netty-codec-socks:jar:4.1.69.Final:compile
    Regel 30: [INFO] |  |  |  \- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.69.Final:compile
    Regel 30: [INFO] |  |  |  \- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.69.Final:compile
    Regel 42: [INFO] +- io.reactivex:rxnetty:jar:0.5.1:runtime
    Regel 44: [INFO] |  +- io.netty:netty-codec-http:jar:4.1.69.Final:compile
    Regel 44: [INFO] |  +- io.netty:netty-codec-http:jar:4.1.69.Final:compile
    Regel 45: [INFO] |  |  +- io.netty:netty-common:jar:4.1.69.Final:compile
    Regel 45: [INFO] |  |  +- io.netty:netty-common:jar:4.1.69.Final:compile
    Regel 46: [INFO] |  |  +- io.netty:netty-buffer:jar:4.1.69.Final:compile
    Regel 46: [INFO] |  |  +- io.netty:netty-buffer:jar:4.1.69.Final:compile
    Regel 47: [INFO] |  |  +- io.netty:netty-transport:jar:4.1.69.Final:compile
    Regel 47: [INFO] |  |  +- io.netty:netty-transport:jar:4.1.69.Final:compile
    Regel 48: [INFO] |  |  \- io.netty:netty-codec:jar:4.1.69.Final:compile
    Regel 48: [INFO] |  |  \- io.netty:netty-codec:jar:4.1.69.Final:compile
    Regel 49: [INFO] |  +- io.netty:netty-handler:jar:4.1.69.Final:compile
    Regel 49: [INFO] |  +- io.netty:netty-handler:jar:4.1.69.Final:compile
    Regel 50: [INFO] |  |  \- io.netty:netty-resolver:jar:4.1.69.Final:compile
    Regel 50: [INFO] |  |  \- io.netty:netty-resolver:jar:4.1.69.Final:compile
    Regel 51: [INFO] |  +- io.netty:netty-transport-native-epoll:jar:4.1.69.Final:runtime
    Regel 51: [INFO] |  +- io.netty:netty-transport-native-epoll:jar:4.1.69.Final:runtime
    Regel 52: [INFO] |  |  \- io.netty:netty-transport-native-unix-common:jar:4.1.69.Final:compile
    Regel 52: [INFO] |  |  \- io.netty:netty-transport-native-unix-common:jar:4.1.69.Final:compile

因此,如果仍然有对其他版本的引用,请使用mvn dependency:tree查看该引用来自何处。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69582105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档