创建于2024-07-12更新于 2025-03-22
1. 关闭 Swagger
1.注释:MySwaggerResourceProvider
2.删除gatewaypom
<artifactId>knife4j-spring-boot-starter</artifactId>
<artifactId>knife4j-spring-ui</artifactId>
3.删除注解@EnableKnife4j
4.注释SwaggerResourceController/MySwaggerResourceProvider
2. 针对/sys/ng-alain/getDictItemsByTableSQL 注入
@Override
public List<Map<String, String>> getDictByTable(String table, String key, String value) {
//增加SqlInjectionUtil检查
SqlInjectionUtil.specialFilterContentForDictSql(table);
SqlInjectionUtil.specialFilterContentForDictSql(key);
SqlInjectionUtil.specialFilterContentForDictSql(value);
return this.mapper.getDictByTableNgAlain(table,key,value);
}
3. 针对 actuator 漏洞
删除以下 POM
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>4. swagger 关闭页面访问
server:
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
### 是否启用默认的错误页面,默认为true 需要重启网关
whitelabel:
enabled: false5. 针对积木报表漏洞
积木报表在2.0和3.6.0之前存在安全漏洞需要将涉及到的jmreport剔除