github / github/codeql

The strings were concatenated, making it impossible to match the path.

未关闭
#19,479 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

Source can query the fileName.
![Image](https://github.com/user-attachments/assets/be6b5bb4-8bf2-473e-8ec7-8473f65aed09)
Sink can also query data.
![Image](https://github.com/user-attachments/assets/0bb4c178-36e3-49a9-9866-31b3b578fb8d)
Logic can be connected.
![Image](https://github.com/user-attachments/assets/b0066f0d-42c9-4597-b37b-bfc10f14d6ef)
But no results were found.
![Image](https://github.com/user-attachments/assets/83905e7f-0c2b-49ad-a946-f7b9edd55b53)
The test from fileName to FileUtils.isValidFilename can retrieve results.
![Image](https://github.com/user-attachments/assets/62a80658-e043-449d-9497-19b0b0b5d12f)
However, when querying from fileName to writeBytes, no results are returned. The data passes through the line "String filePath = Global.getDownloadPath() + fileName;" in the middle.

![Image](https://github.com/user-attachments/assets/afec0902-6c54-4297-a185-9cda90eb2087)

![Image](https://github.com/user-attachments/assets/00b657c6-ee6c-427c-bdca-de738f941534)

贡献指南

打开贡献指南

调研方向

Start by tracing the reported flow from fileName through "String filePath = Global.getDownloadPath() + fileName;" to writeBytes, and compare it with the path to FileUtils.isValidFilename. Inspect how the CodeQL data-flow query handles the concatenation, then verify that the fileName-to-writeBytes query returns a result while the existing path remains covered.

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
security
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。