/

CVE-2026-36340

Severity:

HIGH RISK

(8.1)

Code Injection in Krayin CRM Compose Email Function

CVE-2026-36340

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

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

Krayin CRM versions up to 2.1.5 contain a code injection flaw in the compose email functionality that allows remote attackers to execute arbitrary code on the server.

When user-controlled input is processed unsafely during email composition, it can be interpreted as executable code instead of data, leading to high-impact compromise under certain configurations.

Affected context

This vulnerability affects deployments of Krayin CRM that expose the email compose feature to end users or integrated systems.

The issue manifests when user-supplied content in email fields (such as body, templates, or dynamic placeholders) is processed in a way that supports dynamic evaluation or templating on the server side.

Environments where email content is programmatically transformed, rendered, or extended through plugins are more likely to be impacted, especially if application-level safeguards around code evaluation are weak or absent.

Exploit preconditions

  • Attack surface: Network-accessible web interface or API endpoint for composing emails.
  • Required access: Ability to submit or influence email content (e.g., as an authenticated CRM user, integration, or compromised account).
  • Trigger point: Server-side processing of the email compose request, particularly where dynamic content is parsed or evaluated.
  • Why exploitation is possible: User-controlled fields are interpreted in a context where they can affect executable code paths (such as dynamic evaluation, templating, or script injection), allowing crafted input to be executed on the server instead of treated purely as data.

Why this happens

The root cause aligns with CWE-94: Improper Control of Generation of Code ('Code Injection').

Within the compose email functionality, user-supplied input is incorporated into a processing pipeline that supports dynamic behavior (for example, templating, macro expansion, or scripting).

Instead of strictly treating this input as inert content, the implementation allows it to influence generated code or expressions that are subsequently executed or evaluated.

This lack of separation between data and code, combined with insufficient validation or neutralization of dangerous constructs, enables attackers to inject input that becomes part of the executable context on the server.

Potential impact

  • Remote execution of arbitrary code within the application or web server context
  • Compromise of CRM data, including customer records, emails, and attachments
  • Use of the CRM server as a pivot point for lateral movement within the network
  • Installation of backdoors, webshells, or other persistent malicious components
  • Unauthorized access to secrets, configuration files, or connected services

General mitigation guidance

Mitigations typically focus on ensuring that user-supplied content in email composition is never treated as executable code.

Recommended defensive patterns include:

  • Avoiding dynamic evaluation (such as eval-like operations, expression parsing, or execution of user-controlled template logic) in email rendering.
  • Constraining email templating systems to a safe subset of operations that cannot influence control flow or execute arbitrary expressions.
  • Applying strict validation and sanitization to all fields used in email composition, especially those that feed into any parser or renderer with dynamic features.
  • Separating configuration and code from content, ensuring that user content cannot override or extend server-side logic.
  • Running email processing components with least-privilege accounts and limiting filesystem and network permissions to reduce blast radius if a flaw is exploited.

How teams detect issues like this

Detection approaches can combine code-level analysis with runtime monitoring:

  • Static analysis: Search for patterns where user-controlled input from email-related controllers or endpoints is passed into dynamic evaluation routines, script engines, or template engines that support arbitrary expressions.
  • Code review: Pay special attention to email templating and composition logic, flagging any use of eval-like APIs, dynamic function construction, or configurable expressions derived from user input.
  • Security testing: Use fuzzing or security-focused test cases against email compose endpoints to identify unintended interpretation of special syntax or constructs in message bodies or templates.
  • Policy enforcement: Establish development guidelines prohibiting direct evaluation of user content and require security sign-off for any new dynamic templating features in communication modules.

Sources

SourceLink
drive.google.comdrive.google.com/file/d/1yBdvbrXGf9fsFckmK9zTe2v8_vDtdicH/view
github.comgithub.com/cybercrewinc/CVE-2026-36340
github.comgithub.com/krayin/laravel-crm/releases/tag/v2.1.6

Frequently asked

questions

Yes. The vulnerability is reachable over the network through the compose email functionality, so an attacker who can interact with that feature can attempt exploitation remotely.

In most deployments, the attacker needs at least the level of access required to compose or influence emails in the CRM (such as an authenticated user account, compromised credentials, or an integration that can submit email content). The exact requirement depends on how broadly the feature is exposed.

The safest approach is to remove any dynamic code evaluation from email composition and rendering, ensuring that all user-supplied content is treated strictly as data. Where templating is required, use engines configured in a locked-down mode that cannot execute arbitrary expressions or functions, and explicitly validate all placeholders and variables.

Preventative measures include adopting a design rule that forbids evaluating user input as code, performing security reviews of any feature that introduces dynamic templating or scripting, and integrating static analysis and secure coding checks into the development pipeline to catch code injection patterns early.

Find out what's already
exploitable in your codebase.