You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File Manager recursive permission change applies directory permissions to files (sets 770 on files) #742
When using CloudPanel File Manager to change permissions recursively on a directory, the system incorrectly applies the same permission mode to both directories and files.
Specifically, when setting a directory to 770, all contained files are also set to 770, instead of using appropriate file permissions.
Impact:
Incorrect file permissions
Potential security risk
Breaks standard permission models for WordPress and Linux systems
Technical concern:
This suggests the recursive permission logic is applying directory mode to files, instead of distinguishing between:
chmod for directories
chmod for files
Severity:
Medium to High (incorrect permission handling with security implications)
How to reproduce
Open CloudPanel File Manager
Select a folder (e.g. WordPress theme directory)
Change permissions to 770
Inspect files inside the folder
Expected behaviour:
Directories → 770
Files → 660 (or remain unchanged)
Possible Solution
Suggestion:
Separate handling for files vs directories during recursive chmod
Apply:
directories → requested mode
files → safe default (e.g. 644/660) or leave unchanged
Additional Context
OS: Ubuntu 24.04
CloudPanel: v2.5.3
PHP: 8.5
WordPress: latest (observed across multiple installations)
While investigating the File Manager permission handling, I reviewed the source code in src/File/Manager.php and found the logic responsible for resetting permissions.
The current implementation in resetPermissions() appears to apply:
directories → 770
files → 770
This seems to be related to the behaviour reported here, where recursive permission handling does not distinguish between directory permissions and regular file permissions.
I also observed that files created directly through the File Manager receive executable permissions, for example:
while files uploaded through other mechanisms may receive standard permissions:
-rw-r--r-- test-document.pdf
From a Linux permissions perspective, directories and regular files normally require different modes. Applying directory permissions directly to files introduces unnecessary executable bits and may trigger security scanners or create inconsistent permission models.
Expected behaviour would likely be:
directories → 770
files → 660/640/644 depending on the intended security model
or preserving existing permissions unless explicitly changed by the administrator.
Activity
chiareu commentedon Jul 29, 2026
Additional findings:
While investigating the File Manager permission handling, I reviewed the source code in src/File/Manager.php and found the logic responsible for resetting permissions.
The current implementation in resetPermissions() appears to apply:
This seems to be related to the behaviour reported here, where recursive permission handling does not distinguish between directory permissions and regular file permissions.
I also observed that files created directly through the File Manager receive executable permissions, for example:
while files uploaded through other mechanisms may receive standard permissions:
-rw-r--r-- test-document.pdfFrom a Linux permissions perspective, directories and regular files normally require different modes. Applying directory permissions directly to files introduces unnecessary executable bits and may trigger security scanners or create inconsistent permission models.
Expected behaviour would likely be:
or preserving existing permissions unless explicitly changed by the administrator.