Skip to main content

EasyPost API Token

The EasyPost API Token is a credential used to authenticate requests to the EasyPost API, a service that provides shipping and logistics solutions. This token allows applications to interact with EasyPost's services, such as creating shipments, tracking packages, and managing carrier accounts. Exposure of this token is a significant security concern because it can grant unauthorized access to sensitive shipping data and operations, potentially leading to financial and operational impacts.


How Does It Look

EasyPost API Tokens can appear in various contexts, such as:

  • Environment variables:

    export EASYPOST_API_KEY="EZTK-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  • Configuration files (JSON, YAML, .env):

    {
    "easypost_api_key": "EZTK-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
    easypost_api_key: EZTK-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Code snippets:

    easypost.api_key = "EZTK-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  • Connection strings (if applicable): Not typically used in connection strings.


Severity

  • 🟠 High

This severity level is due to the potential for unauthorized access to shipping operations and sensitive data. The API token can allow an attacker to perform actions such as creating or modifying shipments, accessing customer data, and potentially incurring financial charges. The blast radius includes any systems or applications that rely on EasyPost for logistics operations.


What Can an Attacker Do?

With immediate access to an EasyPost API Token, an attacker can perform a variety of actions:

An attacker can immediately interact with the EasyPost API, potentially causing disruptions or unauthorized activities.

Key actions an attacker can perform:

  • Create or modify shipments (if the token has write permissions), leading to unauthorized shipping activities.
  • Access customer data (if the account has access to sensitive information), potentially leading to data breaches.
  • Incur financial charges (if the account is linked to billing), by creating shipments or modifying existing ones.
  • Disrupt logistics operations (if the attacker modifies or cancels shipments).

Additionally, an attacker could use the token to explore further vulnerabilities within the connected systems, potentially leading to lateral movement or escalation of privileges.


Real-World Impact

Exposure of an EasyPost API Token poses significant business risks, primarily affecting logistics and customer trust.

Potential consequences include:

  • Data Exposure: Customer shipping details and personal information (if the token has read access to sensitive data).
  • Financial Loss: Unauthorized shipments or modifications leading to unexpected charges (if billing/resource creation is permitted).
  • Operational Disruption: Delays or cancellations in shipping operations (if the attacker has delete/modify permissions).
  • Reputational Damage: Loss of customer trust and brand integrity due to mishandled shipments or data breaches.

In the worst-case scenario, prolonged exposure could lead to cascading effects, such as widespread operational disruptions and significant financial losses.


Prerequisites for Exploitation

To exploit an EasyPost API Token, an attacker needs:

  • Network access: Ability to send requests to the EasyPost API.
  • Additional context: Knowledge of specific endpoints or account details to target.
  • Rate limits: Awareness of any rate limiting that might restrict the volume of API calls.

How to Verify If It's Active

To verify if an EasyPost API Token is active, use the following command:

curl -X GET "https://api.easypost.com/v2/addresses" -u "[TOKEN]:"

Valid credential response: A successful response will return a list of addresses or a confirmation message indicating access.

Invalid/expired credential response: An error message indicating authentication failure or invalid credentials.


Detection Patterns

Common Variable Names:

  • EASYPOST_API_KEY
  • easypost_api_key
  • EASYPOST_KEY
  • EP_API_KEY
  • EP_KEY
  • EASYPOST_TOKEN

File Locations:

  • .env
  • config.json
  • settings.yaml
  • credentials.py
  • application.properties

Regex Pattern:

EZTK-[a-zA-Z0-9]{32}

Remediation Steps

  1. Revoke immediately - Go to EasyPost Dashboard > API Keys and delete the compromised token.
  2. Audit access logs - Review EasyPost API logs for unauthorized requests or activities during the exposure window.
  3. Assess blast radius - Identify all systems, applications, and environments that used the exposed credential.
  4. Rotate credential - Generate a new API token in the EasyPost Dashboard with least-privilege permissions.
  5. Update dependent systems - Deploy the new credential to all applications and update CI/CD pipelines securely.
  6. Harden access controls - Enable IP allowlisting in EasyPost and require secure connections.
  7. Implement secrets management - Migrate credentials to a secrets manager (HashiCorp Vault, AWS Secrets Manager) to prevent hardcoding.
  8. Add detection controls - Set up pre-commit hooks and repository scanning to catch credential leaks before they reach production.

Credential exposures often go undetected for extended periods, increasing the window for exploitation. As a long-term strategy, plan to establish an internal process or engage an external vendor for continuous external exposure monitoring. This helps identify leaked secrets across public repositories, paste sites, dark web forums, and other external sources before attackers can leverage them. Proactive detection and rapid response are essential to minimizing the impact of credential leaks.


References