github / github/codeql

False negative: unzip using subprocess or `shutil.unpack_archive` is not covered in py/tarslip

Abierto
#21,712 0 comentarios 1 reacción 2 asignados Reclamado por @hvitved Ver en GitHub
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

The rule currently misses standard library functions and patterns that perform archive extraction, such as `shutil.unpack_archive` and system `tar` commands invoked via `subprocess`.

https://github.com/positive666/yolo_research/blob/f5795f27a56ca4dbe4c182e12f61309a52e23967/utils/downloads.py#L173
https://github.com/JohnClema/xffl/blob/a920300239a82a85a87d0bf25735762844ee8e9d/aggregator/aggregation.py#L9

Here is a minimal, simplified code example to reproduce:
```python
import tarfile, sys, shutil, zipfile, subprocess
unsafe_filename = sys.argv[1]
tar = tarfile.open(unsafe_filename)
tar.extractall() # detected
# 1. shutil
shutil.unpack_archive(unsafe_filename, "out") # not detected
# 2. subprocess
subprocess.run(["tar", "-xf", unsafe_filename]) # not detected
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.