CVE-2025-49138:
HAX CMS vulnerable to Local File Inclusion via saveOutline API Location Parameter
6.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.13582%
CWE
Published
6/9/2025
Updated
6/9/2025
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
elmsln/haxcms | composer | < 11.0.0 | 11.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability (GHSA-hxrr-x32w-cg8g / CVE-2025-49138) is a Local File Inclusion in HAXCMS. It occurs in two stages:
- An authenticated user makes a POST request to the
/system/api/saveOutline
endpoint. Thelocation
parameter in this request is not sanitized and is saved directly into thesite.json
file. The backend operation likely responsible for this is a method withinOperations.php
, such assaveManifest()
, which handles saving the site's structure including item locations. - When HAXCMS subsequently processes this
site.json
to render a page or provide data for feeds/search, functions likeHAXCMSSite::getPageContent()
,JSONOutlineSchemaItem::readLocation()
,HAXCMSSite::jsonFeedFormat()
,HAXCMSSite::lunrSearchIndex()
,RSS::rssItems()
, andRSS::atomItems()
read the taintedlocation
value. In vulnerable versions, these functions used thelocation
infile_get_contents()
calls without adequate sanitization, allowing a path traversal payload (e.g.,../../../etc/passwd
) to be executed, thus reading arbitrary files from the server.
The fixing commit 0dd3e98fe2fadd0793b667d4af2aac230980e0f8
addresses this by:
- Introducing a new validation function
HAXCMSSite::validatePageLocation()
which checks if a path is within the allowed site directory and strips../
and./
. - Applying this validation and/or direct
str_replace
sanitization in all identified functions that consume thelocation
parameter before passing it tofile_get_contents()
. - Adding broader input sanitization using
filter_var
andstrip_tags
in various data handling functions inOperations.php
andHAXCMSSite.php
.
Therefore, the primary vulnerable functions are those involved in saving the unsanitized path and those involved in reading files using that path.
Vulnerable functions
Operations::saveManifest
system/backend/php/lib/Operations.php
This function is responsible for saving the site manifest (site.json), which includes the outline of site items and their 'location' properties. In the vulnerable version, it did not sanitize the 'location' field received from the saveOutline API call, allowing a path traversal payload to be written into site.json.
HAXCMSSite::getPageContent
system/backend/php/lib/HAXCMSSite.php
This function retrieves the content of a page based on the 'location' field of a page object (derived from site.json). In the vulnerable version, it directly used the 'location' in a file_get_contents call without proper sanitization or validation, leading to LFI if the 'location' contained a path traversal payload. This is the function mentioned at line 1248 in the vulnerable version.
JSONOutlineSchemaItem::readLocation
system/backend/php/lib/JSONOutlineSchemaItem.php
This method reads the content of a file specified by the item's 'location' property. In the vulnerable version, it used the 'location' directly in file_get_contents without sanitizing path traversal characters, making it vulnerable to LFI.
HAXCMSSite::jsonFeedFormat
system/backend/php/lib/HAXCMSSite.php
This function generates a JSON feed and includes page content using file_get_contents based on item location. It was vulnerable to LFI and was patched by adding a call to `validatePageLocation`.
HAXCMSSite::lunrSearchIndex
system/backend/php/lib/HAXCMSSite.php
This function generates a search index and includes page content using file_get_contents based on item location. It was vulnerable to LFI and was patched by adding a call to `validatePageLocation`.
RSS::rssItems
system/backend/php/lib/RSS.php
This function generates RSS feed items and includes page content using file_get_contents based on item location. It was vulnerable to LFI and was patched by adding `str_replace` to sanitize the location.
RSS::atomItems
system/backend/php/lib/RSS.php
This function generates Atom feed items and includes page content using file_get_contents based on item location. It was vulnerable to LFI and was patched by adding `str_replace` to sanitize the location.