GHSA-JH93-48GG-GQJP
Path traversal in generate_skill default output path via skill_name
Texto original en inglés · Ver en español
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche v0.64.2 | github.com/zzet/gortex · -2 d desde divulgación | |
| Divulgación | Publicada | GHSA-JH93-48GG-GQJP divulgada · CVSS 3.3 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
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.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/zzet/gortex |
Corregida | v0.64.2 | -2 d | v0.64.11 no afectada |
v0.64.2Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/zzet/gortex/security/advisories/GHSA-jh93-48gg-gqjpLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
