Summary
TidGi-Desktop up to version 0.13.0 contains a code injection vulnerability in the Git Repository Import workflow, allowing attacker-controlled content to influence script execution during wiki loading.
When a remote attacker can supply or modify Git-based wiki data, they may inject executable code into the application context, leading to high-impact compromise of the desktop environment.
Affected context
The vulnerability occurs in TidGi-Desktop when wiki content is imported from Git repositories via the loadWikiTiddlersWithSubWikis worker logic.
It manifests in scenarios where repository content or metadata is treated as trusted input and incorporated into executable or interpretable code paths.
Environments that automatically fetch and process remote Git-based wikis without strict sanitization or isolation are more exposed to this risk.
Exploit preconditions
- Attack surface: Git repository import mechanism for wiki content and sub-wikis.
- Required access: Ability to host or modify a Git repository that TidGi-Desktop will import, or influence the repository URL/configuration used by the application.
- Trigger point: Invocation of the wiki worker that loads tiddlers and sub-wikis from the repository, causing untrusted data to be processed by code-building or evaluation routines.
- Why exploitation is possible: Imported repository data is not consistently sanitized or constrained before being embedded into code constructs or evaluated, enabling attackers to smuggle crafted payloads that the application later executes.
Why this happens
The underlying bug stems from treating repository-derived wiki data as inherently safe and allowing it to flow into code generation or execution paths.
This maps to CWE-94: Code Injection and CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, where untrusted input is used to construct or parameterize code or configuration that a downstream interpreter executes.
Abstractly, the pattern is: data fetched from a remote Git source is used in a scripting, template, or configuration context without robust neutralization of control characters, script constructs, or executable expressions, allowing adversaries to turn data channels into code channels.
Potential impact
- An attacker may execute arbitrary code within the TidGi-Desktop process.
- Malicious code could access or exfiltrate local user data managed by the application.
- The compromise can potentially be extended to the underlying operating system user account, depending on runtime permissions.
- Attacker-controlled wiki content may be used to persist backdoors or alter application behavior.
General mitigation guidance
Mitigation should focus on breaking the link between untrusted repository content and executable code paths.
Common defensive patterns include:
- Treating all remote Git repository data as untrusted and applying strict input validation and output encoding before using it in any scripting or templating context.
- Avoiding dynamic code construction from wiki content; prefer declarative formats and whitelist-based configuration parsing.
- Running wiki workers and import routines with least-privilege and, where feasible, in a sandboxed or isolated execution environment to limit impact if parsing is abused.
- Introducing trust boundaries for repositories (e.g., only importing from vetted sources) and explicit user confirmation when processing untrusted or newly added wikis.
How teams detect issues like this
High-level detection often starts with code review focused on how imported repository data is consumed:
- Identify locations where Git-sourced wiki content or metadata is concatenated into strings that are later interpreted as code, configuration, or script.
- Use static analysis rules to flag use of dynamic evaluation APIs, script injection points, or template engines that consume remote content without context-aware escaping.
- Establish secure coding policies requiring output encoding and parameterized APIs for any feature that renders or executes user- or repository-supplied data.
- Automated tools and CI checks can be configured to scan for code injection sinks (e.g., dynamic eval, function constructors, or command execution routines) that receive data from wiki import services.

