Applying a patch with a fuzzFactor can be very very slow
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript
- 领域
- security
调研方向
从 applyPatch(...) 和 applyPatches(...) 入口点开始,跟踪报告中描述的模糊补丁匹配逻辑。复现对照用例和构造的 high-fuzzFactor 用例,以测量性能下降。完成的标准是,构造的模糊补丁不再触发过高的 CPU 时间,同时正常的模糊应用行为保持不变。
由索引模型根据 Issue 内容生成。
描述
Thanks to the following five security researchers for reporting this:
- [email protected] (Ziyue), https://zyy0530.github.io/
- [email protected] (Chenchen), https://7thparkk.github.io/
- [email protected] (Strick), https://str1ckl4nd.github.io/
- [email protected] (Liyi), https://lzhou1110.github.io/
- [email protected] (Maurice), http://maurice.busystar.org/
Finding 1: Fuzzy patch application can cause algorithmic complexity DoS
Affected behavior
applyPatchandapplyPatchessupport fuzzy patch matching. With crafted hunks and a highfuzzFactor, the matching logic can end up exploring many alternatives recursively and spend a large amount of CPU time on a single input.Affected entrypoints
`applyPatch(...)` `applyPatches(...)`Reproduction notes
In our reproduction, a normal control case completed in under 1 ms, while a crafted fuzzy patch took about 7.7 seconds on the same setup:
control time: 0.568181 ms
exploit time: 7737.472789 ms
slowdown: 13617.9717xThe issue appears to come from recursive branch exploration in the fuzzy patch application logic.
- 主要语言
- JavaScript
- 星标
- 9.2k
- 派生
- 555
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kpdecker/jsdiff 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
kpdecker/jsdiff#703 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 1 天内回复
相似的 Issue
-
channels:edit check:passed
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 94/100
lidofinance/docs#1033 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复