Skip to content

duplicate - to close - #84

Closed
carfeii wants to merge 1 commit into
strands-agents:mainfrom
carfeii:fix/external-sop-name-path-traversal
Closed

carfeii wants to merge 1 commit into
strands-agents:mainfrom
carfeii:fix/external-sop-name-path-traversal

Conversation

@carfeii

@carfeii carfeii commented Oct 12, 2026 •

Copy link
Copy Markdown

duplicate - to close

A SOP file named "...sop.md" in an external SOP directory derives
sop_name == "..", since Path("...sop.md").stem is "...sop" and
".removesuffix(".sop")" strips down to "..". skills.py's
_create_skill_file then joins that name directly onto the output
directory (output_path / skill_name) before writing SKILL.md,
escaping the intended output directory by one level with
attacker-controlled content.

Reject any name that isn't a plain, single path component at the
point it's derived, so every consumer (skills.py, cursor.py, mcp.py)
is protected, and add a regression test.
@carfeii carfeii changed the title fix: reject path-traversal SOP names in load_external_sops duplicate - to close Oct 13, 2026
@carfeii carfeii closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant