Skip to content

Security: Path Traversal in package_skill.py#68

Open
tuanaiseo wants to merge 1 commit into
ComposioHQ:masterfrom
tuanaiseo:contribai/fix/security/path-traversal-in-package-skill-py
Open

Security: Path Traversal in package_skill.py#68
tuanaiseo wants to merge 1 commit into
ComposioHQ:masterfrom
tuanaiseo:contribai/fix/security/path-traversal-in-package-skill-py

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The script creates a zip file from a skill folder using rglob and relative_to. If a malicious symlink exists outside the skill folder, it could be followed, allowing path traversal attacks (zip slip).

Severity: high
File: skill-creator/scripts/package_skill.py

Solution

Add validation to ensure all extracted paths are within the target directory. Use os.path.realpath() to resolve symlinks and verify the resolved path is within the skill_path.parent directory.

Changes

  • skill-creator/scripts/package_skill.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The script creates a zip file from a skill folder using rglob and relative_to. If a malicious symlink exists outside the skill folder, it could be followed, allowing path traversal attacks (zip slip).

Affected files: package_skill.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
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