Path Traversal Vulnerability in `LESS` Parser allows reading of sensitive server files in flarum
Description
flarum is a forum software package for building communities. In versions prior to 1.7.0 an admin account which has already been compromised by an attacker may use a vulnerability in the LESS parser which can be exploited to read sensitive files on the server through the use of path traversal techniques. An attacker can achieve this by providing an absolute path to a sensitive file in the custom LESS setting, which the LESS parser will then read. For example, an attacker could use the following code to read the contents of the /etc/passwd file on a linux machine. The scope of what files are vulnerable will depend on the permissions given to the running flarum process. The vulnerability has been addressed in version 1.7. Users should upgrade to this version to mitigate the vulnerability. Users unable to upgrade may mitigate the vulnerability by ensuring that their admin accounts are secured with strong passwords and follow other best practices for account security. Additionally, users can limit the exposure of sensitive files on the server by implementing appropriate file permissions and access controls at the operating system level.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
flarum/corePackagist | < 1.7.0 | 1.7.0 |
Affected products
1Patches
11761660c98eafix: disallow certain dangerous LESS features
2 files changed · +11 −0
framework/core/locale/core.yml+1 −0 modified@@ -18,6 +18,7 @@ core: custom_footer_text: => core.ref.custom_footer_text custom_header_heading: Custom Header custom_header_text: => core.ref.custom_header_text + custom_styles_cannot_use_less_features: "The @import and data-uri features are not allowed in custom LESS." custom_styles_heading: Custom Styles custom_styles_text: Customize your forum's appearance by adding your own Less/CSS code to be applied on top of Flarum's default styles. dark_mode_label: Dark Mode
framework/core/src/Forum/ValidateCustomLess.php+10 −0 modified@@ -21,6 +21,7 @@ use League\Flysystem\Adapter\NullAdapter; use League\Flysystem\Filesystem; use Less_Exception_Parser; +use Symfony\Contracts\Translation\TranslatorInterface; /** * @internal @@ -61,6 +62,15 @@ public function whenSettingsSaving(Saving $event) return; } + // Restrict what features can be used in custom LESS + if (preg_match('/@import|data-uri\s*\(/i', $event->settings['custom_less'])) { + $translator = $this->container->make(TranslatorInterface::class); + + throw new ValidationException([ + 'custom_less' => $translator->trans('core.admin.appearance.custom_styles_cannot_use_less_features') + ]); + } + // We haven't saved the settings yet, but we want to trial a full // recompile of the CSS to see if this custom LESS will break // anything. In order to do that, we will temporarily override the
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-vhm8-wwrf-3gcwghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-27577ghsaADVISORY
- github.com/flarum/flarum-core/releases/tag/v1.7.0ghsaWEB
- github.com/flarum/framework/commit/1761660c98ea5a3e9665fb8e6041d1f2ee62a444ghsax_refsource_MISCWEB
- github.com/flarum/framework/security/advisories/GHSA-vhm8-wwrf-3gcwghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.