Skip to content

Security: traylinx/traylinx-auth-client-py

Security

SECURITY.md

Security Policy

Supported Versions

We actively support the following versions of TraylinxAuthClient with security updates:

Version Supported
1.0.x ✅
< 1.0 ❌

Security Features

TraylinxAuthClient implements several security measures to protect your authentication credentials and communications:

Input Validation

  • Comprehensive Parameter Validation: All configuration parameters are validated using Pydantic to prevent injection attacks
  • URL Sanitization: API URLs are validated and sanitized to prevent malicious redirects
  • UUID Format Validation: Agent User IDs must be valid UUIDs to prevent format-based attacks

Credential Protection

  • No Credential Logging: Tokens, secrets, and passwords are never logged or exposed in error messages
  • Secure Memory Handling: Sensitive data is handled securely in memory and cleaned up appropriately
  • Error Message Sanitization: Error messages are sanitized to prevent accidental credential exposure

Network Security

  • HTTPS Enforcement: All communications use HTTPS with proper certificate validation
  • Timeout Protection: Configurable timeouts prevent hanging connections and resource exhaustion
  • Rate Limit Handling: Built-in rate limiting protection with exponential backoff

Token Security

  • Automatic Token Refresh: Tokens are automatically refreshed before expiration
  • Thread-Safe Token Management: Token access is protected with proper locking mechanisms
  • Secure Token Storage: Tokens are stored securely in memory with appropriate cleanup

Reporting a Vulnerability

We take security vulnerabilities seriously. If you discover a security vulnerability in TraylinxAuthClient, please report it responsibly.

How to Report

DO NOT create a public GitHub issue for security vulnerabilities.

Instead, please report security vulnerabilities through one of these channels:

  1. Email: Send details to security@traylinx.com
  2. GitHub Security Advisory: Use GitHub's private vulnerability reporting feature
  3. Direct Contact: Contact the maintainers directly through secure channels

What to Include

When reporting a vulnerability, please include:

  • Description: Clear description of the vulnerability
  • Impact: Potential impact and attack scenarios
  • Reproduction: Step-by-step instructions to reproduce the issue
  • Environment: Python version, library version, and operating system
  • Proof of Concept: Code or commands that demonstrate the vulnerability (if applicable)
  • Suggested Fix: If you have ideas for fixing the issue

Example Report Template

Subject: [SECURITY] Vulnerability in TraylinxAuthClient v1.0.x

Description:
[Clear description of the vulnerability]

Impact:
[What could an attacker do with this vulnerability?]

Steps to Reproduce:
1. [First step]
2. [Second step]
3. [Additional steps...]

Environment:
- TraylinxAuthClient version: 1.0.x
- Python version: 3.x.x
- Operating System: [OS and version]

Proof of Concept:
[Code or commands that demonstrate the issue]

Suggested Fix:
[Your ideas for fixing the vulnerability]

Response Process

Timeline

We aim to respond to security reports according to the following timeline:

  • Initial Response: Within 24 hours of receiving the report
  • Vulnerability Assessment: Within 72 hours of initial response
  • Fix Development: Depends on complexity, typically 1-2 weeks
  • Security Release: Within 1 week of fix completion
  • Public Disclosure: 30 days after fix release (coordinated disclosure)

Our Commitment

When you report a vulnerability, we commit to:

  1. Acknowledge Receipt: Confirm we received your report within 24 hours
  2. Regular Updates: Provide status updates at least weekly during investigation
  3. Credit: Acknowledge your contribution in the security advisory (if desired)
  4. Coordinated Disclosure: Work with you on appropriate disclosure timing
  5. Fix Priority: Treat security issues as high priority

Severity Classification

We classify vulnerabilities using the following severity levels:

Critical (CVSS 9.0-10.0)

  • Remote code execution
  • Authentication bypass
  • Credential theft
  • Response Time: Immediate (within hours)

