fix(memory_engine): guard RAVEN_HOME in project skill roots
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 22/100
Direzione di ricerca
Start in raven/memory_engine/skill_forge/project_skills.py, where guarded and excluded are built in project_skill_roots and read_project_skills calls _is_guarded before build_skill_meta. Reproduce the leak with a test in tests/test_skill_forge_project_skills.py: a repo containing RAVEN_HOME, a SKILL.md symlinked to config.json, and an agent_home outside RAVEN_HOME. Done means the secret content no longer appears in SkillMeta. Linked PR #1390 is already open against this issue, so check it before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
project_skill_roots protects two trees from being read as project skills:
guarded = (home/.agents, agent_home)-- checked when a SKILL.md is readexcluded = {home, agent_home, *agent_home.parents}-- directories that may not become the git-root boundary
RAVEN_HOME (default ~/.raven, from raven.home.raven_home()) is not in guarded. It is covered only indirectly, as a parent of the default agent_home (RAVEN_HOME/workspace), through the unconditional *agent_home.parents set.
agents.defaults.workspace accepts any path and is not validated against RAVEN_HOME: Config.workspace_path uses an explicitly configured value as written. When that workspace points outside RAVEN_HOME, nothing keeps RAVEN_HOME out of the boundary search or out of the guarded check. A repository that contains RAVEN_HOME then becomes the git-root boundary, and a project skill whose SKILL.md symlinks to <RAVEN_HOME>/config.json is read as a project skill. That file holds provider API keys.
Reproduction
Layout:
repo/.git
repo/.raven/config.json <- RAVEN_HOME, holds provider keys
repo/src/ <- the turn's workdir
repo/src/.agents/skills/setup/SKILL.md -> repo/.raven/config.json
# agents.defaults.workspace (agent_home) configured outside the repo
repo/.raven/config.json held {"providers": {"openai": {"api_key": "sk-SECRET"}}} (a fake value).
Against the current main:
roots = project_skill_roots(src, agent_home=agent_home_outside, home=userhome)
# ProjectRoots(dirs=(.../repo/src/.agents/skills,), boundary=.../repo,
# guarded=(.../userhome/.agents, .../agent_home_outside))
metas = read_project_skills(roots)
# SkillMeta(name='setup', source='project',
# content='{"providers": {"openai": {"api_key": "sk-SECRET"}}}')
_format_skill_text(meta) returns the secret, so it reaches the BM25 index and every search or injection path built on it.
The same layout with the default agent_home (RAVEN_HOME/workspace) does not leak: repo is in excluded through agent_home.parents, git_root is dropped, boundary becomes src, and the symlinked SKILL.md resolves outside the boundary. The leak is triggered by the workspace setting, not by the skill layout.
A sibling layout leaks the same way: a checkout that contains the home, with the workdir outside it and agent_home outside RAVEN_HOME.
Why this is not #1354
#1354 stops a git root above the user's home from becoming the skill boundary. It does not address RAVEN_HOME.
guarded and excluded are identical on origin/main and on the branch checked here, and the leak reproduces with neither of #1354's changes applied. It is a pre-existing gap, not a regression from that PR.
Suggested fix
Add RAVEN_HOME directly to guarded:
- The payload is stopped at read time:
read_project_skillscalls_is_guarded(skill_file, roots.guarded)beforebuild_skill_meta, so a symlink that leaves the project cannot resolve to the config file. - With
RAVEN_HOMEguarded, the unconditional*agent_home_r.parentsexclusion can be relaxed: the conservative trade-off where a checkout that contains the agent home collects no repository skills is no longer needed to keepRAVEN_HOMEout. - This also closes the workspace-configured-outside-RAVEN_HOME surface.
Implementation notes:
ProjectSkills.__init__must receiveraven_home(); today it only carriesagent_home, androots()callsproject_skill_roots(workdir, agent_home=...)withhomedefaulting toNone.guardedis process-stable, so adding it to the cache key carries little semantic risk (_cache_keycurrently keys ondirsplusboundary).- Assembly points:
raven/agent/loop/wiring.py:1525andraven/context_engine/factory.py:292.
Files
raven/memory_engine/skill_forge/project_skills.py--guardedat:65,excludedat:66,ProjectSkillsat:295raven/agent/loop/wiring.py:1525andraven/context_engine/factory.py:292-- assembly points that needraven_home()passed intests/test_skill_forge_project_skills.py-- add a payload test for the workspace-outside-RAVEN_HOME layout
- Lingua principale
- Python
- Stelle
- 4.1k
- Fork
- 94
- Merge medio
- 2g 7h
- PR unite (30g)
- 216
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di EverMind-AI/Raven
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EverMind-AI/Raven#1413 ·
I maintainer di solito rispondono entro 1 giorno
-
feat: allow users to build ui-web and ui-tui with `bun`Forse di nuovo libera @0warning0error l’ha presa 8 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
EverMind-AI/Raven#1283 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
EverMind-AI/Raven#121 ·
I maintainer di solito rispondono entro 1 giorno
-
fix: Feishu channel status wrongly reports missing credentials and "not connected" while WebSocket is liveForse già presa @pcbeingused333 l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 18/100
EverMind-AI/Raven#1399 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WebUI tab froze silently while gateway stayed healthy (heartbeat stopped 1h49m); reproducible /auth refresh dead-end fixed in #1392Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
EverMind-AI/Raven#1393 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di EverMind-AI/Raven
Issue simili
-
`gitlab_importer_v2` pipeline failing due to malformed YAML fileForse già presa @Gowri213 l’ha presa oggi. Apertabug Pipeline: Failure Priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
aboutcode-org/vulnerablecode#2523 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
intuitem/ciso-assistant-community#5380 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
confluentinc/cp-ansible#2767 ·
I maintainer di solito rispondono entro 3 giorni
-
bug docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 2 giorni