Skip to content

SIP: unconditional eprintln! debug spew logs Authorization header + caller PII on every INVITE #129

Description

@ryanmurf

Summary

handle_incoming_invite dumps all SIP headers of every inbound INVITE to stderr with eprintln!, unconditionally (not gated by any tracing/log level). That includes the Authorization header (digest username/realm/nonce/response — credential material) and From/To/Contact/P-Asserted-Identity (caller PII / routing).

Location

crates/asterisk-sip/src/event_handler.rs

  • event_handler.rs:351-355:
    eprintln!("[DEBUG] handle_incoming_invite: call_id={}, exten={}, caller={}",);
    eprintln!("[DEBUG] All headers:");
    for h in &request.headers {
        eprintln!("[DEBUG]   {}: {}", h.name, h.value);   // prints Authorization, From, Contact, …
    }
  • Plus auth-outcome prints at event_handler.rs:405 and :424, and ~a dozen more eprintln!("[DEBUG] …") through the file (BYE/hold/re-INVITE at 367, 913, 1681, 1689, 1698, 1733, …), and in notify_service.rs:158-212.

Impact

Credential-adjacent material and PII written to stderr/pod logs on the normal call path, at any verbosity, for anyone with log access. Low severity (digest response is not the plaintext password) but it violates the secret-handling discipline the M3 PIN work established, and log volume is a minor DoS in itself.

Recommended fix

Replace the eprintln! calls with tracing::debug!/trace! (so they honor the log filter), and for the header dump either drop it or redact Authorization/Proxy-Authorization/P-*-Identity values. The single eprintln! inside authenticator.rs::verify (auth-header presence) is already removed in PR #125; this issue covers the broader event_handler.rs/notify_service.rs sweep, which is outside that PR's auth-module scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions