Commit e3778b7
fix: prevent path traversal in bibtex-compatibility.py
This commit addresses a security vulnerability where unvalidated command line
input could lead to potential path traversal. The script now:
- Checks if the required command-line argument is provided.
- Uses `os.path.basename()` to sanitize the input database name, ensuring
that it cannot be used to access files outside the current directory.
- Gracefully exits with a usage message if arguments are missing.
Co-authored-by: k4rtik <374340+k4rtik@users.noreply.github.com>1 parent c082ae6 commit e3778b7
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
0 commit comments