/

CVE-2026-38526

Severity:

CRITICAL RISK

(9.9)

Unrestricted File Upload in Webkul Krayin CRM TinyMCE Admin

CVE-2026-38526

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.9)

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

An authenticated arbitrary file upload vulnerability in the /admin/tinymce/upload endpoint of Webkul Krayin CRM v2.2.x allows users to upload executable PHP files.

When exploited, this can lead to remote code execution on the server hosting the CRM whenever the uploaded script is accessed.

Affected context

This vulnerability arises in Webkul Krayin CRM v2.2.x within the administrative TinyMCE file upload feature.

The affected context is environments where authenticated users can reach /admin/tinymce/upload and the application stores uploaded content in a web-accessible location on a PHP-capable server.

The issue is most relevant when file type validation is weak or purely client-side, and when the web server is configured to execute uploaded PHP files rather than treating them as inert content.

Exploit preconditions

  • Attack surface: HTTP(S) POST requests to the /admin/tinymce/upload endpoint.
  • Required access: Valid authenticated credentials with permission to access the admin TinyMCE uploader (e.g., low-privileged admin or staff account, depending on deployment configuration).
  • Trigger point: Submission of a crafted upload request that includes a PHP file disguised or accepted as a normal upload.
  • Why exploitation is possible: The upload handler does not sufficiently restrict file types, extensions, or storage locations, allowing executable PHP files to be stored under the web root and subsequently invoked via a browser or HTTP request.

Why this happens

The core issue maps to CWE-434: Unrestricted Upload of File with Dangerous Type.

The upload endpoint responsible for handling TinyMCE file uploads fails to enforce robust server-side checks on file type, extension, and content.

As a result, user-controlled input (the uploaded file) is stored in an executable context on the server, and PHP interpreters process it as code rather than as passive data.

This pattern reflects a broader class of bugs where content upload features implicitly trust authenticated users and omit defense-in-depth controls like content validation, execution blocking, or upload sandboxing.

Potential impact

  • Remote execution of arbitrary PHP code on the CRM server.
  • Full compromise of the CRM application, including access to customer and business data.
  • Pivoting to underlying operating system compromise, depending on web server and PHP permissions.
  • Installation of web shells for persistent access and further manual exploitation.
  • Use of the compromised CRM server as a launchpad for attacks on adjacent systems and internal networks.

General mitigation guidance

Effective mitigation focuses on transforming the upload feature into a strictly non-executable, least-privilege data channel:

  • Enforce server-side allowlists of permitted file types, checking both extension and MIME type, and rejecting any potentially executable formats (e.g., PHP, CGI, scripts).
  • Store uploads outside of directories that the web server treats as executable, or configure the server to disable script execution in upload paths.
  • Normalize and sanitize file names, ignoring client-provided extensions and generating server-controlled file names and paths.
  • Add content validation where feasible (e.g., verifying that an "image" is actually an image) rather than relying on client-side checks.
  • Run the web server and PHP with least privileges, minimizing filesystem and process capabilities so that uploaded content cannot escalate beyond the web application context.
  • Apply defense-in-depth controls like web application firewalls (WAFs) to detect and block suspicious upload patterns.

How teams detect issues like this

Detection typically combines code-focused and operational approaches:

  • Static analysis: Search for upload handlers that:
  • Accept arbitrary file extensions.
  • Write files directly under web-accessible paths.
  • Lack server-side file type validation or content inspection.
  • Code review signals:
  • Direct use of move_uploaded_file or equivalent APIs without extension checks.
  • Trust in client-side validation (JavaScript or TinyMCE configuration) as the primary filter.
  • Absence of configuration disabling script execution in upload directories.
  • Runtime monitoring:
  • Log and alert on uploads with uncommon or executable extensions (e.g., .php, .phtml, .php5).
  • Monitor web access logs for execution of files in known upload directories.
  • Use host-based intrusion detection (HIDS) to detect creation or modification of executable files in web roots.
  • Automated security testing tools (SAST, DAST, and dependency-aware scanners) can help surface unrestricted upload patterns and verify that upload directories are not executable.

Sources

SourceLink
github.comgithub.com/TREXNEGRO/Security-Advisories/tree/main/CVE-2026-38526
github.comgithub.com/krayin/laravel-crm
github.comgithub.com/TREXNEGRO/Security-Advisories/blob/main/CVE-2026-38526/poc.md

Frequently asked

questions

It is remotely exploitable over HTTP or HTTPS, but the attacker must already have authenticated access to the application and be able to reach the /admin/tinymce/upload endpoint.

The attacker needs a valid account with sufficient permissions to use the TinyMCE admin upload functionality. The exact role required depends on how roles and permissions are configured in the specific deployment, but it does not inherently require full system administrator access.

The safest pattern is to strictly limit uploads to a small set of benign file types, verify them server-side, store them in non-executable locations, and ensure the web server does not execute any content from the upload directory. The application should treat all uploaded files as untrusted data and never allow them to be processed by the PHP interpreter.

When designing upload features, assume all users—even authenticated ones—may be hostile. Adopt a default-deny policy for file types, separate data storage from executable code, review upload flows during security design reviews, and enforce these patterns via coding standards and automated checks in CI pipelines.

Find out what's already
exploitable in your codebase.