漏洞描述
pgjdbc 是官方的 PostgreSQL JDBC 驱动程序。近日,postgresql发布了新版pgjdbc版本,并披露了此前版本中的一起远程代码执行漏洞。
在 postgresql 数据库的 jdbc 驱动程序中发现了一个安全漏洞。当攻击者控制 jdbc url 或属性时,使用 postgresql 库的系统将受到攻击。pgjdbc 根据通过 `authenticationPluginClassName`、`sslhostnameverifier`、`socketFactory`、`sslfactory`、`sslpasswordcallback` 连接属性提供的类名实例化插件实例。但是,驱动程序在实例化类之前没有验证类是否实现了预期的接口。这可能导致通过任意类加载远程代码执行。建议相关用户及时升级。
解决建议
该漏洞的细节已经公开,建议相关用户及时更新pgjdbc到安全版本,当前安全版本为42.3.2。
参考链接
https://github.com/pgjdbc/pgjdbc/commit/f4d0ed69c0b3aae8531d83d6af4c57f22312c813
https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-v7wg-cpwc-24m4
https://lists.debian.org/debian-lts-announce/2022/05/msg00027.html
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BVEO7BEFXPBVHSPYL3YKQWZI6DYXQLFS/
https://security.netapp.com/advisory/ntap-20220311-0005/
https://www.debian.org/security/2022/dsa-5196