/

CVE-2026-55744

Severity:

HIGH RISK

(8.1)

CSRF (CWE-352) in Cotonti Personal File Storage

CVE-2026-55744

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Unauthorized State-Changing Actions / Arbitrary File Upload in User Context

Severity:

HIGH RISK

(8.1)

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 is vulnerable to Cross-Site Request Forgery due to missing anti-CSRF validation on the file upload action.

An attacker who tricks a logged-in user into loading a malicious page can silently trigger a forged multipart upload, placing arbitrary files into the victim's PFS area.

Affected context

The vulnerability appears in the Personal File Storage (PFS) module of Cotonti 1.0.0 (master branch, commit f43f1fc3).

It is relevant when:

  • Users are authenticated in Cotonti and have access to PFS
  • The web application relies on browser-based sessions or cookies for authentication
  • The a=upload action in modules/pfs/inc/pfs.main.php is reachable over HTTP(S) without additional confirmation steps

Other PFS actions, such as file deletion, do call CSRF validation helpers, but the upload action omits this check, leaving a specific gap in protection.

Exploit preconditions

  • Attack surface: The PFS file upload endpoint (a=upload) exposed via HTTP(S).
  • Required access: The victim must be an authenticated Cotonti user with an active session and permission to use PFS.
  • User interaction: The victim must be induced to visit or interact with an attacker-controlled web page (e.g., via link, embedded content, or compromised site).
  • Trigger point: The malicious page causes the victim's browser to send a crafted multipart/form-data POST request to the PFS upload URL.
  • Why exploitation is possible: The upload handler processes requests without verifying an anti-CSRF token (e.g., via cot_check_xg()), so the application cannot distinguish a legitimate upload from a cross-site forged request.

Why this happens

This vulnerability stems from missing CSRF protection on a state-changing endpoint in a session-based web application.

While some PFS actions correctly call cot_check_xg() to validate anti-CSRF tokens, the a=upload action in pfs.main.php does not perform this check before processing uploaded files.

As a result, the application trusts any cross-origin POST that includes valid session cookies, matching CWE-352: Cross-Site Request Forgery (CSRF), where an application fails to require a per-request proof of user intent.

Potential impact

  • Attackers may cause arbitrary files to be uploaded into a victim's PFS storage under the victim's account.
  • Uploaded content can be used for phishing, social engineering, or to mislead other users who trust files in the victim's storage.
  • Storage quotas could be exhausted by forced uploads, impacting availability of PFS for the victim.
  • If other features allow sharing or publishing from PFS, forced uploads could lead to unintended exposure or distribution of attacker-controlled content.

General mitigation guidance

Effective mitigation focuses on enforcing robust CSRF defenses for all state-changing endpoints:

  • Ensure every form or endpoint that modifies server-side state, including file uploads, enforces anti-CSRF token checks.
  • Use framework-level CSRF middleware or centralized helpers and apply them consistently across all controller actions.
  • Bind tokens to user sessions and validate them server-side, rejecting requests with missing or invalid tokens.
  • Favor secure-by-default routing or controller patterns where new actions inherit CSRF protection automatically, reducing the chance of omissions.
  • Complement token checks with same-site cookie attributes and, where appropriate, additional confirmation flows for sensitive actions.

How teams detect issues like this

To detect similar issues, organizations can:

  • Perform code reviews focused on state-changing handlers, verifying that each such route uses a standard CSRF validation routine.
  • Employ static analysis or security linting rules that flag POST/PUT/DELETE handlers not invoking the project's CSRF check function or middleware.
  • Use automated integration or security tests that attempt cross-origin requests against sensitive endpoints and confirm they are rejected.
  • Maintain architectural security guidelines that mandate use of centralized CSRF protection mechanisms and periodically audit legacy modules for compliance.

Sources

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

Frequently asked

questions

Yes. An attacker can host a malicious page anywhere on the internet; if a logged-in Cotonti user visits it, the browser can issue forged upload requests to the PFS endpoint.

No direct access is required. The attacker relies on the victim's existing authenticated session and the browser's automatic inclusion of cookies or other credentials.

Apply consistent CSRF protection to all state-changing actions by enforcing anti-CSRF token validation via a centralized mechanism, ensuring endpoints like a=upload cannot process requests without a valid token.

Integrate CSRF defenses at the framework or middleware level, adopt secure-by-default controller templates, and include CSRF checks as a standard item in code review and automated security testing for any new or modified endpoints.

Find out what's already
exploitable in your codebase.