Enabled plugins are trusted by NAME, so a session can swap the module behind one
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza por plugins/trust.py, plugins/loader.py y registry._construct; después, lee las referencias a config_digest en PR #495 y el contexto relacionado en #461. Un maintainer debe elegir entre rechazar los shadows originados en el proyecto y fijar el contenido de la implementación; se considera terminado cuando un nombre de plugin habilitado no puede hacer que se ejecuten bytes de módulo no confiables, con pruebas que cubran el modelo de confianza elegido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Split out of #461 point 4 / PR #495, where the config-integrity pin closes the config half of this but not the implementation half. Found by an automated reviewer on that PR and confirmed against the code.
The hole
trust.require_enabled gates in-process Python on the plugin name only:
def require_enabled(policy, name) -> None:
if not is_enabled(policy, name):
raise PluginUntrusted(...)
and plugins/loader.py discovery is an overlay whose highest precedence source is inside the agent-writable workspace:
builtin (bmad_loop.data/plugins/*) lowest
entry_point (inert today)
project (<project>/.bmad-loop/plugins/*) highest — same-name override
registry._construct then resolves Path(manifest.scripts_dir) / manifest.python.module and calls spec.loader.exec_module(module). For a project-origin manifest, scripts_dir is <project>/.bmad-loop/plugins/<name>/.
So given a project whose policy already has [plugins] enabled = ["tea"], a driven session can write .bmad-loop/plugins/tea/plugin.toml + its own module, and the next registry build imports and executes that module in the orchestrator process. The name never changed, so the allowlist is satisfied. The simpler variant needs no builtin to shadow: if enabled names a plugin that does not exist yet, the session just creates the directory.
Unlike the ungated-declarative-shell-hooks item (also out of scope on #495), this one is inside the trust tier that is supposed to be gated — plugins/trust.py's own docstring says a [python] plugin is "never imported or executed unless its name is in [plugins] enabled", and that is true of the name while saying nothing about the bytes.
Why PR #495 does not close it
#495's runsetup.config_digest hashes sorted(policy.plugins.enabled). That catches a session adding a name to the allowlist. It cannot catch a session changing what an already-allowlisted name resolves to, because no policy field moves. The gap is recorded in the config_digest docstring and the CHANGELOG entry so the pin is not read as stronger than it is.
Shape of a fix (undecided — needs a maintainer call)
Two directions, and this is a plugin-trust-model decision rather than a hashing one, which is why it is not folded into #495:
- Refuse the shadow. Reject a project-origin manifest whose name collides with a builtin, or refuse project-origin
[python]plugins entirely and require in-process plugins to be installed outside the workspace. Cheapest and closest to the relay fix in #461 points 1-3 (move the executable surface out of the agent-writable tree), but it is a behavior change for anyone developing a plugin in-tree. - Pin the implementation. Extend the trust record to a content digest of the manifest + the
[python]module, established when the operator enables the plugin. Preserves in-tree development but needs a place to store the pin and an--acceptpath when the operator legitimately edits their own plugin. Watch for false positives if a plugin writes into its own{scripts}dir.
Either way the auto-sweep gate then inherits the guarantee for free, since it already refuses on a moved config digest.
Notes
- Default
[plugins] enabledis empty, so a stock project is unaffected. The exposure is limited to projects that have deliberately enabled a[python]plugin. - This is not a regression: it predates #495, which narrows the surrounding surface without widening this one.
Related: #461, PR #495.
- Lenguaje dominante
- Python
- Estrellas
- 174
- Forks
- 72
- Merge medio
- 19 h 25 min
- PR fusionados (30 d)
- 84
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bmad-code-org/bmad-loop
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
bmad-code-org/bmad-loop#973 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bmad-code-org/bmad-loop#965 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
bmad-code-org/bmad-loop#1004 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 49/100
bmad-code-org/bmad-loop#1002 ·
Los mantenedores suelen responder en 1 día
-
tickets: an injected plan_halt result for a built plan escalates with stopped-attempt wordingAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 36/100
bmad-code-org/bmad-loop#972 ·
Los mantenedores suelen responder en 1 día
Todos los issues de bmad-code-org/bmad-loop
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Nixtla/mlforecast#823 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
madenvel/KalinkaPlayer#503 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
EleutherAI/lm-evaluation-harness#4508 ·
Los mantenedores suelen responder en 1 día