Back to skill

Security audit

Reddit Archive

Security checks for vulnerabilities and agentic risk

Overview

This Reddit archiver is mostly coherent, but it uses local browser login cookies by default for video downloads, which is sensitive enough to require review before installation.

Install only if you are comfortable with yt-dlp reading cookies from your logged-in browser session for downloads. Consider setting REDDIT_COOKIES_BROWSER=none unless you specifically need v.redd.it videos, and install pinned dependency versions in an isolated environment rather than using broad user-level pip installs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding

Unpinned Third-Party Dependencies Create a Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: scripts/requirements.txt:1-2
Related Location: SKILL.md:9-14
Vulnerability Type: Unconstrained third-party dependency installation
Risk Level: Medium

Vulnerable code:

text
requests
yt-dlp

The corresponding installation guidance in SKILL.md is:

markdown
This script automatically checks for and installs its dependencies on first run:

- **requests** — Python HTTP library
- **yt-dlp** — video downloader

If missing, it will attempt to install them via `pip install --user`. You can also:
- Pre-install: `pip3 install requests yt-dlp`

Technical Analysis

The dependency declarations and documented installation command do not constrain package versions or verify package hashes. Package resolution therefore retrieves whichever releases the configured Python package index currently considers suitable.

If a dependency release, package-index account, index mirror, or package-resolution environment is compromised, installation may introduce malicious code that was not present during this Skill audit. Python packages can execute code during installation and subsequently run with the privileges of the user invoking the Skill.

The documentation also states that the script automatically installs missing dependencies, while the reviewed script contains no such installation implementation. This inconsistency may cause users to rely on installation behavior that the package does not actually provide, although it does not itself create a code-execution path.

