Back to skill

Security audit

markdown-link-check

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Markdown link checker, but it can be driven by scanned Markdown to probe internal network URLs and arbitrary local path existence without clear containment.

Review before installing, especially if you may scan untrusted Markdown. Use it only in a network-restricted environment or on trusted documents unless it is updated to block internal URL targets and constrain local link checks to the intended project root.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check_links.py:39
Finding

Unrestricted Remote URL Requests Enable Server-Side Request Forgery

Content
View full analysis
tuple[str, bool, str]: """Check if a remote URL is reachable.""" try: req = urllib.request.Request(url, method='HEAD', headers={ 'User-Agent': 'Mozilla/5.0 (compatible; LinkChecker/1.0)' }) urllib.request.urlopen(req, timeout=timeout) return url, True, 'OK' ``` The request is reached through URLs extracted directly from Markdown: ```python for url, line_num in extract_links(content, base_dir): if url.startswith(('http://', 'https://')): results.append((url, line_num, *check_remote_url(url, timeout))) ``` ### Technical Analysis The script sends HTTP requests to URLs extracted from potentially untrusted Markdown without validating the destination hostname, resolved IP address, port, or redirect target. Checking only that the string begins with `http://` or `https://` does not prevent requests to: - Loopback services such as `127.0.0.1` or `[::1]` - RFC 1918 private network addresses - Link-local addresses and cloud metadata services - Internal hostnames resolved by the local DNS environment - Public URLs that redirect to internal destinations - Services listening on unusual or sensitive ports `urllib.request.urlopen` follows supported HTTP redirects by default. Consequently, validating only the initial URL scheme would remain insufficient even if limited validation were added before constructing the request. The request uses `HEAD`, which may reduce response-body exposure but does not eliminate SSRF. A `HEAD` request can still reach internal services, reveal network accessibility through status or timing behavior, and trigger endpoint behavior on servers that do not implement method handling safely. ### Attack Path ...[truncated 1523 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check_links.py:59
Finding

Unrestricted Local Paths Enable Arbitrary Filesystem Existence Probing

Content
View full analysis
tuple[str, bool, str]: """Check if a local file link exists relative to base_dir.""" # Strip anchor and query clean_url = url.split('#')[0].split('?')[0] if not clean_url: return url, True, 'OK (anchor)' target = Path(base_dir) / clean_url if target.exists(): return url, True, 'OK' return url, False, f'File not found: {clean_url}' ``` The function is invoked for every extracted URL not beginning with an HTTP scheme: ```python else: results.append((url, line_num, *check_local_link(url, base_dir))) ``` ### Technical Analysis The script treats non-HTTP links as local paths and passes them to `Path.exists()` without constraining the resolved target to the Markdown file's directory or an approved scan root. A path containing `../` components can escape the document directory. In addition, when `clean_url` is absolute, Python path composition permits it to refer directly to an arbitrary filesystem location rather than a location beneath `base_dir`. The script does not read or modify the target file. Nevertheless, the different existence result is an information-disclosure primitive. Untrusted Markdown can probe whether selected files, directories, sockets, devices, or other filesystem objects exist in the environment running the Skill. ### Attack Path 1. An attacker supplies or modifies a Markdown file that will be checked by the Skill. 2. The attacker adds links targeting paths outside the Markdown directory, for example: ```markdown [Probe SSH key](../../.ssh/id_rsa) [Probe system file](/etc/passwd) ``` 3. The user scans the attacker-controlled file or its parent directory. 4. `check_local_link` ...[truncated 1005 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code substantially matches the declared purpose of checking markdown files for broken links, including local and remote targets. However, the description says it verifies all hyperlinks, both local files and remote URLs, while the implementation explicitly excludes markdown image links and skips anchor-only links. For local links containing anchors, it only checks whether the referenced file exists and does not verify that the anchor target exists within the document. Additionally, remote checking uses HEAD requests only, which is a narrower form of validation than general URL resolution. So the skill is mostly aligned, but the description overstates coverage enough to count as a mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.