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_idparameter; 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.

