gateway在eureka注册报java.lang.IndexOutOfBoundsException

gateway一直都正常运行,突然有一天报错,访问不了服务,报错日志如下

2025-01-06 07:37:37.364 [DiscoveryClient-CacheRefreshExecutor-0] ERROR com.netflix.discovery.DiscoveryClient - Cannot fetch registry from server

reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

at java.util.ArrayList.rangeCheck(Unknown Source)

重启gateway之后又恢复正常,问题原因是:开启了actuator。导致暴露远程代码执行漏洞

2.0暴露端点的两种方式

方式1(一个个的去开启需要暴露的端点):

.properties文件配置示例

management.endpoint.env.enabled=true
management.endpoints.web.exposure.include=env

.yml文件配置示例

management.endpoint.env.enabled: true
management.endpoints.web.exposure.include: env

方式2(直接开启和暴露所有端点或者多个端点,代替的全部放开请使用*,或把需要开放的接口端点使用","隔开,如:env,health。):

.properties文件配置示例

management.endpoints.web.exposure.include=*

.yml文件配置示例

management.endpoints.web.exposure.include: "*"

参考:记录一次网关异常_error org.springframework.scheduling.support.tasku-CSDN博客

关于 SCG 远程执行漏洞情况说明

https://zhuanlan.zhihu.com/p/407710777

Spring Cloud Gateway远程代码执行漏洞(CVE-2022-22947) - LalaTina - 博客园

相关推荐
Cosmoshhhyyy21 分钟前
LeetCode:2270. 分割数组的方案数(遍历 Java)
java·算法·leetcode
zhulangfly22 分钟前
【Java设计模式-4】策略模式,消灭if/else迷宫的利器
java·设计模式·策略模式
编程小筑1 小时前
R语言的语法糖
开发语言·后端·golang
夕阳之后的黑夜1 小时前
SpringBoot + 九天大模型(文生图接口)
java·spring boot·后端·ai作画
芝士就是力量啊 ೄ೨1 小时前
Kotlin 循环语句详解
android·java·开发语言·kotlin
Alex老夫子1 小时前
kotlin sortedBy 与sortedWith的区别
android·开发语言·kotlin
云端 架构师1 小时前
Python语言的编程范式
开发语言·后端·golang
QQ27437851091 小时前
django基于Python对西安市旅游景点的分析与研究
java·后端·python·django
会code的厨子1 小时前
Spring底层核心原理解析
java·spring
苹果酱05672 小时前
Redis之数据结构
java·spring boot·毕业设计·layui·课程设计