Back to skill

Security audit

ComPDF PDF to JSON

Security checks for vulnerabilities and agentic risk

Overview

The skill’s PDF-to-JSON purpose is clear, but it ships overly broad API instructions for unrelated destructive and security-changing PDF operations and asks to persist an API key in a local plaintext file.

Review before installing. Use it only for PDFs you are allowed to send to ComPDF, avoid highly sensitive documents unless your organization approves that service, and prefer a protected secret store or one-time key entry over the skill-local plaintext api_key file. Do not rely on this skill for unrelated PDF editing, decryption, watermark removal, account browsing, or AI extraction workflows despite those endpoints appearing in the bundled reference.

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
SKILL.md:31
Finding

Plaintext API Key Stored at a Predictable Local Path

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31-39
Vulnerability Type: Plaintext credential storage
Risk Level: Medium

Vulnerable Code

markdown
6. Resolve credentials only from `api_key` in the directory containing this `SKILL.md`. Read its first non-empty line. Do not inspect environment variables or any other local path. If the file is absent, unreadable, or empty, ask the user to provide an API key, then create or replace only this skill-local `api_key` file after the user confirms storage. Do not display, log, commit, or include the key in requests examples or final output.

## Credentials

Store only the current skill's API key in the sibling `api_key` file. This file is private runtime state and must be excluded from version control and skill publishing.

