/

CVE-2026-58143

Severity:

HIGH RISK

(8.8)

CSRF (CWE-352) in Cotonti admin config upload rules

CVE-2026-58143

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Configuration Tampering Leading to Remote Code Execution

Severity:

HIGH RISK

(8.8)

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 Siena up to version 0.9.26 contains a cross-site request forgery flaw in the admin configuration update handler, where CSRF validation is never invoked.

By tricking a logged-in administrator into submitting a forged POST request, an attacker can disable file extension checks in the PFS module, which may lead to arbitrary PHP file upload and code execution on the server.

Affected context

This vulnerability occurs in Cotonti Siena installations where administrators use the web-based configuration panel via admin.php to manage settings, including Personal File Storage (PFS) options.

The risk is present when:

  • Administrators are logged in and browse other websites or open malicious links.
  • The admin configuration update handler processes POST requests without verifying a CSRF token.
  • PFS is enabled and regular users have some level of upload or PFS access.

Under these conditions, misconfigurations induced through CSRF can weaken upload protections and indirectly expose the server to arbitrary file upload and execution.

Exploit preconditions

  • Attack surface: HTTP POST endpoint for admin.php configuration updates.
  • Required access: No direct authentication needed by the attacker; they rely on a victim administrator who is authenticated in Cotonti.
  • Victim state: Administrator must be logged in (active session cookie) and induced to visit an attacker-controlled page or resource while logged in.
  • Trigger point: A crafted HTML form or script in the attacker page auto-submits a POST request to the vulnerable admin.php config handler.
  • Why exploitation is possible: The configuration update handler does not call the standard CSRF validation function, so it trusts cross-origin POST requests authenticated solely by the admin's session cookie.

Why this happens

The underlying issue is a missing cross-site request forgery protection check on a sensitive state-changing endpoint.

The admin configuration update handler accepts POST requests that modify security-relevant options (such as the pfsfilecheck setting) without validating a CSRF token or enforcing same-origin protections.

This maps to CWE-352: Cross-Site Request Forgery (CSRF), where an application relies solely on ambient authentication (cookies) and does not bind user intent to requests that perform privileged actions, allowing attackers to piggyback on a victim's authenticated session.

Potential impact

  • Attackers may disable file extension whitelisting in the PFS module by setting pfsfilecheck to 0.
  • Any user with PFS access could potentially upload arbitrary PHP files or other executable scripts.
  • Successful upload of executable files can lead to remote code execution in the context of the web server.
  • Unauthorized changes to other administrative configuration settings may weaken security posture or disrupt application behavior.
  • Escalation from a single compromised administrator session to full server compromise.

General mitigation guidance

Effective mitigation focuses on enforcing strong CSRF protections and limiting the blast radius of configuration changes:

  • Apply a robust CSRF defense pattern (synchronizer tokens or double-submit cookies) on all state-changing admin endpoints and ensure the validation function is invoked consistently.
  • Restrict access to configuration-changing routes to same-origin requests with validated CSRF tokens and appropriate HTTP methods (e.g., POST with token, not GET).
  • Treat security-sensitive settings (such as upload and execution-related options) as high-risk and require explicit confirmation or re-authentication for changes.
  • Reduce trust in user-uploadable content by default: disallow execution of files in upload directories and avoid mapping upload paths to executable script handlers.
  • Apply least-privilege principles for user roles in PFS, granting upload rights only where necessary and segregating executable and non-executable storage.

How teams detect issues like this

Organizations can detect this class of issue using a combination of review and automated analysis:

  • Static analysis or security linters can flag state-changing endpoints that lack CSRF token checks or validation calls.
  • Code review checklists should specifically verify that all admin configuration handlers validate CSRF tokens and reject requests without them.
  • Dynamic application security testing (DAST) tools can probe administrative actions for CSRF susceptibility by sending forged cross-origin requests.
  • Web application firewalls or reverse proxies may enforce additional CSRF-like protections (e.g., strict Origin/Referer validation) as a defense-in-depth measure, though they should not replace in-application checks.
  • Logging of admin configuration changes, including source IP and user agent, can help detect suspicious or unexpected bulk modifications.

Sources

SourceLink
gist.github.comgist.github.com/sermikr0/75686815e441c07462cfdea2fed5d305
vulncheck.comvulncheck.com/advisories/cotonti-siena-csrf-via-admin-php-config-update-endpoint

Frequently asked

questions

Yes. An attacker on the internet can exploit it by luring an authenticated administrator to a malicious page that silently submits a forged POST request to the Cotonti admin configuration endpoint.

No. The attacker does not need their own account; they rely on the victim administrator's existing authenticated session. The browser automatically attaches the admin's cookies to the forged request.

Ensure that every state-changing administrative endpoint enforces CSRF protection by verifying a cryptographically strong anti-CSRF token and rejecting requests without a valid token. Additionally, treat upload-related configuration as security-critical and protect it with extra confirmation or re-authentication.

Adopt a framework-level CSRF protection mechanism and mandate its use for all POST, PUT, PATCH, and DELETE operations that alter server state. Combine this with secure defaults for file upload handling, least-privilege role design, and regular security-focused code reviews to catch missing CSRF checks early in development.

Find out what's already
exploitable in your codebase.