Skip to content

Commit edb5d76

Browse files
tmbnvclaude
andcommitted
Document security implications of pipe: URL scheme
Added comprehensive documentation to the pipe_download function explaining the security implications of using the pipe: URL scheme. This clarifies that: - The feature intentionally executes shell commands - Commands run with the permissions of the Python process - Usage should be limited to trusted environments - Untrusted sources could lead to arbitrary code execution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0bbcf99 commit edb5d76

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/wids/wids_dl.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,20 @@ def __exit__(self, exc_type, exc_val, exc_tb):
3939

4040

4141
def pipe_download(remote, local):
42-
"""Perform a download for a pipe: url."""
42+
"""Perform a download for a pipe: url.
43+
44+
Security note: The pipe: URL scheme intentionally executes shell commands.
45+
This is a powerful feature that allows for custom data processing pipelines,
46+
but carries inherent security risks:
47+
48+
1. Commands are executed with shell=True, which interprets shell metacharacters
49+
2. No sandboxing or limitations are applied to the commands
50+
3. Commands have the same permissions as the Python process
51+
52+
This functionality should only be used in trusted environments where the URL
53+
sources are controlled and validated. Using pipe: URLs from untrusted sources
54+
could lead to arbitrary code execution.
55+
"""
4356
if not remote.startswith("pipe:"):
4457
raise ValueError(f"Invalid pipe URL: {remote}")
4558
cmd = remote[5:]

0 commit comments

Comments
 (0)