To obtain an API key, register or sign in at [ComPDF Portal](https://www.compdf.com/compdf-portal/signin?utm_source=clawhub&utm_medium=referral&utm_campaign=compdf_skills_repo_en&ref_platform_id=clawhub_compdfkit_skills_en). On first use, provide the key when requested and confirm storing it in the skill-local `api_key` file; later requests reuse that stored key.

Technical Analysis

The Skill directs the agent to persist the ComPDF API key as plaintext in a predictable file named api_key beside SKILL.md. Although it identifies the file as private runtime state and prohibits logging or committing the key, it does not require owner-only file permissions, atomic creation, permission verification, encryption at rest, or use of a protected credential store.

A process or local user able to read the Skill directory could retrieve the credential directly. The predictable location also increases the chance that backup, synchronization, packaging, or publication processes will collect it. The instruction to exclude the file from version control is procedural and is not backed by an enforced ignore rule in the audited project.

...[truncated 1058 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer an operating-system credential store, managed secret service, or platform-provided secret interface instead of a plaintext file.
  2. If file storage is unavoidable, create the file atomically with owner-only permissions, such as mode 0600, and reject files owned by another user or accessible by a group or other users.
  3. Avoid following symbolic links when creating or replacing the credential file, and verify that the resolved path remains inside the Skill directory.
  4. Add and distribute an enforced ignore rule for api_key, while also excluding it from packaging, backup, synchronization, and publication workflows.
  5. Never include the key in command-line arguments, logs, examples, generated reports, or exception messages.
  6. Provide key revocation and rotation guidance, and rotate the credential immediately if the file may have been exposed.
  7. Request explicit user consent before persistence and provide an option to use the key only for the current operation without storing it.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:29
Finding

Undocumented Routing Parameter Forced into Every API Request

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 29
Vulnerability Type: Undocumented request-field injection
Risk Level: Low

Vulnerable Code

markdown
4. Include `sourceType=5` in every final ComPDF API request. Treat it as an integration routing parameter and include it in request details when the user asks for them.

Technical Analysis

The Skill requires sourceType=5 to be inserted into every final ComPDF request. However, the audited PDF-to-JSON request-field definition in references/official-api-reference.md, lines 2282-2341, does not list sourceType as an accepted request parameter. In that reference, data.sourceType appears only as a response property.

This instruction also conflicts with SKILL.md line 28, which directs the agent to use exact documented request fields and not infer unsupported options. Because the parameter is described only as an “integration routing parameter,” its server-side semantics, accepted values, privacy implications, and effect on request handling cannot be verified from the supplied reference.

This is not evidence of arbitrary code execution or credential theft. The risk is that an opaque, unsupported attribution or routing value is systematically attached to requests without a documented API contract.

Attack Path

  1. A user asks the Skill to prepare a PDF-to-JSON request.
  2. The agent follows the mandatory instruction and adds sourceType=5.
  3. The request is submitted to ComPDF with an input that is absent from the documented PDF-to-JSON request schema.
  4. If the server recognizes the field, it may attribute, route, classify, or process the request according to undocumented logic; otherwise, it may reject or ignore the request.

The resulting behavior depends on ComPDF's server-side implementation and cannot be established further from the audited files.

Impact Assessment

Potential impact includes undisclosed request attribution ...[truncated 295 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove sourceType=5 unless it is part of the official, supported request schema.
  2. If the field is required, document its type, accepted values, purpose, server-side effects, and privacy or attribution implications in the API reference.
  3. Reconcile the instruction with the rule requiring exact documented fields.
  4. Validate generated request fields against an explicit allowlist for the selected endpoint.
  5. If the parameter performs referral attribution or nonessential routing, disclose that behavior and obtain user consent before adding it.
  6. Add tests ensuring that request plans do not contain fields absent from the applicable endpoint schema.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 28)May include surrounding context.

md
3. Read the matching heading in `references/official-api-reference.md`. Use its exact endpoint path, request fields, request mode, and response fields; do not i

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
6. Resolve credentials only from `api_key` in the directory containing this `SKILL.md`. Read its first non-empty line. Do not inspect environment variables or a

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The reference file massively exceeds the declared scope of a PDF-to-JSON skill by documenting nearly the entire ComPDF platform, including unrelated conversion, editing, security, and AI endpoints. In an agent setting, this over-broad tool context increases the chance the model will invoke unintended capabilities, including dangerous or privacy-sensitive operations, contrary to user intent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This section exposes destructive and security-altering operations such as page deletion, extraction, encryption, decryption, watermark removal, and related PDF modifications inside a skill advertised for PDF-to-JSON conversion. If the agent is given this context, prompt confusion or instruction-following errors could lead to unauthorized document alteration or decryption instead of passive extraction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document includes non-PDF-source conversions and document-creation capabilities unrelated to the stated PDF-to-JSON purpose. While less dangerous than decryption or deletion features, this still broadens the operational envelope and can cause the agent to upload, transform, or generate files in ways users did not request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file describes extensive upload and remote processing workflows but does not clearly warn that documents, passwords, metadata, and possibly extracted content are transmitted to an external ComPDF service. In a document-processing skill, that omission can cause users or downstream agents to handle sensitive files without informed consent or appropriate data-governance review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Task-list, asset-info, close-task, and webhook documentation exposes account metadata and operational controls not necessary for simple PDF-to-JSON conversion. In an agent context, this can leak task history, consume account information, or encourage unnecessary external callbacks that expand the data-sharing surface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The decryption section presents password removal as a normal operation without warning that it should only be used on files the operator is authorized to decrypt. In an agent workflow, that omission can normalize bypassing document protections and increase the risk of unauthorized access to protected content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Several parameter descriptions switch into Chinese-only text inside an otherwise English API reference, which can prevent English-language users from understanding important behavior. SQP-3 covers language/locale policy issues when a skill forces a specific language without offering choice or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This line presents a core page layout parameter description only in Chinese, despite the surrounding content being English. Users who do not read Chinese may be unable to understand configuration effects, which fits the natural-language locale policy concern in SQP-3.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The OCR language description is given in Chinese-only text in the middle of English documentation, which is a language accessibility inconsistency rather than a technical issue. SQP-3 applies because the file imposes a specific language for critical instructions without documented opt-in or regional justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

These lines describe extraction mode, schema, and options in Chinese while the rest of the page is largely English, making core functionality inaccessible to some users. This is a natural-language policy inconsistency under SQP-3 because the document does not offer language choice or justify the locale switch.

Content

No source excerpt is available for this finding.