36 Star 101 Fork 107

openGauss / openGauss-connector-jdbc

 / 详情

PSQLException.getMessage()存在信息泄露风险

已完成
缺陷
创建于  
2023-12-21 08:39

ServerErrorMessage.toString()方法会默认包含客户端ip与数据库ip且无法通过任何方式屏蔽。
这导致程序在捕获PSQLException时无法直接使用其getMessage方法,需要格外小心其是否包含ServerErrorMessage,因为包含ServerErrorMessage的PSQLException.getMessage方法返回的字符串中也会包含客户端ip与数据库ip。

建议通过ServerErrorMessage构造的PSQLException的getMessage方法屏蔽掉ip相关的信息,程序确需ip相关信息的,可以自行通过PSQLException.getServerErrorMessage().toString()方法获取。

评论 (4)

zyl 创建了缺陷

Hey @zyl, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss_bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

Hi @zyl,
if you want to get quick review about your issue, please contact the owner in first: @周斌 ,
and then any of the maintainers: @Pike
and then any of the committers: @travelliu , @aaronwell , @Loong , @Kamus , @vimiix , @汪伟
if you have any question, please contact the SIG: Connectors.

opengauss_bot 添加了
 
sig/connectors
标签
zyl 修改了标题
zyl 修改了描述
周斌 负责人设置为travelliu
周斌 添加协作者周斌
周斌 关联项目设置为openGauss 5.1.1 community
周斌 优先级设置为不重要

@zyl 不要这样做。 这样隐藏了信息,但是也增加诊断问题的难度,尤其是一个应用连接主从数据库做读写分离。 根本不知道那个库有问题了。 在get_socket的地方进行脱敏。 比如把ip前两位replace下

travelliu 任务状态待办的 修改为已确认
travelliu 任务状态已确认 修改为修复中
申正 计划截止日期设置为2024-01-27
travelliu 通过opengauss/openGauss-connector-jdbc Pull Request !189任务状态修复中 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(4)
13084139 opengauss bot 1686829535 7909965 wx 6b43aa685b 1596891036 1603209 travelliu 1650447184
Java
1
https://gitee.com/opengauss/openGauss-connector-jdbc.git
git@gitee.com:opengauss/openGauss-connector-jdbc.git
opengauss
openGauss-connector-jdbc
openGauss-connector-jdbc

搜索帮助