T09 · Insecure Skill Coding Practices
- Location
scripts/scrape_pinterest.py:163- Finding
TLS Certificate Verification Disabled for Image Downloads
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real Pinterest scraper, but it needs review because it disables HTTPS safety checks and can upload local image files to Telegram with weak scoping and credential handling.
Review this skill before installing. Use it only with a dedicated empty output folder, avoid Telegram mode for private or sensitive images, do not pass long-lived bot tokens in shell history, and do not rely on the documented verify=False workaround unless you accept the interception risk.
scripts/scrape_pinterest.py:163TLS Certificate Verification Disabled for Image Downloads
scripts/scrape_pinterest.py:212Telegram Bot Token Exposed Through Command-Line Arguments and Exception Logging
scripts/scrape_pinterest.py:195Telegram-Only Mode Can Upload Unrelated JPEG Files from the Output Directory
SKILL.md:7Third-Party Python and Browser Dependencies Are Not Version-Pinned
Referenced artifact was not completely inspected
['python3', 'scrape_pinterest.py', '-u', 'URL', '-s', '50', '-q', 'originals'],
File contents flow to a network sink. This may indicate data exfiltration of sensitive files.
media = [{"type": "photo", "media": f"attach://{f}"} for f in batch]
file_data = {f: open(f"{self.output_folder}/{f}", 'rb') for f in batch}
try:
r = requests.post(f"https://api.telegram.org/bot{self.token}/sendMediaGroup",
data={"chat_id": self.chat_id, "media": json.dumps(media)},
files=file_data, timeout=60)
if r.status_code == 200:
The skill promotes optional Telegram delivery of scraped images but does not clearly warn that images and related metadata will be transmitted to a third-party service. This can expose private, copyrighted, or sensitive content to Telegram infrastructure and to anyone with access to the specified bot or chat.
The phrase 'This skill triggers when user wants to download images from Pinterest' is broad and does not define specific invocation phrases, scope limits, or exclusion conditions. Without narrower trigger wording or negative examples, the skill could be invoked for a wide range of ordinary Pinterest-related requests beyond the intended scraper workflow.
Recommending use of requests with verify=False disables TLS certificate validation, making HTTPS connections vulnerable to man-in-the-middle interception and tampering. In this skill's context, that could expose downloaded content, session-related traffic, or Telegram/API communications to spoofing or malicious modification on untrusted networks.
### Problem: SSL certificate errors (Mac)
- **Cause:** macOS SSL issues
- **Fix:** Use `verify=False` in requests calls
### Problem: Duplicate images
The notes section repeats guidance to use verify=False, normalizing an insecure default and increasing the likelihood that users will adopt it broadly. Disabling certificate verification removes core HTTPS authenticity guarantees and can enable interception, content substitution, and credential exposure.
## Notes
- Pinterest loads dynamically - scrolling required for more images
- Use `verify=False` for requests (Mac SSL issues)
- State saved to `.scrape_state.json` for resume
- Telegram limited to 100 images per batch
- Verbose mode writes detailed logs to `scrape.log`
TLS certificate verification is explicitly disabled for image downloads with verify=False, which permits man-in-the-middle interception or content tampering by any network attacker controlling the connection path. Because the script then writes the received bytes directly to disk, users may unknowingly store attacker-modified content while believing it came from the intended host.
Using verify=False establishes an unsafe default by disabling a core transport security control for every image download. In this scraper context, which fetches many remote resources automatically, the weakened default materially increases exposure to interception, spoofing, and corrupted downloads at scale.
logger.debug(f"Skipped (already downloaded): {img_url[:50]}...")
continue
filename = img_url.split("/")[-1][:60]
r = requests.get(img_url, timeout=15, verify=False)
if r.status_code == 200:
filepath = f"{self.output_folder}/{i:04d}_{self.quality}_{filename}"
with open(filepath, "wb") as f:
With no manifest available, the only stated purpose comes from the module docstring, which describes a Pinterest scraper. The send_to_telegram feature adds a separate outbound data-transfer capability that is not required to scrape or download Pinterest images and therefore is unjustified by the stated purpose in the code documentation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
media = [{"type": "photo", "media": f"attach://{f}"} for f in batch]
file_data = {f: open(f"{self.output_folder}/{f}", 'rb') for f in batch}
try:
r = requests.post(f"https://api.telegram.org/bot{self.token}/sendMediaGroup",
data={"chat_id": self.chat_id, "media": json.dumps(media)},
files=file_data, timeout=60)
if r.status_code == 200:
When Telegram mode is enabled, the script posts downloaded image files and chat metadata to the Telegram Bot API. The code has operational logging, but it does not provide a clear user-facing warning in help text, comments, or docstrings that local files will be sent to an external service.
The document describes output folders, logging, and resume support, but it does not explicitly warn that running the skill will create local files such as downloaded images, scrape.log, and .scrape_state.json. For markdown guidance, behaviors that affect user data or system state should be disclosed clearly rather than implied only through examples and feature lists.
No suspicious patterns detected.