GHSA-HQH4-75HX-XQ46
Executables run by bare name can be found through the project directory, so a checkout can supply its own `memtomem-server`, `claude`, `codex`, `pgrep` or upstream server command
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-HQH4-75HX-XQ46 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
memtomem-stm runs executables by bare name while its working directory is the user's
project: the LTM server (`memtomem-server` by default) and stdio upstream servers, started
by the proxy, by hooks and by the hook-started daemon, and checked by `mms doctor`/health
probes; `claude` and `codex` from `mms init`, `mms add --from-clients`, `mms import`,
`mms host status|scan|sync`, `mms prune`, `mms doctor`, register/unregister and eject; and
`pgrep` from the proxy's and daemon's child cleanup. A bare name is resolved through `PATH` at spawn time, and a relative `PATH`
entry (`.`, an empty segment, `bin`) is resolved against that working directory. Where the
code checks `shutil.which(...)` first, the check resolves the same way, and the one site
that spawns the `which` result (`codex mcp list`) receives the same relative path.
So in a project an attacker controls, an executable with one of those names placed where
a relative `PATH` entry points runs with the user's privileges when the proxy is started
there by an MCP client (LTM server, upstream servers, `pgrep`) or when one of the commands
above runs there.
- POSIX: requires a relative entry in the user's `PATH`. Measured on macOS
- Windows: `CreateProcess` and `shutil.which` (which the MCP SDK uses for stdio commands)
Affected call sites (0.7.2)
- stdio servers: `surfacing/mcp_client.py` (LTM), `proxy/manager.py` (upstreams),
- `claude`: `src/memtomem_stm/cli/proxy.py` registration helpers (`mcp get/add/remove`),
- `codex`: `proxy.py` registration helpers (`mcp get/add/remove`, `get --json`, planned
- `pgrep`: `src/memtomem_stm/utils/child_reaper.py` (POSIX only), reached from the proxy
- `shutil.which` presence checks used to choose a path: `proxy.py` init mode selection,
Not affected: the daemon re-spawn uses `sys.executable` (absolute). Commands configured
with a path (`./x`, `/abs/x`) are an explicit choice and are run as given.
Patches
At startup STM removes `PATH` entries that are not fully qualified (relative, empty,
drive-relative or root-relative) and, on Windows, sets `NoDefaultCurrentDirectoryInExePath`.
Every lookup STM makes keeps its own rules but no longer consults the current directory,
and processes STM starts inherit the hardened `PATH`. Lookups those processes make later
are their own (on Windows a stdio server does not inherit the variable). An upstream
server's own configured `env.PATH` is used as given. A tool reachable only that way is no
longer found by STM. An empty or absent `PATH`, or one with no fully qualified entry left,
is replaced by the platform default without its current-directory entry (`/bin:/usr/bin`;
`C:\bin` on Windows).
Not changed: hook commands STM installs (`memtomem-stm …` or `uv run … memtomem-stm …`)
and MCP registrations written by older versions or by hand are looked up by the client
itself, in its own process. Current registrations use an absolute interpreter path.
Workarounds
Remove relative entries (`.`, empty segments, relative or root-relative directories) from
`PATH`. On Windows, define `NoDefaultCurrentDirectoryInExePath` in the environment the MCP
client and your shell start with.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
PyPImemtomem-stm |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/memtomem/memtomem-stm/security/advisories/GHSA-hqh4-75hx-xq46Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
