/

CVE-2026-55746

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in Cotonti PFS folder titles

CVE-2026-55746

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to session hijacking and UI compromise

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Cotonti 1.0.0's Personal File Storage module contains a stored cross-site scripting flaw in folder titles.

Authenticated users can save HTML or JavaScript in a folder title that is later rendered without escaping, causing script execution when other users view the folder listing.

Affected context

The vulnerability appears in Cotonti's Personal File Storage (PFS) module where folder metadata is managed and displayed.

It surfaces when folder titles (pff_title) are imported using a generic "TXT" filter that does not enforce HTML stripping or encoding, and later rendered into templates without proper escaping.

Any deployment that allows authenticated users to create or rename folders, especially where folders can be public or visible to other users, is exposed to this issue.

Exploit preconditions

  • Attack surface: Web interface for managing PFS folders in Cotonti.
  • Required access: Authenticated user account with permission to create or edit PFS folders.
  • User interaction: A victim (including admins or other users) must visit a page that lists or displays the malicious folder title.
  • Trigger point: The stored folder title is assigned to PFF_ROW_TITLE in pfs.main.php and rendered via {PFF_ROW_TITLE} in pfs.tpl without htmlspecialchars() or equivalent encoding.
  • Why exploitation is possible: Untrusted input is accepted without HTML sanitization and later injected into an HTML context without escaping, allowing arbitrary script execution in the browser.

Why this happens

This vulnerability stems from improper neutralization of user-supplied input before it is included in web pages, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).

The import routine uses the "TXT" filter with tag checking disabled, meaning HTML tags and script content are accepted as-is for pff_title.

On output, the template binding assigns this value directly to PFF_ROW_TITLE and the template engine emits {PFF_ROW_TITLE} without HTML-encoding.

The combination of permissive input handling and missing contextual output encoding creates a persistent XSS sink where attacker-controlled content executes in other users' browsers.

Potential impact

  • An attacker-controlled script may execute in the browser of any user viewing the affected PFS folder listing.
  • Attackers could potentially hijack user sessions via stolen cookies or tokens (subject to cookie flags and browser protections).
  • Malicious scripts could perform unauthorized actions on behalf of the victim using their authenticated session (CSRF-like behavior via XSS).
  • Users could be phished or tricked through UI manipulation, fake dialogs, or injected forms.
  • Administrative interfaces, if browsed while the payload runs, could be abused to alter configuration or create additional backdoors.

General mitigation guidance

Effective mitigation centers on enforcing strict output encoding for all untrusted data and narrowing the trust boundary of user-controlled fields.

Common defensive patterns include:

  • Applying context-appropriate HTML encoding (for example, using htmlspecialchars() or an equivalent) whenever user-controlled data is injected into HTML content.
  • Ensuring the input filtering pipeline does not rely solely on "safe" text filters; instead, design the system so that all user input is considered untrusted and is encoded on output.
  • Introducing a standard templating practice or helper API that automatically escapes variables by default, requiring explicit opt-out for truly safe content.
  • Avoiding storage of "trusted HTML" in the same fields used for normal user-supplied text; if rich content is necessary, segregate it and treat it with additional review and controls.
  • Applying least-privilege design to features exposed to authenticated users so that compromise of one user account minimizes impact on others.

How teams detect issues like this

Detection strategies focus on identifying unescaped output paths and overly permissive input handling:

  • Use static analysis or linters to flag direct echoing or template injection of variables that originate from request parameters or database fields without passing through an encoding function.
  • During code review, look for patterns where user inputs are imported with generic filters (like a "TXT" filter) and later used in templates without explicit escaping.
  • Implement security-focused unit and integration tests that inject benign XSS payload markers into text fields and verify they are rendered as escaped text rather than executed markup.
  • Leverage application security testing tools (DAST and SAST) that can detect reflected and stored XSS by fuzzing input points and monitoring responses.
  • Enforce security coding guidelines in CI/CD pipelines to block merges when new unescaped sinks or dangerous patterns are introduced.

Sources

SourceLink
github.comgithub.com/Cotonti/Cotonti
github.comgithub.com/Cotonti/Cotonti/blob/f43f1fc38ba4e02027786dad9dac1435c7c52b30/modules/pfs/inc/pfs.main.php#L396

Frequently asked

questions

Yes. Any remote attacker who can obtain an authenticated account with permission to manage PFS folders can exploit this issue by storing malicious content in a folder title and waiting for others to view it.

The attacker needs an authenticated user account that can create or rename folders in the Personal File Storage module; no elevated privileges are inherently required beyond that.

The safest pattern is to treat all folder titles and similar user inputs as untrusted and always apply context-appropriate HTML encoding on output, ideally via a templating system that escapes variables by default and requires explicit opting out only in tightly controlled scenarios.

Prevention relies on adopting a consistent "encode on output" strategy, enforcing secure-by-default templating, performing security-focused code reviews, and integrating automated checks that flag any unescaped rendering of user-controlled data in HTML contexts.

Find out what's already
exploitable in your codebase.