/

CVE-2026-51907

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in TaskingAI QR Code Plugin

CVE-2026-51907

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write

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

A path traversal vulnerability in TaskingAI's QR Code Generator plugin allows an attacker to influence where generated image files are saved by manipulating the project_id parameter.

If the affected function is reachable with attacker-controlled input, files may be written to arbitrary locations accessible to the server process.

Affected context

The issue occurs in TaskingAI v0.3.0 within the QR Code Generator plugin's

save_base64_image function. It becomes risky when the project_id parameter

is accepted from an untrusted source and is used to construct a filesystem

path without sufficient normalization, confinement, or validation.

Exploit preconditions

  • Attack surface: The QR Code Generator plugin endpoint or code path that invokes save_base64_image
  • Required access: Access to submit or influence the project_id parameter; authentication requirements depend on the deployment
  • Trigger point: Image-saving logic that derives a filesystem destination from project_id
  • Why exploitation is possible: Insufficient path validation may allow attacker-controlled path components to escape the intended storage directory

Why this happens

The underlying bug is a failure to treat a user-controlled path component as untrusted data.

When project_id contributes directly to a filesystem path without canonicalization,

containment checks, and strict identifier validation, traversal sequences may resolve

outside the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • The attacker may overwrite files that are writable by the application process.
  • The attacker could place crafted content in locations consumed by other application components.
  • Application availability may be affected through damaging or replacing operational files.
  • In some deployments, arbitrary file writes could contribute to code execution or broader compromise.

General mitigation guidance

Mitigation generally focuses on removing filesystem path decisions from untrusted input.

Common defensive patterns include:

  • Accepting only opaque, allowlisted project identifiers rather than path-like values.
  • Resolving candidate paths canonically and verifying they remain within a dedicated storage directory.
  • Constructing destinations from server-side identifiers and fixed directories.
  • Using controlled file names, restrictive permissions, and a separate low-privilege service account.
  • Avoiding writes to executable, configuration, or sensitive system locations.
  • Applying filesystem isolation and quota controls where practical.

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings where request parameters flow into filesystem APIs such as file creation or path joining.
  • Code-review signals including string concatenation for paths, missing canonical containment checks, and unrestricted identifiers used as file names.
  • Tests that verify absolute paths, traversal-oriented inputs, encoded separators, and platform-specific path forms are rejected.
  • Runtime monitoring for unexpected writes outside approved application storage directories.
  • Policy enforcement requiring dedicated writable directories and least-privilege service accounts.

Automated code-review and software composition tools may help identify these patterns, but findings should be validated against deployment-specific path handling.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/357950ddd2f65566b1b33525651b5635
github.comgithub.com/TaskingAI/TaskingAI/issues/374

Frequently asked

questions

It may be remotely exploitable when the affected plugin operation is exposed through a network-accessible interface and accepts attacker-controlled project identifiers. The exact scope depends on authentication and deployment controls.

An attacker generally needs permission to invoke the image-generation or saving workflow, or another way to influence its input. The resulting impact is limited by the filesystem permissions of the TaskingAI process.

Treat project identifiers as logical identifiers, validate them against a strict allowlist, and generate paths only within a server-controlled storage directory after canonical containment checks.

Use path-handling libraries, enforce least-privilege filesystem permissions, add traversal-focused tests, monitor write locations, and require security review for any data flow from request parameters to filesystem APIs.

Find out what's already
exploitable in your codebase.