Opened 4 years ago

Closed 4 years ago

#16891 closed defect (fixed)

logging malformed hostnames in socks5 requests does not respect SafeLogging configuration

Reported by: andreasstieger Owned by:
Priority: Medium Milestone: Tor: 0.2.7.x-final
Component: Core Tor/Tor Version: Tor: 0.2.6.10
Severity: Keywords: PostFreeze027 TorCoreTeam201508 logging security
Cc: teor Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When a socks5 client application sends a request with a malformed hostname, the following is logged:

Your application (using socks5 to port 42) gave Tor a malformed hostname: [host.example.com]. Rejecting the connection.

It should say [scrubbed] as SafeLogging was not set to 0.

Bug is in src/or/buffers.c :: parse_socks(), where it uses escaped() on the request address rather than escaped_safe_str_client().

Patch attached.

Child Tickets

Attachments (1)

0001-Log-malformed-hostnames-in-socks5-request-respecting.patch (1.4 KB) - added by andreasstieger 4 years ago.
proposed patch

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by andreasstieger

proposed patch

comment:1 Changed 4 years ago by teor

Keywords: PostFreeze027 TorCoreTeam201508 logging security added
Milestone: Tor: 0.2.7.x-final
Status: newneeds_review

I have reviewed this patch and changes file.
It is a one-line clean patch that fixes the logging/security issue described.
Let's get it merged.

comment:2 Changed 4 years ago by teor

(Filed #16894 to attempt to fix this issue in general by performing a review of all logging code.)

comment:3 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged to master

Note: See TracTickets for help on using tickets.