# GHSA-JH93-48GG-GQJP: Path traversal in generate\_skill default output path via skill\_name

- Database: GitHub
- Severity: CVSS 3.3 (Low)
- Published: 2026-09-11
- Modified: 2026-09-11

## Affected versions

- github.com/zzet/gortex (Go): fixed in v0.64.2

## Description

### Summary

The generate_skill MCP tool allows path traversal through the skill_name parameter when output_dir is omitted. The default output directory is constructed from an indexed repository root and the unvalidated skill_name, allowing generated files to be created outside the repository containment boundary.

### Details

In internal/mcp/tools_generate_skill.go, skill_name is only trimmed. When output_dir is empty, the handler constructs:

    absOutputDir = filepath.Join(repoRoot, ".claude", "skills", skillName)

The explicit output_dir branch calls resolveFilePath and applies repository confinement, but the default branch does not apply the equivalent guard. Later, the handler writes to absOutputDir using os.MkdirAll and os.WriteFile for SKILL.md and the references tree.

The documented Gortex security model states that MCP agent file access is confined to indexed repository roots because indexed content may influence agent tool calls. This path bypasses that boundary.

### PoC

Prerequisites: run Gortex with an indexed Git repository containing a readable source directory. Invoke generate_skill in editing mode with output_dir omitted:

    {
      "directory": "/path/to/repo/src",
      "skill_name": "../../../gortex-outside",
      "dry_run": false
    }

For a repository at /tmp/work/repo, the handler resolves:

    /tmp/work/repo/.claude/skills/../../../gortex-outside

which normalizes to:

    /tmp/work/gortex-outside

The handler then creates that directory and writes SKILL.md outside the indexed repository root. The same behavior was confirmed in an isolated Go test executing the same filepath.Join, os.MkdirAll, and os.WriteFile primitives with a temporary repository tree. No real user path was modified.

### Impact

A caller able to invoke the MCP tool can create or overwrite SKILL.md and generated reference files outside every indexed repository root, subject to the daemon process permissions. In the documented prompt-injection threat model, untrusted indexed content can influence an agent to invoke tools with attacker-controlled arguments. This breaks the stated filesystem containment boundary and may affect trusted agent skill directories or other writable locations on the same filesystem.


### Suggested remediation

Validate skill_name as a single safe path component (reject path separators, absolute paths, . and ..), or route the default destination through the same repository confinement guard used for explicit output_dir values. A post-join containment check should also resolve symlinks before writing.

## References

- https://github.com/zzet/gortex/security/advisories/GHSA-jh93-48gg-gqjp

Page: https://cve.now/GHSA-JH93-48GG-GQJP

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
