/

CVE-2026-62331

Severity:

HIGH RISK

(8.2)

Path Traversal (CWE-22) in Praktor Telegram Uploads

CVE-2026-62331

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Stored Instruction Injection

Severity:

HIGH RISK

(8.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

Praktor's Telegram upload handlers can use an attacker-controlled filename to construct a destination path without adequately preventing parent-directory traversal. A remote Telegram user who can message the bot may write or overwrite files in the persistent agent workspace, potentially causing stored instruction injection in later Claude agent runs.

Praktor's Telegram upload handlers can use an attacker-controlled filename to construct a destination path without adequately preventing parent-directory traversal. A remote Telegram user who can message the bot may write or overwrite files in the persistent agent workspace, potentially causing stored instruction injection in later Claude agent runs.

Affected context

The issue occurs in Praktor deployments where Telegram document uploads are handled by the affected upload paths and filenames are incorporated into destination paths without sufficient sanitization. It is especially risky when the bot accepts messages from unrestricted senders and the persistent /workspace/agent volume contains files that influence Claude agent behavior, such as instructions, skills, hooks, or configuration.

The issue occurs in Praktor deployments where Telegram document uploads are handled by the affected upload paths and filenames are incorporated into destination paths without sufficient sanitization. It is especially risky when the bot accepts messages from unrestricted senders and the persistent /workspace/agent volume contains files that influence Claude agent behavior, such as instructions, skills, hooks, or configuration.

Exploit preconditions

  • Attack surface: Telegram document upload handling
  • Required access: Ability to send a message or document to the Praktor bot; authentication may not be required when sender restrictions are left open
  • Trigger point: Processing and storing an uploaded document using its supplied filename
  • Why exploitation is possible: Path construction permits parent-directory traversal, allowing the resulting destination to escape the intended uploads/ directory while remaining within the mounted agent workspace
  • Attack surface: Telegram document upload handling
  • Required access: Ability to send a message or document to the Praktor bot; authentication may not be required when sender restrictions are left open
  • Trigger point: Processing and storing an uploaded document using its supplied filename
  • Why exploitation is possible: Path construction permits parent-directory traversal, allowing the resulting destination to escape the intended uploads/ directory while remaining within the mounted agent workspace

Why this happens

The vulnerable upload handlers concatenate attacker-controlled filenames into filesystem paths and rely on path.Join without first enforcing a trusted destination boundary. Because path normalization can resolve parent-directory components, an uploaded name can reference files outside the intended directory. This is a path traversal flaw mapped to CWE-22, and its effect is amplified when written files are later trusted as agent instructions or operational configuration.

The vulnerable upload handlers concatenate attacker-controlled filenames into filesystem paths and rely on path.Join without first enforcing a trusted destination boundary. Because path normalization can resolve parent-directory components, an uploaded name can reference files outside the intended directory. This is a path traversal flaw mapped to CWE-22, and its effect is amplified when written files are later trusted as agent instructions or operational configuration.

Potential impact

  • An attacker may create or overwrite files in the persistent agent workspace
  • Later agent runs could consume attacker-controlled instructions or configuration
  • The Claude agent may perform unintended actions based on planted files
  • Hooks, skills, or other workspace behavior may be altered
  • Data integrity and workflow reliability could be compromised
  • The issue could support persistence across subsequent agent runs
  • An attacker may create or overwrite files in the persistent agent workspace
  • Later agent runs could consume attacker-controlled instructions or configuration
  • The Claude agent may perform unintended actions based on planted files
  • Hooks, skills, or other workspace behavior may be altered
  • Data integrity and workflow reliability could be compromised
  • The issue could support persistence across subsequent agent runs

General mitigation guidance

Mitigation generally focuses on treating upload filenames as untrusted metadata and enforcing a strict destination boundary.

Common defensive patterns include:

  • Discarding user-supplied path components and generating server-side storage names
  • Canonicalizing the candidate path and verifying that it remains beneath the intended upload directory
  • Rejecting absolute paths, traversal components, and platform-specific separator variants
  • Separating uploaded content from instruction, hook, skill, and configuration locations
  • Restricting which files the agent can read or execute from persistent workspace storage
  • Requiring explicit sender authorization rather than permitting all Telegram users by default
  • Applying least privilege to the bot process and workspace volume
  • Using isolated, non-persistent storage when persistence is not necessary

Mitigation generally focuses on treating upload filenames as untrusted metadata and enforcing a strict destination boundary.

Common defensive patterns include:

  • Discarding user-supplied path components and generating server-side storage names
  • Canonicalizing the candidate path and verifying that it remains beneath the intended upload directory
  • Rejecting absolute paths, traversal components, and platform-specific separator variants
  • Separating uploaded content from instruction, hook, skill, and configuration locations
  • Restricting which files the agent can read or execute from persistent workspace storage
  • Requiring explicit sender authorization rather than permitting all Telegram users by default
  • Applying least privilege to the bot process and workspace volume
  • Using isolated, non-persistent storage when persistence is not necessary

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying filesystem joins that incorporate request, message, or upload metadata
  • Code review checks for direct use of filenames in storage paths
  • Tests covering parent-directory components, absolute paths, alternate separators, and normalization behavior
  • Runtime monitoring for writes outside the designated upload directory
  • File-integrity monitoring for unexpected changes to agent instructions, hooks, skills, and configuration
  • Policy enforcement requiring server-generated upload identifiers and sender allowlists
  • Automated security review tools that flag path construction using untrusted input

Organizations can look for this class of issue through:

  • Static analysis rules identifying filesystem joins that incorporate request, message, or upload metadata
  • Code review checks for direct use of filenames in storage paths
  • Tests covering parent-directory components, absolute paths, alternate separators, and normalization behavior
  • Runtime monitoring for writes outside the designated upload directory
  • File-integrity monitoring for unexpected changes to agent instructions, hooks, skills, and configuration
  • Policy enforcement requiring server-generated upload identifiers and sender allowlists
  • Automated security review tools that flag path construction using untrusted input

Sources

SourceLink
github.comgithub.com/mtzanidakis/praktor/commit/c3731eeda01c0b3ec1dbd13cccd5a147c3182141
github.comgithub.com/mtzanidakis/praktor/pull/228
github.comgithub.com/mtzanidakis/praktor/releases/tag/v0.9.1
github.comgithub.com/mtzanidakis/praktor/security/advisories/GHSA-48v2-6jcm-fc99

Frequently asked

questions

Yes, when the Telegram bot accepts documents from a remote user and the affected upload handlers process the supplied filename. The demonstrated write scope is the persistent agent workspace, not an unrestricted host filesystem.

It depends on sender restrictions. With an open configuration such as allow_from: [], a user may be able to message the bot without prior authentication or privilege. More restrictive access controls reduce the reachable attack surface.

Treat uploaded filenames as untrusted data, generate storage names independently, and verify that every resolved destination remains inside a dedicated upload directory. Uploaded content should also be separated from files that control agent behavior.

Use centralized safe path-handling utilities, test path-boundary enforcement, restrict Telegram senders by default, monitor sensitive workspace files, and apply least privilege to the bot and its persistent storage.

Yes, when the Telegram bot accepts documents from a remote user and the affected upload handlers process the supplied filename. The demonstrated write scope is the persistent agent workspace, not an unrestricted host filesystem.

It depends on sender restrictions. With an open configuration such as allow_from: [], a user may be able to message the bot without prior authentication or privilege. More restrictive access controls reduce the reachable attack surface.

Treat uploaded filenames as untrusted data, generate storage names independently, and verify that every resolved destination remains inside a dedicated upload directory. Uploaded content should also be separated from files that control agent behavior.

Use centralized safe path-handling utilities, test path-boundary enforcement, restrict Telegram senders by default, monitor sensitive workspace files, and apply least privilege to the bot and its persistent storage.

Find out what's already
exploitable in your codebase.