Skip to content

Security: Credentials in plugin source URLs exposed in logs, exceptions, and persisted state #2152

@jpshackelford

Description

@jpshackelford

Problem

When fetching plugins from private repositories using authenticated URLs (e.g., https://oauth2:<token>@gitlab.com/org/private-marketplace), credentials are exposed in multiple places:

  1. Application logs - Clone URLs and git commands are logged with credentials visible
  2. Exception messages - Error messages include full URLs with credentials
  3. Persisted conversation state - Plugin source URLs with credentials are stored in StoredConversation and ResolvedPluginSource

Business Impact

  • Credential leakage to log aggregators: Tokens sent to centralized logging systems (Datadog, Splunk, etc.) where they may be accessible to operations teams or retained indefinitely
  • Credential exposure in error responses: When plugin fetching fails, error messages containing credentials may be returned to API clients
  • Credential persistence: Tokens stored in conversation state could be accessed by other processes or leaked through database backups
  • Security audit failures: Logging credentials violates security best practices and compliance requirements

Expected Behavior

  • Log messages should redact credentials from URLs (e.g., https://****@gitlab.com/repo)
  • Exception messages should not contain authentication credentials
  • Persisted state should store redacted URLs (credentials only needed at fetch time)

Reproduction

from openhands.sdk.plugin.fetch import fetch_plugin

# This will log the full URL with credentials
fetch_plugin(
    source='https://oauth2:SECRET_TOKEN@gitlab.com/org/repo',
    ref='main'
)

Logs will show:

INFO - Cloning repository from https://oauth2:SECRET_TOKEN@gitlab.com/org/repo.git

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions