fix: 修复数据库连接测试的 JDBC URL 过滤可被绕过导致任意文件读#905
Open
MarkLee131 wants to merge 1 commit into
Open
Conversation
sanitizeJdbcUrl 只对字面量 "param=true" 做替换,存在两处绕过: allowLoadLocalInfileInPath 不在名单内、参数名经百分号编码后正则无法匹配, 都能让 mysql-connector-j 经 LOAD DATA LOCAL INFILE 读取服务器任意文件 (同 Apache InLong CVE-2023-34434)。改为解析查询串、对解码后的参数名按 危险前缀/名单整段丢弃,覆盖大小写、URL 编码与 InPath 同族参数。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #904 and #900:
sanitizeJdbcUrl 只对字面量 "param=true" 做替换,存在两处绕过:
allowLoadLocalInfileInPath 不在名单内、参数名经百分号编码后正则无法匹配, 都能让 mysql-connector-j 经 LOAD DATA LOCAL INFILE 读取服务器任意文件 (同 Apache InLong CVE-2023-34434)。改为解析查询串、对解码后的参数名按 危险前缀/名单整段丢弃,覆盖大小写、URL 编码与 InPath 同族参数。