Back to skill

Security audit

Pypi Package Changelog Generator

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but it needs review because it can process unbounded PyPI source archives and includes a plaintext GitHub token configuration example.

Install only if you are comfortable with the skill making outbound requests to PyPI and GitHub and processing source archives from the packages you ask about. Prefer no GitHub token, or a short-lived read-only token via environment/apiKey injection; avoid direct plaintext token values in config. Run it with normal agent time, memory, and temporary-storage limits, especially for untrusted or unusually large PyPI packages.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/pypi_package_changelog_generator/archive_diff.py:88
Finding
Unbounded Source Archive Processing Enables Resource Exhaustion<![CDATA[ ## Vulnerability Details **File Location**: `src/pypi_package_changelog_generator/_http.py:83-90`, `src/pypi_package_changelog_generator/pypi_client.py:39-54`, `src/pypi_package_changelog_generator/archive_diff.py:88-105`, and `src/pypi_package_changelog_generator/archive_diff.py:156-166` **Vulnerability Type**: Unbounded download, archive extraction, and in-memory file processing **Risk Level**: Medium ### Vulnerable Code `src/pypi_package_changelog_generator/_http.py:83-90`: ```python with self._opener.open(urllib_request, timeout=self._timeout) as response: return HttpResponse( status_code=response.status, headers=_normalize_headers(response.headers.items()), content=response.read(), url=response.geturl(), ) ``` `src/pypi_package_changelog_generator/pypi_client.py:39-54`: ```python def download_bytes(self, url: str) -> bytes: try: response = self._client.get(url) except HttpTransportError as exc: raise PypiClientError( code="pypi_download_failed", message=f"Failed to download source archive from {url}.", retryable=True, ) from exc if response.status_code >= 400: raise PypiClientError( code="pypi_download_failed", message=f"Failed to download source archive from {url}.", retryable=True, ) return response.content ``` `src/pypi_package_changelog_generator/archive_diff.py:88-105`: ```python def extract_archive(content: bytes) -> ExtractedArchive: temp_dir = tempfile.TemporaryDirectory(prefix="pypi-changelog-") root = Path(temp_dir.name) root_resolved = root.resolve() try: with tarfile.open(fileobj=BytesIO(content), mode="r:gz") as archive: members = archive.getmembers() for member in members: if not _is_safe_tar_member(root_resolved, member): raise ArchiveDiffError( code="uns ...[truncated 3639 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Stream downloads with a strict maximum size** - Read responses in bounded chunks instead of using unrestricted `response.read()`. - Abort once a configurable maximum compressed size is exceeded. - Validate `Content-Length` when present, while still enforcing the streaming limit because the header may be absent or inaccurate. 2. **Restrict archive sources** - Validate source distribution URLs against expected PyPI file-hosting domains and require HTTPS. - Revalidate the destination after every redirect. - Reject unexpected schemes, embedded credentials, and unapproved hosts. 3. **Enforce extraction limits before writing files** - Cap the number of archive members. - Cap each member's declared and actual extracted size. - Cap aggregate expanded size. - Reject archives with excessive compression ratios. - Continue rejecting traversal paths, links, devices, FIFOs, and other special entries. 4. **Bound recursive analysis** - Stop traversal after a maximum file count or aggregate byte count. - Skip files exceeding a per-file analysis limit. - Read large files incrementally for hashing instead of retaining all content. - Retain file content only for files selected for detailed diff generation. 5. **Apply budgets before expensive diff construction** - Identify and prioritize candidate files using metadata and bounded hashes first. - Generate patches only for the limited final file set. - Cap line count and input bytes passed to `difflib`. 6. **Add operational safeguards** - Configure execution timeouts, memory limits, and temporary-storage quotas. - Return a structured warning when an archive exceeds a limit. - Add tests covering oversized responses, excessive members, large files, and high-ratio compressed archives. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Providing only version parsing/normalization/comparison instead of full package version-change auditing is a significant underdelivery relative to the declared purpose. In security terms, this is risky because it combines false assurances with potentially unnecessary access to network, files, shell, and environment variables.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill declares capabilities that imply shell, network, file read, and environment-variable access, but it does not define any explicit tool scope such as allowed-tools or permissions. This increases the blast radius if the skill implementation or prompt routing is abused, because the runtime may grant broader access than the task strictly requires.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation explicitly shows storing a GitHub token directly inside a configuration file, but does not warn that this creates a plaintext secret at rest. Such files are commonly copied, backed up, committed by mistake, or exposed through local compromise, which can lead to token theft and unauthorized access to GitHub resources.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The client’s URL resolution logic allows any absolute http(s) URL to bypass the configured base_url, so callers expecting a PyPI-scoped client can be induced to send requests to arbitrary external hosts. In a package-analysis skill, this expands the trust boundary and can enable SSRF-style outbound requests, metadata probing, or accidental leakage of request headers to attacker-controlled endpoints if untrusted input reaches the path parameter.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
return None
    if ld is None or "musl" not in ld:
        return None
    proc = subprocess.run([ld], check=False, stderr=subprocess.PIPE, text=True)
    return _parse_musl_version(proc.stderr)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

compile() call detected

Medium
Category
Dangerous Code Execution
Content
python_expression = " ".join(python_tokens)
    try:
        compile(python_expression, "", "eval")
    except SyntaxError:
        message = f"Invalid license expression: {raw_license_expression!r}"
        raise InvalidLicenseExpression(message) from None
Confidence
65% confidence
Finding
compile() creates code objects from strings. When combined with exec()/eval(), it enables obfuscated code execution.

Static analysis

No suspicious patterns detected.