Conversation
|
HTHou
approved these changes
May 22, 2026
luoluoyuyu
approved these changes
May 27, 2026
Member
luoluoyuyu
left a comment
There was a problem hiding this comment.
Review 总结
安全加固到位:
resolveFileInFileDataDir统一路径校验,封堵../等路径遍历- legacy sink 增加
openSession认证 handshake/sendPipeData/sendFile增加USE_PIPE权限检查
建议尽快合入(安全类)。行内 1 条建议补 IT。
| + illegalError); | ||
| } | ||
|
|
||
| return PipeReceiverFilePathUtils.resolveFilePath(Paths.get(fileDir), fileName).toFile(); |
Member
There was a problem hiding this comment.
👍 使用 PipeReceiverFilePathUtils.resolveFilePath 替代 new File(fileDir, fileName) 是正确的修复。
建议补 IT(可 follow-up):
transportFile传入../../../etc/passwd类 fileName → 期望SYNC_FILE_ERROR- 正常 tsFile 名仍可续传
同时确认 getIllegalError4Directory 对 foo/bar(子路径)与 .. 的覆盖与 thrift 协议文档一致。
| return getNotLoggedInStatus(); | ||
| } | ||
| return AuthorityChecker.getTSStatus( | ||
| AuthorityChecker.checkSystemPermission(clientSession.getUsername(), PrivilegeType.USE_PIPE), |
Member
There was a problem hiding this comment.
👍 checkLegacyPipeReceiverPermission 要求已登录 + USE_PIPE system 权限,堵住未授权 legacy pipe 文件写入。
兼容性提醒:升级后旧版 sink(未 openSession)会在 handshake 失败。PR 已在 IoTDBLegacyPipeSink.openClientSession() 处理发送侧,需确保 source/target 0.14+ 成对升级 或 release note 标明 breaking change。
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.



Description
This PR hardens the legacy pipe receiver file-transfer path and aligns its RPC access checks with normal client-
session expectations.
Changes
.., and normalized paths outside the receiverfile-datadirectory.TsFilePipeData.USE_PIPEprivilege for legacyhandshake,sendFile, andsendPipeData.connector behavior.
Tests
mvn '-Ddevelocity.off=true' '-Dscan=false' '-pl' 'iotdb-core/datanode' 'spotless:apply'git diff --checkmvn '-Ddevelocity.off=true' '-Dscan=false' '-pl' 'iotdb-core/datanode' '-Dtest=IoTDBLegacyPipeReceiverAgentTest' 'test'This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR