Repository navigation
修复 SDK 应用内路径的控制字符校验缺口 - #1
Merged
Merged
Conversation
hao2530
marked this pull request as ready for review
November 9, 2026 14:27
This was referenced Nov 9, 2026
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.
背景
SDK 原有约定要求登录地址和返回地址为应用内相对路径,但校验只拒绝反斜杠、CR/LF 和
//,仍会接受 TAB 等 ASCII 控制字符。浏览器 URL 规范化可移除 TAB,使通过原校验的/<TAB>/example.invalid被解释为站外地址。这是 SDK 输入边界的本地复现;没有访问生产环境,也未证明具体部署可被利用或存在令牌泄露。
修改
loginURL的 path/returnTo、accountStatus的 path,以及服务端 returnTo,拒绝 U+0000–U+001F 和 U+007F。验证
pnpm test,14 项通过。python -m unittest discover -s sdk/python/tests -p 'test_*.py' -v,8 项通过。go test -race ./...,SDK 与 Gin adapter 两个包通过;go vet ./...通过。协作与状态
提交前使用 gh 复核:默认分支仍为
7e9e8c5,仅有 main,无开放 PR 或可见重叠分支;公开信息无法排除私有或线下工作。先以 draft 提交;独立评审完成后转 ready for review。未执行发布或数据库迁移,不表示可以跳过维护者审查直接上线。
独立评审与 CI(2026-11-09)