Skip to content

bug(yt-dlp): link parsed as an option can re-enable plugin execution #452

Open

Description

@Wenjix

Security review finding (medium, CWE-88).

downloadVideo in packages/yt-dlp/src/download.ts appends the URL as a bare positional argument with no -- separator, and the exported function trusts its caller to have run isVideoUrl. A value shaped like --plugin-dirs=<dir> is parsed by yt-dlp as an option: it re-enables the plugin search --no-plugin-dirs had just disabled, loading and running Python code from a caller-named directory. Other option-shaped values (--exec, --paths, --config) are injectable the same way.

Proposed fix: assert http/https inside downloadVideo and pass the link behind a -- end-of-options separator.

Fix: #444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions