T08 · Insecure Dependencies
- Location
scripts/web_to_md.py:23- Finding
Unpinned and Externally Managed Executable Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2,SKILL.md:119-131,scripts/web_to_md.py:23-32,scripts/web_to_md.py:62-84
Vulnerability Type: Third-party supply-chain exposure through unpinned packages and execution of a mutable external script
Risk Level: MediumVulnerable Code
requirements.txt:1-2:text requests python-dotenvscripts/web_to_md.py:23-32:python SKILLS_DIR = os.path.expanduser("~/.aily/workspace/skills") TWEET_FETCHER = os.path.join(SKILLS_DIR, "x-tweet-fetcher/scripts/fetch_tweet.py") TWEET_TO_MD = os.path.join(SKILLS_DIR, "web-to-feishu/scripts/tweet_to_md.py") def _run(cmd, check=True): result = subprocess.run(cmd, capture_output=True, text=True, check=check) return result.stdout.strip()scripts/web_to_md.py:62-84:python def _convert_twitter(url: str, output_path: str = None, replies: bool = False) -> str: fetch_cmd = [sys.executable, TWEET_FETCHER, "--url", url, "--pretty"] if replies: fetch_cmd.append("--replies") try: json_str = _run(fetch_cmd) except subprocess.CalledProcessError as e: print(f"Failed to fetch tweet: {e.stderr}", file=sys.stderr) sys.exit(1) with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False) as tmp: tmp.write(json_str) tmp_json = tmp.name convert_cmd = [sys.executable, TWEET_TO_MD, "--input", tmp_json] if output_path: convert_cmd.extend(["--output", output_path]) try: result = _run(convert_cmd)Technical Analysis
The Python dependencies are declared without exact versions or integrity hashes. Package resolution can therefore select different releases over time, including a compromised future release.
More significantly, Twitter conversion executes
fetch_tweet.pyfrom a mutable workspace directory outside the reviewed Skill package. T ...[truncated 1687 chars]- Remediation
View remediation
Remediation Suggestions
- Pin every Python dependency to an exact, reviewed version.
- Use a lockfile or hash-checked requirements file, such as
pip install --require-hashes. - Add the actual runtime conversion dependency to the dependency manifest rather than relying only on installation prose.
- Identify the canonical
x-tweet-fetcherrepository explicitly and pin it to a reviewed commit. - Verify the external script using a cryptographic checksum or signature before execution.
- Prefer vendoring the reviewed converter inside this Skill so the audited package contains the complete executable implementation.
- If external execution remains necessary, run it in a restricted subprocess without unrelated cloud credentials and with limited filesystem and network access.
- Document a controlled dependency-update and security-review process.
