Skip to content

fix: reject junction IDs that escape output directory - #178

Merged
liuao08 merged 1 commit into
OpenHUTB:mainfrom
huba-bh:fix/path-traversal-split-data
Oct 19, 2026
Merged

liuao08 merged 1 commit into
OpenHUTB:mainfrom
huba-bh:fix/path-traversal-split-data

Conversation

@huba-bh

@huba-bh huba-bh commented Oct 18, 2026

Copy link
Copy Markdown

Summary\n- Validate the junction ID before creating an output directory.\n- Reject absolute paths, path separators, Windows drive-relative paths, NUL bytes, and any resolved path outside the configured output directory.\n- Add regression tests for valid and malicious junction IDs.\n\n## Impact\nA crafted V2X log line could use ../ in the junction ID and cause v2x_latency.log to be created or overwritten outside the configured output directory with the process user's permissions (CWE-22).\n\n## Validation\n- python -m unittest discover -s tests -p test_split_data_security.py -v\n- 5 tests passed in Ubuntu 22.04 under VMware.

@huba-bh

huba-bh commented Oct 19, 2026

Copy link
Copy Markdown
Author

已审核提交 d755247。路口 ID 在创建输出目录前会拒绝绝对路径、路径分隔符、Windows 盘符、空值和 NUL,并通过解析后的目录边界校验防止越界写入;正常路口 ID 的处理保持不变。新增回归测试覆盖了主要穿越场景,我在 Windows 环境运行后 5 项全部通过。未发现阻塞问题,可以从当前版本合并。

@liuao08
liuao08 merged commit 1308b8e into OpenHUTB:main Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants