Skip to content

[New Advisory] Hardcoded API Key, OAuth Credentials, and Defeated PKCE in mytoyota (PyPI) #7309

@AidanDalyAus

Description

@AidanDalyAus

Package

Summary

mytoyota ships with hardcoded API credentials and a completely non-functional PKCE implementation.

Findings

1. Hardcoded x-api-key (CWE-798)

controller.py line 237: "x-api-key": "tTZipv6liF74PwMfk9Ed68AQ0bISswwf3iHQdqcF" — sent in every request to Toyota Connected Services. Shared by all installations.

2. Hardcoded Basic Auth (CWE-798)

controller.py lines 138/165: "authorization": "basic b25lYXBwOm9uZWFwcA==" which decodes to oneapp:oneapp.

3. PKCE Defeated (CWE-346)

const.py: code_challenge=plain&code_challenge_method=plain
controller.py: "code_verifier": "plain"

The PKCE code verifier is a hardcoded literal string "plain", completely defeating RFC 7636. An attacker who intercepts the authorization code can exchange it because the verifier is a known constant.

4. Token cache without file permissions (CWE-256)

Tokens cached to ~/.cache/toyota_credentials_cache_contains_secrets in plaintext JSON with default umask (typically 0644, world-readable).

5. Real JWT tokens in test fixtures

tests/integration_tests/data/cached_token.json contains real-looking JWT tokens.

Impact

Anyone reading the public source code gets the API key and OAuth credentials to impersonate the Toyota OneApp against Toyota Connected Services (vehicle location, telemetry, trip history, remote commands). The defeated PKCE means intercepted authorization codes are trivially exchangeable.

Affected Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions