llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · memtomem-stm

GHSA-2P94-5932-5F3P

Surfacing daemon and generated registrations run `python -m` with the project directory on sys.path

Texto original en inglés · Ver en español

Sin parche publicado
Descargar PNG JSON
CVSS
—
medium
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición7 dDesde la divulgación, 13 nov 2026, 6:15 p. m.
Detección7 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (media) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
Tu backlog la recibirá con los brazos abiertos.Paso a paso, como subiendo al Cotopaxi.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
13 nov 26
21 nov 26
13 nov 26
15 nov 26
17 nov 26
19 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-2P94-5932-5F3P divulgada
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

The surfacing daemon is started as `python -m memtomem_stm daemon run --detached` with the
hook process's working directory inherited. Under `-m`, Python puts the working directory at
`sys.path[0]`, ahead of the standard library and site-packages, so a module in the project
directory is imported instead of the installed one. Opening an untrusted checkout in a host
that has the `mms hook` PostToolUse hook installed can therefore run code from that checkout
as the user.

The 0.7.3 fix for GHSA-hqh4-75hx-xq46 hardened executable lookup (`PATH`); it does not
change `sys.path`.

Details
  • `src/memtomem_stm/daemon/spawn.py:33` builds
  • It is reached from `src/memtomem_stm/cli/hook_cmd.py:686-690` when no warm daemon answers.
  • The console-script entry points (`mms`, `memtomem-stm`, `memtomem-stm-proxy`) are not

Same launch shape, confirmed by reading the source but not run end to end:

  • `src/memtomem_stm/cli/proxy.py:978` (`_registration_command`) registers
  • `src/memtomem_stm/cli/proxy.py:6549` configures the bundled demo upstream as
Reproduction (0.7.7 source at 38a605af, macOS, Python 3.13.2)
  1. In an empty directory create `memtomem_stm/__init__.py` (empty) and
  2. With a fresh `HOME` (so no daemon is running) and default configuration, run from that
  3. The marker file appears; the shadow `__main__` received

A directory holding only `click.py` is enough as well: `python -m memtomem_stm --help` from
there imports it. So is a `types.py`, in an environment that has not already loaded `types`
at startup (a plain `python -m venv`).

Controls, all negative: the same command from an empty directory; the `mms` console script
from the shadow directories; `python -P -m memtomem_stm` from the shadow directories.

Impact

Arbitrary code execution as the user, in a detached process, on the first eligible tool call
(`Read`, `Grep`, `Glob`, `Bash` by default) made in an untrusted project directory while no
daemon for the current configuration is alive. A project that merely has a top-level module
whose name collides with something the daemon imports also breaks daemon startup there.

Fix

Every interpreter STM starts or registers is launched with `-P` (`safe_module_argv()` in
`src/memtomem_stm/utils/exec_env.py`), so Python no longer puts the working directory first on
its import path. A `PYTHONPATH` entry that names the working directory still applies; that is
the user's own environment.

An in-process guard (removing the working directory from `sys.path` at the top of the entry
modules) was tried and dropped: Python imports from the working directory before any STM code
runs (`runpy` needs `types`, among others), so in a plain venv a project `types.py` still ran.

Remediation after upgrading

Existing registrations are kept on upgrade and still start without `-P`. STM cannot protect
such a launch from inside, so each one has to be refreshed, passing the same `--config <path>`
if the registration uses a non-default config:

  • project `.mcp.json`: from that project, `mms register --client json --replace-registration`
  • Claude Code user scope: `mms register --client claude --replace-registration`;
  • Codex: `mms register --client codex --replace-registration`;
  • a host config edited or copied by hand: insert `"-P"` before `"-m"` in the entry's `args`;
  • the demo upstream: set `upstream_servers.demo.args` in `stm_proxy.json` to
Verification status

Verified locally on macOS (Python 3.12, 3.13, 3.14). Windows is unverified until the
post-merge CI matrix runs; `-P` is an interpreter flag with no platform-specific behaviour.

Versiones

Rangos afectados

Afectada Corregida
memtomem-stm≤ 0.7.7
0.7.7
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
PyPImemtomem-stm
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/memtomem/memtomem-stm/security/advisories/GHSA-2p94-5932-5f3p

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.