{"schema_version":"1.7.3","id":"GHSA-jj2r-455p-5gvf","published":"2025-06-27T14:55:07Z","modified":"2025-08-04T20:31:25Z","aliases":["CVE-2025-52900","GO-2025-3785"],"summary":"filebrowser Sets Insecure File Permissions","details":"## Summary ##\n\nThe file access permissions for files uploaded to or created from File Browser are never explicitly set by the application.\nThe same is true for the database used by File Browser. On standard servers where the *umask* configuration has not been hardened before, this makes all the stated files readable by any operating system account.\n\n## Impact ##\n\nThe default permissions for new files on a standard Linux system are `0644`, making them world-readable.\nThat means that at least the following parties have full read access to all files managed by the Filebrowser from all *scopes*, as well as its database (including the password hashes stored in there):\n\n* All OS accounts on the server\n* All other applications running on the same server\n* Any Filebrowser user with *Command Execution* privileges having access to a command that allows reading a file's content\n\n## Vulnerability Description ##\n\nOn a Linux system, the file access permissions of new files are designated by the system wide *umask* setting, unless they are configured manually.\nMost distributions set this value to `022` by default which gives every account on the system read permissions on the file.\n\n```bash\n$ umask\n022\n$ touch foo\n$ ls -l foo\n-rw-r--r-- 1 sba sba 0 31. Mär 15:08 foo\n```\n\n## Proof of Concept ##\n\nUpload or create a file in the Filebrowser GUI and list the directory contents from a shell:\n\n```bash\n$ ls -l /srv/filebrowser/testdir\ntotal 12\n-rw-r--r-- 1 sba sba 7703 Mar 25 16:07 dummy1.pdf\n-rw-r--r-- 1 sba sba    3 Mar 25 15:46 testfile.txt\n```\n\nThe same can be validated for Docker based deployments within the container:\n\n```bash\n$ docker exec -it e0f075082a2c ls /srv/testdir -l\ntotal 12\n-rw-r--r--    1 1000     1000          7703 Mar 25 15:07 dummy1.pdf\n-rw-r--r--    1 1000     1000             3 Mar 25 14:46 testfile.txt\n```\n\nFurthermore, the database used by the Filebrowser application is readable by any account:\n\n```bash\n$ ls -l /srv/filebrowser/filebrowser.db \n-rw-rw-r-- 1 sba sba 65536 Mar 25 09:58 /srv/filebrowser/filebrowser.db\n```\n\n## Recommended Countermeasures ##\n\nSince the system's *umask* configuration cannot be controlled by the Filebrowser, the application needs to set the permissions of all new files manually upon creation.\nNo permissions should be given to the *other* category.\n\nImplementing this won't fix the permissions for active instances after an update, so site administrators will need to fix the permissions manually:\n\n```bash\n$ chmod o-rwx -R /srv/filebrowser/datadir\n```\n\n## Timeline ##\n\n* `2025-03-25` Identified the vulnerability in version 2.32.0\n* `2025-04-11` Contacted the project\n* `2025-04-18` Vulnerability disclosed to the project\n* `2025-06-25` Uploaded advisories to the project's GitHub repository\n* `2025-06-26` CVE ID assigned by GitHub\n* `2025-06-26` Fix released with version 2.33.7\n\n## References ##\n\n* [CWE-276: Incorrect Default Permissions](https://cwe.mitre.org/data/definitions/276.html)\n* [What is Umask and How To Setup Default umask Under Linux?](https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html)\n* [Original Advisory](https://github.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-03_Filebrowser_Insecure_File_Permissions)\n\n## Credits ##\n\n* Mathias Tausig ([SBA Research](https://www.sba-research.org/))","affected":[{"package":{"name":"github.com/filebrowser/filebrowser/v2","ecosystem":"Go","purl":"pkg:golang/github.com/filebrowser/filebrowser/v2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.33.7"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/06/GHSA-jj2r-455p-5gvf/GHSA-jj2r-455p-5gvf.json"}},{"package":{"name":"github.com/filebrowser/filebrowser","ecosystem":"Go","purl":"pkg:golang/github.com/filebrowser/filebrowser"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"1.11.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/06/GHSA-jj2r-455p-5gvf/GHSA-jj2r-455p-5gvf.json"}}],"references":[{"type":"WEB","url":"https://github.com/filebrowser/filebrowser/security/advisories/GHSA-jj2r-455p-5gvf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-52900"},{"type":"WEB","url":"https://github.com/filebrowser/filebrowser/commit/ca86f916216620365c0f81629c0934ce02574d76"},{"type":"PACKAGE","url":"https://github.com/filebrowser/filebrowser"},{"type":"WEB","url":"https://github.com/sbaresearch/advisories/tree/public/2025/SBA-ADV-20250325-03_Filebrowser_Insecure_File_Permissions"},{"type":"WEB","url":"https://pkg.go.dev/vuln/GO-2025-3785"}],"database_specific":{"cwe_ids":["CWE-276"],"github_reviewed":true,"github_reviewed_at":"2025-06-27T14:55:07Z","nvd_published_at":"2025-06-26T15:15:23Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"}]}