github / github/codeql

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

Abierto
#19,479 4 comentarios 0 reacciones 0 asignados Ver en GitHub
question
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza rastreando el flujo de datos reportado desde fileName, pasando por "String filePath = Global.getDownloadPath() + fileName;", hasta writeBytes, y compáralo con la ruta hacia FileUtils.isValidFilename. Inspecciona cómo la consulta de flujo de datos de CodeQL gestiona la concatenación y, a continuación, verifica que la consulta de fileName a writeBytes devuelve un resultado mientras la ruta existente sigue estando cubierta.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
security
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.