[GH-ISSUE #187] view file is insecure #131

Closed
opened 2026-03-02 15:56:03 +03:00 by kerem · 1 comment
Owner

Originally created by @satyr-software on GitHub (Jun 14, 2019).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/187

File exclusion mask is applied on listing files, but not on views:
Short test:

  • View path (let's say index.php)
  • Open file (opens fine)
  • Add to GLOBALS['exclude_items'];
  • Reload : (File still displayed)
  • Back: View path (file dissapears)

Expected result:

  • Reload should show "FIle Not Found" (excluded)

Fix:
if ($file == '' || !is_file($path . '/' . $file) || in_array($file, $GLOBALS['exclude_items'])) {

Just before:
fm_set_msg('File not found', 'error');

Originally created by @satyr-software on GitHub (Jun 14, 2019). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/187 File exclusion mask is applied on listing files, but not on views: Short test: * View path (let's say index.php) * Open file (opens fine) * Add to GLOBALS['exclude_items']; * Reload : (File still displayed) * Back: View path (file dissapears) Expected result: * Reload should show "FIle Not Found" (excluded) Fix: if ($file == '' || !is_file($path . '/' . $file) **|| in_array($file, $GLOBALS['exclude_items'])**) { Just before: fm_set_msg('File not found', 'error');
kerem 2026-03-02 15:56:03 +03:00
Author
Owner

@prasathmani commented on GitHub (Jul 23, 2019):

@satyr-software added your suggestion.

<!-- gh-comment-id:514090286 --> @prasathmani commented on GitHub (Jul 23, 2019): @satyr-software added your suggestion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#131
No description provided.