Back to skill

Security audit

Parcel Package Tracking

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it uses a Parcel API key to list carriers, list deliveries, and add deliveries through Parcel's external API.

Install only if you intend to let the skill use your Parcel API key. Treat tracking numbers and package descriptions as private shipment data sent to Parcel's service, and avoid putting sensitive personal details in descriptions. Be careful with the add command because malformed arguments may still submit a bad delivery record.

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

Note
Location
parcel-api.js:152
Finding

Missing CLI Options Are Silently Replaced with the Command Name

Content
View full analysis

Vulnerability Details

File Location: parcel-api.js, lines 152–160
Vulnerability Type: Improper CLI argument validation
Risk Level: Low

Vulnerable Code

js
const tracking = args[args.indexOf('--tracking') + 1];
const carrier = args[args.indexOf('--carrier') + 1];
const description = args[args.indexOf('--description') + 1];
const notify = args.includes('--notify') ? 'true' : 'false';

if (!tracking || !carrier || !description) {
    console.error("Usage: parcel-api add --tracking <num> --carrier <code> --description <desc> [--notify]");
    process.exit(1);
}

Technical Analysis

The parser does not verify that each required option exists before reading the following array element. If args.indexOf() cannot find an option, it returns -1. Adding one results in index 0, which contains the command name, "add".

Consequently, an omitted --tracking, --carrier, or --description option may be assigned "add" instead of an absent value. Because "add" is truthy, the required-argument check does not reliably reject the malformed invocation. The resulting values are passed to addDelivery() and submitted to the authenticated Parcel API.

This is an input-validation and remote-data-integrity flaw. It does not provide command execution, privilege escalation, credential disclosure, or access beyond the privileges already associated with PARCEL_API_KEY.

Attack Path

  1. A user, automation process, or AI agent invokes the add command while omitting one or more required flags.
  2. For every omitted flag, indexOf() returns -1.
  3. The expression -1 + 1 selects args[0], whose value is "add".
  4. The truthiness validation accepts the substituted value.
  5. addDelivery() sends the malformed delivery record to https://api.parcel.app/external/add-delivery/ using the configured API key.
  6. If the remote API accepts the malformed fields, unintended data is added to the use ...[truncated 369 chars]
Remediation
View remediation

Remediation Suggestions

Replace the index arithmetic with parsing that explicitly verifies each option and its value. Prefer a maintained CLI parsing library, or implement a helper that rejects missing flags, missing values, duplicated options, and values that are themselves option tokens.

Validate all inputs before sending the request:

  • Require non-empty tracking, carrier, and description values.
  • Reject a required option when its next token is absent or starts with --.
  • Validate the carrier against the supported-carrier list.
  • Enforce reasonable length and character constraints for tracking numbers and descriptions.
  • Restrict list mode to the documented active and recent values.
  • Return a nonzero exit status without making an API request when validation fails.

Example hardened parsing:

js
function requiredOption(args, name) {
  const index = args.indexOf(name);
  if (
    index === -1 ||
    index + 1 >= args.length ||
    args[index + 1].startsWith('--')
  ) {
    throw new Error(`Missing required option: ${name}`);
  }
  return args[index + 1];
}

try {
  const tracking = requiredOption(args, '--tracking');
  const carrier = requiredOption(args, '--carrier');
  const description = requiredOption(args, '--description');
  const notify = args.includes('--notify');

  await addDelivery(tracking, carrier, description, notify);
} catch (err) {
  console.error(err.message);
  process.exit(1);
}

The addDelivery() function should then accept a Boolean directly and assign send_push_confirmation: notify.

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

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill requires access to the PARCEL_API_KEY environment variable but does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization transparency gap: the skill can depend on sensitive environment data without clearly constraining or documenting that access, increasing the risk of unintended secret exposure or overly broad execution privileges in hosts that enforce capability declarations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · parcel-api.js (reported line 6)May include surrounding context.

js
const { URL } = require('url');

const API_KEY = process.env.PARCEL_API_KEY;
const BASE_URL = "https://api.parcel.app/external";

if (!API_KEY) {
  console.error("Error: PARCEL_API_KEY environment variable is not set.");

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · parcel-api.js (reported line 108)May include surrounding context.

js
const { URL } = require('url');

const API_KEY = process.env.PARCEL_API_KEY;
const BASE_URL = "https://api.parcel.app/external";

if (!API_KEY) {
  console.error("Error: PARCEL_API_KEY environment variable is not set.");

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The add command transmits user-supplied tracking numbers, carrier identifiers, and descriptions to a third-party Parcel API with no user-facing disclosure or confirmation at the point of action. In an agent/skill context, this can cause users to unknowingly send potentially sensitive shipment metadata off-platform, creating a privacy and data-handling risk even though the destination is the intended service.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.