apache / apache/servicecomb-java-chassis
servicecomb 2.8.14版本接口入参校验失败后抛出的异常信息存在内部代码结构和行号等信息
- 主要语言
- Java
- 星标
- 1.9k
- 派生
- 814
- 平均合并
- 8 天 23 小时
- 30 天内合并 PR
- 1
描述
#### 背景
当 接口调用传递的body跟接口定位的入参不一致时,接口返回的message信息存在内部代码结构和行号等信息
#### 复现demo
接口入参定义如下:
```
public class CommonReq {
private String name;
private Integer type;
}
```
http请求传递的body如下:
```
{
"name": "jedrek",
"type": "hard"
}
```
报错信息如下:
{
"message": "Parameter is not valid for operation [xxx]. Parameter is [commonReq]. Processor is [body]. Message is [Cannot deserialize value of type `java.lang.Integer` from String \"hard\": not a valid `java.lang.Integer` value\n at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 3, column: 13] (through reference chain: CommonReq[\"type\"])]."
}
这个打印信息感觉存在安全问题,暴露了接口的内部实现,可否针对于这种场景,对打印的异常message进行调整
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先追踪产生所报告的 Parameter、Processor 和 Message 响应的请求体反序列化错误处理。使用非整数类型重现 CommonReq 负载,然后验证响应不再暴露内部代码结构、源代码位置或实现细节,同时仍能传达输入无效这一点。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api, backend, security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100