High (CVSS 7.0-8.9)

  • Privilege escalation
  • Information disclosure of sensitive data
  • Denial of service attacks
  • Response Time: Within 24 hours

Medium (CVSS 4.0-6.9)

  • Limited information disclosure
  • Input validation issues
  • Configuration vulnerabilities
  • Response Time: Within 72 hours

Low (CVSS 0.1-3.9)

  • Minor information leaks
  • Non-exploitable issues
  • Response Time: Within 1 week

Security Best Practices

For Users

When using TraylinxAuthClient, follow these security best practices:

Credential Management

# ✅ Good: Use environment variables
import os
client = TraylinxAuthClient(
    client_id=os.getenv('TRAYLINX_CLIENT_ID'),
    client_secret=os.getenv('TRAYLINX_CLIENT_SECRET'),
    api_base_url=os.getenv('TRAYLINX_API_BASE_URL'),
    agent_user_id=os.getenv('TRAYLINX_AGENT_USER_ID')
)

# ❌ Bad: Hard-coded credentials
client = TraylinxAuthClient(
    client_id="hardcoded_id",
    client_secret="hardcoded_secret",  # Never do this!
    # ...
)

Secure Configuration

# ✅ Good: Secure configuration
client = TraylinxAuthClient(
    # ... credentials from environment
    timeout=30,  # Reasonable timeout
    max_retries=3,  # Limited retries
    log_level="INFO"  # Don't use DEBUG in production
)

# ❌ Bad: Insecure configuration
client = TraylinxAuthClient(
    # ... credentials
    timeout=300,  # Too long, resource exhaustion risk
    max_retries=100,  # Too many, potential DoS
    log_level="DEBUG"  # May expose sensitive data
)

Error Handling

# ✅ Good: Secure error handling
try:
    result = client.authenticate()
except TraylinxAuthError as e:
    logger.error(f"Authentication failed: {e.error_code}")
    # Don't log the full exception (may contain sensitive data)

# ❌ Bad: Insecure error handling
try:
    result = client.authenticate()
except Exception as e:
    logger.error(f"Error: {str(e)}")  # May expose credentials
    print(f"Full error: {repr(e)}")   # Never print full errors

For Developers

Secure Development

  • Always validate input parameters
  • Never log sensitive data (tokens, secrets, passwords)
  • Use secure defaults for all configuration options
  • Implement proper error handling without information leakage
  • Follow the principle of least privilege

Testing Security

  • Include security test cases in your test suite
  • Test with invalid and malicious inputs
  • Verify that sensitive data is not logged or exposed
  • Test timeout and rate limiting behavior
  • Use static analysis tools to detect security issues

Security Updates

Notification

Security updates are announced through:

  • GitHub Security Advisories
  • Release notes in CHANGELOG.md
  • PyPI release notifications
  • Email notifications to registered users (if applicable)

Applying Updates

Always update to the latest version promptly when security updates are released:

# Update to latest version
pip install --upgrade traylinx-auth-client

# Or with Poetry
poetry update traylinx-auth-client

Vulnerability Disclosure Policy

Coordinated Disclosure

We follow responsible disclosure practices:

  1. Private Reporting: Vulnerabilities are reported privately first
  2. Investigation Period: We investigate and develop fixes privately
  3. Coordinated Release: Security fixes are released with advance notice
  4. Public Disclosure: Details are disclosed after fixes are available

Hall of Fame

We maintain a security hall of fame to recognize researchers who help improve our security:

  • [Researcher Name] - [Vulnerability Type] - [Date]
  • [Add your name by reporting a valid security issue!]

Contact Information

Security Team

  • Email: security@traylinx.com
  • PGP Key: [Link to public key if available]
  • Response Hours: Monday-Friday, 9 AM - 5 PM UTC

Maintainers

Additional Resources


Thank you for helping keep TraylinxAuthClient secure!

There aren't any published security advisories