/

CVE-2026-105293

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Legcord Theme IPC Handlers

CVE-2026-105293

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write, Directory Deletion, and Local Code Execution

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

Legcord contains a path traversal vulnerability in theme-related IPC handlers that do not sufficiently validate theme identifiers. If script executes in the Discord origin, such as through an XSS condition, it may escape the intended themes directory to write files, delete directories, or launch local executables.

Legcord contains a path traversal vulnerability in theme-related IPC handlers that do not sufficiently validate theme identifiers. If script executes in the Discord origin, such as through an XSS condition, it may escape the intended themes directory to write files, delete directories, or launch local executables.

Affected context

The vulnerability occurs in Legcord's theme IPC functionality when theme identifiers are derived from content associated with the Discord page and are used in filesystem operations without adequate path confinement. Exploitation depends on script execution in the Discord origin and access to the affected theme operations, including installation, uninstallation, or folder handling.

The vulnerability occurs in Legcord's theme IPC functionality when theme identifiers are derived from content associated with the Discord page and are used in filesystem operations without adequate path confinement. Exploitation depends on script execution in the Discord origin and access to the affected theme operations, including installation, uninstallation, or folder handling.

Exploit preconditions

  • Attack surface: Legcord theme IPC handlers, including themes.folder, themes.uninstall, and themes.install
  • Required access: Ability to execute script within the Discord origin, potentially through an XSS condition
  • Trigger point: Processing a user-influenced theme identifier during a filesystem operation
  • Why exploitation is possible: The identifier is not reliably constrained to the intended themes directory, allowing filesystem paths outside that directory to be selected
  • Attack surface: Legcord theme IPC handlers, including themes.folder, themes.uninstall, and themes.install
  • Required access: Ability to execute script within the Discord origin, potentially through an XSS condition
  • Trigger point: Processing a user-influenced theme identifier during a filesystem operation
  • Why exploitation is possible: The identifier is not reliably constrained to the intended themes directory, allowing filesystem paths outside that directory to be selected

Why this happens

The underlying bug is improper neutralization of path elements in externally influenced input. Theme identifiers are used to construct filesystem paths without sufficient canonicalization, validation, or containment checks, allowing traversal outside the trusted themes directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

The underlying bug is improper neutralization of path elements in externally influenced input. Theme identifiers are used to construct filesystem paths without sufficient canonicalization, validation, or containment checks, allowing traversal outside the trusted themes directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • An attacker may write files outside the themes directory
  • An attacker could recursively delete accessible directories or files
  • Local executables may be launched through unsafe filesystem or integration behavior
  • User data, application integrity, or system availability could be affected
  • The desktop application may be used as a bridge from web-origin script to local resources
  • An attacker may write files outside the themes directory
  • An attacker could recursively delete accessible directories or files
  • Local executables may be launched through unsafe filesystem or integration behavior
  • User data, application integrity, or system availability could be affected
  • The desktop application may be used as a bridge from web-origin script to local resources

General mitigation guidance

Mitigation generally focuses on enforcing a strong boundary between web-origin input and local filesystem operations.

Common defensive patterns include:

  • Treating theme identifiers as opaque names rather than filesystem paths
  • Allowlisting permitted characters and rejecting traversal indicators or path separators
  • Resolving candidate paths canonically and confirming they remain within the designated themes directory
  • Using fixed internal identifiers instead of directly incorporating user-controlled values into paths
  • Separating privileged filesystem actions from web-origin IPC requests
  • Requiring explicit authorization and applying least privilege to local operations
  • Restricting executable launching and using safe-by-default IPC contracts

Mitigation generally focuses on enforcing a strong boundary between web-origin input and local filesystem operations.

Common defensive patterns include:

  • Treating theme identifiers as opaque names rather than filesystem paths
  • Allowlisting permitted characters and rejecting traversal indicators or path separators
  • Resolving candidate paths canonically and confirming they remain within the designated themes directory
  • Using fixed internal identifiers instead of directly incorporating user-controlled values into paths
  • Separating privileged filesystem actions from web-origin IPC requests
  • Requiring explicit authorization and applying least privilege to local operations
  • Restricting executable launching and using safe-by-default IPC contracts

How teams detect issues like this

Organizations can look for path traversal risks through:

  • Static analysis of path joins, normalization routines, and filesystem APIs receiving IPC or web-origin data
  • Code review checks for missing canonical-path containment validation
  • Review of IPC handlers that expose file creation, deletion, directory access, or process-launching behavior
  • Tests using traversal-like and encoded path values to verify rejection and directory confinement
  • Runtime policy monitoring for unexpected writes, deletions, or process launches by the desktop application
  • Automated security review tools that flag untrusted input flowing into filesystem operations

Organizations can look for path traversal risks through:

  • Static analysis of path joins, normalization routines, and filesystem APIs receiving IPC or web-origin data
  • Code review checks for missing canonical-path containment validation
  • Review of IPC handlers that expose file creation, deletion, directory access, or process-launching behavior
  • Tests using traversal-like and encoded path values to verify rejection and directory confinement
  • Runtime policy monitoring for unexpected writes, deletions, or process launches by the desktop application
  • Automated security review tools that flag untrusted input flowing into filesystem operations

Sources

SourceLink
github.comgithub.com/Legcord/Legcord
github.comgithub.com/Legcord/Legcord/blob/v1.3.0/src/common/themes.ts#L269-L276
github.comgithub.com/Legcord/Legcord/blob/v1.3.0/src/discord/ipc.ts#L201-L206
github.comgithub.com/Legcord/Legcord/issues/1163
vulncheck.comvulncheck.com/advisories/legcord-1.1.0-through-1.3.0-path-traversal-via-theme-ipc-handlers

Frequently asked

questions

It is not typically exploitable as a standalone network attack. Exploitation generally requires script execution in the Discord origin, such as through an XSS condition, combined with access to the vulnerable theme IPC functionality.

The attacker needs a way to run script in the relevant application origin and cause the theme handlers to process attacker-influenced identifiers. Local filesystem permissions still limit which resources can be modified or deleted.

Keep theme identifiers separate from filesystem paths, allowlist valid identifiers, and verify after canonicalization that every resolved path remains inside the intended themes directory.

Minimize privileged IPC exposure to web content, validate all IPC inputs at trust boundaries, apply least privilege, and test filesystem operations against traversal and path-confusion cases.

It is not typically exploitable as a standalone network attack. Exploitation generally requires script execution in the Discord origin, such as through an XSS condition, combined with access to the vulnerable theme IPC functionality.

The attacker needs a way to run script in the relevant application origin and cause the theme handlers to process attacker-influenced identifiers. Local filesystem permissions still limit which resources can be modified or deleted.

Keep theme identifiers separate from filesystem paths, allowlist valid identifiers, and verify after canonicalization that every resolved path remains inside the intended themes directory.

Minimize privileged IPC exposure to web content, validate all IPC inputs at trust boundaries, apply least privilege, and test filesystem operations against traversal and path-confusion cases.

Find out what's already
exploitable in your codebase.