theskumar / theskumar/python-dotenv
Configure `dotenv_values`'s search space
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 8.9k
- Fork
- 581
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Currently the user-specified path could point to any folder and dotenv will parse them anyway even if it is files like /etc/passwd.
The content of the target file would be available in the error message. This could potentially introduce the path traversal vulnerability if the developer misuses it.
from dotenv import load_dotenv
from dotenv import dotenv_values
import os
config = dotenv_values("../../../etc/passwd")
I am wondering if it is possible to give dotenv_values an additional arguments to control if it would support relative path searching.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Review the dotenv_values entry point and the path-handling behavior shown in the example. Done should establish a clear way to control relative-path searching and prevent unintended files such as /etc/passwd from being parsed or exposed; no test file is named in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend, security
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100