/

CVE-2026-61343

Severity:

HIGH RISK

(7.2)

Path Traversal (CWE-23) in LibreBooking Template Save

CVE-2026-61343

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-23

Impact:

Arbitrary File Write and Remote Code Execution

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

LibreBooking's email template editor save action constructs destination file paths directly from user-supplied template names, enabling path traversal.

When an authenticated administrator can control the template name, this flaw may allow writing arbitrary files outside the intended directory and executing server-side code.

Affected context

This vulnerability manifests in LibreBooking's email template editor where template names are used to derive file system paths.

It is relevant in deployments where administrators can save or update templates and the application writes these templates to disk on the server.

The risk increases when the web server executes files from locations reachable via crafted paths, or when configuration or script files can be overwritten.

Exploit preconditions

  • Attack surface: HTTP interface for LibreBooking's email template editor.
  • Required access: Valid administrator-level credentials with permission to manage email templates.
  • Trigger point: Invoking the template "save" action with a template name containing directory traversal sequences.
  • Why exploitation is possible: The application concatenates the user-controlled template name into the destination file path without normalizing or restricting it to the template directory, enabling traversal outside the intended location.

Why this happens

The underlying bug is unsafe construction of file system paths from unvalidated user input, aligning with CWE-23 (Relative Path Traversal).

Rather than enforcing a fixed base directory and canonicalizing incoming paths, the template save logic trusts the supplied template name and directly incorporates it into the output path.

This insecure pattern allows attackers to escape the designated templates directory and write files to arbitrary locations that the web server can access, potentially including executable scripts.

Potential impact

  • An attacker may write arbitrary files outside the template directory.
  • An attacker could plant executable server-side code (e.g., scripts) and achieve remote code execution.
  • An attacker can overwrite existing configuration or application files, potentially destabilizing the application.
  • An attacker may persist backdoors or modify logging and monitoring behavior.

General mitigation guidance

Effective mitigation focuses on strict path handling and reducing trust in user-supplied file names.

Common defensive patterns include:

  • Enforcing a fixed, canonical base directory and rejecting any path components that attempt traversal (e.g., .., absolute paths).
  • Normalizing and validating file names against an allowlist of permitted characters and patterns rather than accepting arbitrary input.
  • Using filesystem APIs that operate on opaque identifiers or references rather than raw paths where possible.
  • Ensuring that directories used for template storage are non-executable and cannot serve dynamic code.
  • Applying least-privilege file system permissions so the application can only write within specific controlled locations.

How teams detect issues like this

Detection typically involves reviewing path construction and file-write logic across the codebase.

Useful approaches include:

  • Static analysis rules that flag concatenation of user-controlled input into file paths or use of traversal-sensitive segments like ...
  • Manual code review focusing on file I/O operations, checking that all paths are derived from validated identifiers and constrained to known directories.
  • Runtime monitoring or application logs to identify suspicious template names or path patterns indicative of traversal attempts.
  • Policy-based checks in CI/CD pipelines that disallow unvalidated path usage or enforce standardized file handling utilities.

Sources

SourceLink
github.comgithub.com/LibreBooking/librebooking/commit/cb9b7ad9da0243bd105809f6a4a8a6b9147c71ea
github.comgithub.com/LibreBooking/librebooking/pull/1456
github.comgithub.com/LibreBooking/librebooking/releases/tag/v5.1.0
raw.githubusercontent.comraw.githubusercontent.com/cisagov/CSAF/develop/csaf_files/IT/white/2026/va-26-190-01.json
cve.orgcve.org/CVERecord?id=CVE-2026-61343

Frequently asked

questions

Yes, but only through LibreBooking's web interface and typically requires authenticated access to the email template editor.

The attacker must have administrator-level credentials or equivalent privileges that allow saving or editing email templates.

Constrain all template writes to a fixed, canonical directory, validate template names against strict rules, and reject any input that could alter the intended path or introduce traversal sequences.

Adopt secure file handling practices by never concatenating raw user input into paths, implement central utilities for path normalization and validation, and enforce code review and automated checks for path traversal patterns.

Find out what's already
exploitable in your codebase.