使用ConfigFilter进行数据库密码加密是不是还是不安全
- Dominant language
- Java
- Stars
- 28.2k
- Forks
- 8.6k
- PR merge metrics
- No merged PRs in 30d
Description
执行命令加密数据库密码
在命令行中执行如下命令:
java -cp druid-0.2.23.jar com.alibaba.druid.filter.config.ConfigTools you_password
输出
h9gzp23dkJIZ95Xzj/waxsC2oJ1JoWTh76o4aw7+uGGh63ovAULVOrPewOwHP5i3LCIXqNyvpxJ2nceDFBbzVw==
输入你的数据库密码,输出的是加密后的结果。
通过查看源码发现 使用RSA 非对称加密算法、通过上面的语句生成的密码是使用默认的私钥加密的、解密也雷同使用默认的公钥解密的。这样岂不是不安全了,没有发现druid配置公钥和私钥的地方。那我们生产环境配置的密码很简单每一位开发人员都可以使用相同的方法解密出来了。谢谢!
Contributor guide
Research direction
Start at the ConfigTools command entry point and inspect how ConfigFilter obtains and uses its RSA keys. Verify whether the default keys are fixed and whether configuration supports replacing them; done means establishing the production security impact and defining the required configuration or documentation change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100