Back to skill

Security audit

HackerNews Extract

Security checks for vulnerabilities and agentic risk

Overview

This Hacker News extractor is mostly transparent, but it needs Review because it can be steered to fetch arbitrary web addresses, including potentially internal/private ones, and save or send the results.

Install only if you are comfortable with a scraper that makes outbound requests to Hacker News and linked article sites. Avoid running it on untrusted JSON inputs or in environments that can reach sensitive internal services unless network egress is sandboxed. Consider pinning dependencies and reviewing verbose output behavior before use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
hn-extract.py:145
Finding

Unrestricted Server-Side URL Fetching Through Attacker-Controlled Article Metadata

Content
View full analysis
'HackerNewsExtractor': assert path.is_file(), f"json file not found: {path}" assert path.suffix == ".json", f"input file must be json: {path}" json_str = path.read_text() data = json.loads(json_str) return cls(data) ``` ```python def get_html_form_url(self, url: str): return fetch_url(url) ``` ```python def extract(self) -> str: """Extract text from the origin.""" assert self.data, "data must be populated before extract" id = self.data.get("id", "") self.id = id self.hn_id = id hn_url = f"https://news.ycombinator.com/item?id={id}" title = self.data.get("title", "") author = self.data.get("author", "") created_at = self.data.get("created_at", "") points = self.data.get("points", "") # story_id = int(self.data.get("story_id", 0)) article_url = self.data.get("url", "") children = self.data.get("children", []) self.add_line('---') self.add_line(f"title: {title}") self.add_line(f"author: {author}") self.add_line(f"created_at: {created_at}") self.add_line(f"url: {article_url}") self.add_line(f"points: {points}") self.add_line(f"hn_url: {hn_url}", width=0) self.add_line(f"comments: {len(children)}") self.add_line('---', sep="\n") self.add_paragraph(f"# {title}") self.article_html = self.get_html_form_url(article_url) ``` ### Technical Analysis The extractor accepts a local JSON file and uses its `url` property as the destination of an outbound request. The destination is passed directly to `trafilatura.fetch_url()` without validating: - The URL scheme - The destination hostname - The resolved IP address - Whether the destination belongs to a loopback, private ...[truncated 2276 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
hn-extract.py:2
Finding

Automatically Resolved and Unpinned Third-Party Dependencies

Content
View full analysis
=3.10" # dependencies = [ # "requests>=2.32.5", # "trafilatura>=2.0.0", # "urllib3>=2.6.3", # ] # /// ``` The documented execution workflow automatically resolves these dependencies: ```markdown ## Install No install beyond having `uv`. Dependencies will be installed automatically by `uv` into to a dedicated venv when run this script. ## Usage Workflow (Mandatory for Agents) When an agent is asked to extract a HackerNews post: 1. **Run the script** with an output path: `uv run --script ${baseDir}/hn-extract.py -o /tmp/hn-.md`. ``` ### Technical Analysis The inline dependency declarations use minimum-version constraints rather than exact, reviewed versions. No lock file, package hashes, or trusted package-index configuration is present in the audited project. Under the mandatory documented workflow, `uv run --script` can resolve and install dependency versions that were not part of the reviewed artifact. Consequently, the effective code executed by the skill may change over time even when `hn-extract.py` remains unchanged. Python packages execute code when imported and may also execute build-system code during installation where source distributions are involved. A compromised future release, compromised package-index account, malicious dependency introduced transitively, or unsafe index configuration could therefore execute code with the privileges of the user running the skill. This finding does not establish that the currently named packages are malicious. The risk arises from automatically trusting future or otherwise unreviewed compatible versions without cryptographic integrity constraints. ### Attack Path 1. A future compatible release of a direct or ...[truncated 1273 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes a script that performs network access and writes output files, but the manifest does not declare any explicit tool scope or allowed-tools boundaries. In an agent environment, this weakens least-privilege controls and can let the skill be executed with broader capabilities than users or orchestrators expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill description explains what it does but does not clearly warn that running it fetches external content from both Hacker News and arbitrary linked article URLs. This can surprise users or agents by causing unanticipated outbound requests to third-party sites, with privacy, compliance, or network-policy implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code writes extracted content to a user-specified path and, in verbose mode, additionally writes JSON, HTML, and TXT sidecar files. Although the CLI exposes an output flag, there is no confirmation prompt or explicit user-facing warning in code that enabling output or verbose mode will create multiple files containing fetched content and comments.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.