Attack Path

  1. An attacker compromises a future release, maintainer account, package-index mirror, or other distribution path for requests or yt-dlp.
  2. A user follows the documented command pip3 install requests yt-dlp, or installs from scripts/requirements.txt.
  3. Because no reviewed versions or hashes are enforced, the package manager accepts the compromised distribution. ...[truncated 861 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin both dependencies to versions that have been reviewed and tested:
    text
    requests==REVIEWED_VERSION
    yt-dlp==REVIEWED_VERSION
    
  2. Generate and enforce cryptographic hashes for every permitted distribution, using a locked requirements file and:
    bash
    python3 -m pip install --require-hashes -r requirements.lock
    
  3. Maintain the lock file through a controlled dependency-update process that includes vulnerability scanning, changelog review, and regression testing.
  4. Install dependencies in an isolated virtual environment rather than the user's global or user-level Python environment.
  5. Use a trusted package index and configure the installer to reject unexpected indexes or dependency sources.
  6. Correct SKILL.md so that it does not claim automatic installation unless that behavior is deliberately implemented. Prefer explicit, user-approved installation rather than runtime package installation.
  7. Keep browser-cookie access optional and clearly disclosed because a compromised yt-dlp dependency would inherit the ability to process cookie material when --cookies-from-browser is enabled.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (13)

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

p`

Browser Login Required for Reddit Videos

As of mid-2026, downloading v.redd.it videos requires an authenticated Reddit session — yt-dlp's Reddit extractor reads cookies from your browser to satisfy this. Stay logged into Reddit in Safari (or another browser, see below) and the script handles it automatically.

  • Default browser: safari (macOS default).
  • Override: export REDDIT_COOKIES_BROWSER=chrome (or firefox, brave, edge, vivaldi). Set to none to skip cookie loading if you don't need Reddit videos.
  • Image-only / redgifs-only archives don't need this — the cookie loader is harmless if you're not logged in (those URLs won't try to use Reddit credentials), but v.redd.it posts will fail with an Account authentication is required error.

When to Use

You want to archive content from Reddit — either from a specific user (u/username) or a subreddit (r/subname).

Usage

bash
python3 ~/path/to/reddit_archive.py [options]

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The code explicitly describes pulling cookies from a browser keychain via yt-dlp, which is credential/session access behavior. In the context of an archival downloader, this is more dangerous because the tool is not just consuming public content; it is reaching into local authenticated browser data to bypass access restrictions for media retrieval.

Content

Scanner excerpt · scripts/reddit_archive.py (reported line 337)May include surrounding context.

python
"""Builds the yt-dlp argv. v.redd.it URLs redirect to a Reddit
    comments page that requires logged-in cookies to load the video's
    DASH manifest — yt-dlp's --cookies-from-browser pulls them straight
    from a browser keychain. Default is safari (Mac default); override
    with REDDIT_COOKIES_BROWSER=chrome|firefox|brave|edge|vivaldi.
    Browsers without an existing Reddit login session won't help.
    Cookies are domain-scoped so we can safely pass them for all URLs

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
80% confidence
Finding

Although this is not an information stealer in the classic malware sense, the pattern matched for a valid reason: the script supports extracting cookies from installed browsers such as Chrome and Firefox. That capability touches sensitive local session stores and resembles credential-harvesting tradecraft enough to be security-relevant, especially without explicit opt-in and host scoping.

Content

Scanner excerpt · scripts/reddit_archive.py (reported line 338)May include surrounding context.

python
as e:
        print(f"Error downloading {url}: {e}")
    return False

def _ytdlp_command(url, path):
    """Builds the yt-dlp argv. v.redd.it URLs redirect to a Reddit
    comments page that requires logged-in cookies to load the video's
    DASH manifest — yt-dlp's --cookies-from-browser pulls them straight
    from a browser keychain. Default is safari (Mac default); override
    with REDDIT_COOKIES_BROWSER=chrome|firefox|brave|edge|vivaldi.
    Browsers without an existing Reddit login session won't help.
    Cookies are domain-scoped so we can safely pass them for all URLs
    — redgifs/gfycat etc. won't receive Reddit cookies."""
    ytdlp = os.environ.get("YTDLP_PATH", "yt-dlp")
    argv = [ytdlp, "-o", str(path), "--no-warnings"]
    browser = os.environ.get("REDDIT_COOKIES_BROWSER", "safari")
    if browser and browser.lower() != "none":
        argv += ["--cookies-from-browser", browser]
    argv.append(url)
    return argv

def download_with_ytdlp(url, path):
    """Down

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly states that it will use an authenticated Reddit browser session to download videos, but the warning is framed as an operational requirement rather than a clear privacy/security consent notice. Reading browser cookies is sensitive because it accesses authenticated session material from the user's local browser profile, and users may not realize the script is leveraging those credentials automatically.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script configures yt-dlp to pull cookies from a local browser profile, which accesses authenticated browser session data from the user's machine. Even if intended to make Reddit video downloads work, this crosses into credential/session access and can expose sensitive authenticated state without a prominent, explicit user consent flow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code silently accesses browser-derived cookies to enable downloads, but there is no upfront CLI warning or consent mechanism informing users that local authenticated browser sessions may be read. In a user-facing tool, undisclosed access to browser session material is dangerous because users may not understand that their logged-in state is being leveraged.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/reddit_archive.py (reported line 357)May include surrounding context.

python
which it is."""
    import subprocess
    try:
        subprocess.run(
            _ytdlp_command(url, path),
            capture_output=True, text=True, timeout=120, check=True
        )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The session header hard-codes Accept-Language to en-US,en;q=0.9, which imposes a specific language/locale preference. The file does not provide a user opt-in, configuration option, or documented regional justification for forcing English.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The implementation appends --cookies-from-browser for all yt-dlp invocations whenever the browser setting is enabled, while comments claim this is safe because of domain scoping. That assumption is weak in a security review: broad cookie extraction increases exposure of local browser credential material and widens the trust boundary unnecessarily for non-Reddit downloads.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The requirements file specifies requests without a version constraint, making builds non-reproducible and allowing future installs to resolve to different releases. This increases supply-chain risk and makes it impossible to verify whether a known-vulnerable or malicious upstream version could be installed in different environments.

Content

Scanner excerpt · scripts/requirements.txt (reported line 1)May include surrounding context.

text
requests
yt-dlp

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

requests has multiple published advisories, and because no version is pinned, the manifest does not establish whether the installed version is fixed or vulnerable. In practice this is a supply-chain hygiene issue rather than proof of a specific exploitable CVE, but it still leaves deployments exposed to vulnerable resolution outcomes.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The requirements file specifies yt-dlp without a version constraint, so installations may pull different versions over time. Because yt-dlp is a high-churn package that processes untrusted remote content and has a history of advisories, leaving it unpinned raises both security and reproducibility risks.

Content

Scanner excerpt · scripts/requirements.txt (reported line 2)May include surrounding context.

text
requests
yt-dlp

Unverifiable Dependency: yt-dlp has 16 known advisory(ies) (CVE-2023-46121 (yt-dlp Generic Extractor MITM Vulnerability via Arbitrary Proxy Injection); GHSA-3v33-3wmw-3785 (yt-dlp has dependency on potentially malicious third-party code in Douyu extract); CVE-2023-40581 ( yt-dlp on Windows vulnerable to `--exec` command injection when using `%q`) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

yt-dlp has numerous advisories and is unpinned, so the environment could install an affected version without any visibility or reproducibility guarantees. Given that yt-dlp commonly handles attacker-controlled media URLs and metadata, uncertainty about its exact version is more dangerous than for a passive library.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.