/

CVE-2026-33733

Severity:

HIGH RISK

(7.2)

Path Traversal in EspoCRM Admin Interface

CVE-2026-33733

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-23

Impact:

Arbitrary File Read/Write within Application Filesystem Context

Severity:

HIGH RISK

(7.2)

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

EspoCRM's admin template management endpoints accept attacker-controlled name and scope values and use them directly in template path construction without proper normalization or traversal filtering.

An authenticated administrator can abuse ../ sequences to escape the intended template directory and read, create, overwrite, or delete arbitrary files that resolve to body.tpl or subject.tpl within the web server user's filesystem scope.

Affected context

The vulnerability occurs in EspoCRM's administrative template management functionality, where template identifiers supplied by an authenticated admin are translated into filesystem paths.

The issue is present when user-provided name and scope values are accepted as-is and concatenated into paths without normalization, canonicalization, or filtering of directory traversal sequences.

It manifests in environments where the web application user has permission to read or modify files reachable via the resolved body.tpl or subject.tpl paths.

Exploit preconditions

  • Attack surface: HTTP(S) admin template management endpoints exposed by EspoCRM
  • Required access: Authenticated access with administrative privileges to the EspoCRM instance
  • Trigger point: Submission of crafted name and scope parameters containing ../ directory traversal sequences when creating, editing, or managing templates
  • Why exploitation is possible: The application constructs filesystem paths directly from user-supplied input without normalizing or validating the final path, allowing attackers to break out of the intended template directory and operate on arbitrary body.tpl or subject.tpl files under the web server user's permissions

Why this happens

This vulnerability stems from improper neutralization of special elements used in path traversal (CWE-23).

The template management code treats name and scope as trusted identifiers and interpolates them into filesystem paths without:

  • Canonicalizing the resulting path
  • Rejecting or sanitizing ../ and similar traversal sequences
  • Enforcing that the final path resides within an allowed base directory

As a result, an attacker with admin access can cause the application to resolve paths outside the expected templates directory, enabling unauthorized file read and write operations for files named body.tpl or subject.tpl.

Potential impact

  • Reading sensitive configuration or template files that match the target filenames within reachable directories
  • Overwriting existing template files to alter application behavior or content rendering
  • Creating new template files in unintended locations, potentially affecting system behavior or future template resolution
  • Deleting template-related files, leading to denial of service for specific email or UI rendering workflows
  • Indirect exposure of secrets or internal data if such information is stored in accessible body.tpl or subject.tpl files

General mitigation guidance

Effective mitigation focuses on robust path handling and strict confinement of file operations:

  • Treat all template identifiers (name, scope, etc.) as untrusted input, even from administrative interfaces
  • Normalize and canonicalize paths before use, and verify that the resolved path remains within a predefined template root directory
  • Reject or strictly filter directory traversal sequences (../, ..\\) and other special path elements before constructing filesystem paths
  • Use whitelisting of allowed template scopes/names (e.g., predefined sets or controlled patterns) rather than accepting arbitrary strings
  • Run the web application under a minimally privileged account with restricted filesystem permissions, limiting the impact of any file operations
  • Separate template storage from other sensitive application or system files to reduce the blast radius of any traversal defect

How teams detect issues like this

Detection can combine code-level analysis with runtime monitoring:

  • Static analysis: Look for string concatenation or interpolation that builds filesystem paths directly from HTTP parameters or request data (name, scope) without normalization or safety checks
  • Code review cues: Verify that all file operations in template management enforce a fixed base directory and validate resolved paths against that base; flag any use of user input in path construction lacking canonicalization
  • Policy enforcement: Adopt secure coding guidelines that prohibit direct concatenation of user input into filesystem paths; enforce these rules via linters or custom static analysis checks
  • Runtime monitoring: Log template management operations, including resolved paths; alert on unexpected directory patterns or attempts to access files outside the known template directory structure
  • Automated tools: Employ SAST tools configured with rules for CWE-23 to highlight potential directory traversal vulnerabilities in file handling code

Sources

SourceLink
github.comgithub.com/espocrm/espocrm/security/advisories/GHSA-44c3-xjfp-3jrh

Frequently asked

questions

Yes, but only through EspoCRM's admin interface. An attacker must be able to reach the administrative template management endpoints over the network; once authenticated as an admin, they can send crafted requests to exploit the traversal behavior.

The attacker needs valid administrative credentials for the EspoCRM instance. Regular user accounts without access to template management endpoints cannot directly exploit this vulnerability.

The most robust fix is to construct all filesystem paths from safe, server-side base directories and validated identifiers, then canonicalize the resulting path and enforce that it remains within the intended directory. Any path that resolves outside the allowed root should be rejected.

Adopt defensive patterns that treat all user-controlled path components as untrusted: avoid direct concatenation, normalize and validate paths, use whitelists for allowable identifiers, and enforce strict base-directory constraints. Incorporate these rules into secure coding standards and automated checks in your CI pipeline.

Find out what's already
exploitable in your codebase.