fireantology / django-logtailer

Allows the viewing of any log file entries in real time directly from the Django admin interface. It allows you to filter on logs with regex and offer also a log clipboard for save desired log lines to the django db.
BSD 3-Clause "New" or "Revised" License
97 stars 30 forks source link

Implement Allowed Directory List #22

Open mfocuz opened 10 months ago

mfocuz commented 10 months ago

This library can be built into application(e.g. admin portal of some webapp, that is the case I encountered).

While reading log files is a feature of app for troubleshooting purposes, it should not allow to read files from arbitrary directories. Request log file path should be normalized and checked if it is still inside of allow directory(or list of directories).

Otherwise it can lead to security issue CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')