fix(security): add code-level guard against modifying bundled/hub skills via skill_manage#19379
fix(security): add code-level guard against modifying bundled/hub skills via skill_manage#19379memosr wants to merge 1 commit into
Conversation
…lls via skill_manage
|
I've observed the curator editing bundled skills even without a malicious prompt being present. The next |
|
I opened #20560 as a tested version of this boundary fix. Key differences from this PR:
Verification on #20560: PR: #20560 |
|
Thanks - Bro Your approach using the existing The underlying issue (also confirmed by @DanMaly above — curator |
What does this PR do?
tools/skill_manager_tool.pyonly enforces a_pinned_guardbeforemutating skills. Bundled and hub-installed skills have no code-level
write guard — the curator's prompt says "DO NOT touch bundled or
hub-installed skills" but that is an LLM instruction, not an enforced
boundary.
The vulnerability — prompt injection pivot to persistent code modification
_find_skill(name)resolves by name and returns bundled andhub-installed skills. There is no
is_bundled_guardanalogous to_pinned_guard._security_scan_skillis also off by default(
guard_agent_createddefaults toFalse).Attack scenario
poisoned
SKILL.md:hermes curator run)skill_viewprompt
skill_manage(action='patch', name='deploy', ...)—no code guard fires
Without code-level enforcement, the bundled/hub distinction is
security-relevant but only enforced by prompt text that a sufficiently
crafted injection can override.
Fix
Added
_bundled_hub_guard()mirroring_pinned_guard():Called before
_pinned_guard()in all 5 mutation actions:_edit_skill_patch_skill_delete_skill_write_file_remove_fileThis is consistent with the existing
_pinned_guardpattern butextends the guarantee to bundled and hub skills.
Type of Change
Checklist
_pinned_guardpattern