Opened 18 years ago
Closed 18 years ago
#5024 closed defect (fixed)
MySQL backend exposes sql username and password on connection errors
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | high | Milestone: | 0.10.4 |
Component: | general | Version: | |
Severity: | critical | Keywords: | review |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
We recently had a hiccup with our mysql service in which python lost the connection. When this happened, the MySQL backend raised an exception showing the trace of calls that caused the exception. In this trace, the username and password for the sql database were exposed in plain text. i.e.
global MySQLConnection = <class 'trac.db.mysql_backend.MySQLConnection'>, path = u'/trac', user = u'trac', password = u'********', host = u'db.trac.sharpe-shell.org', port = None, params = {}
The error message received follows:
OperationalError: (2013, 'Lost connection to MySQL server during query')
This is a serious security issue. It seems as though some exception handling needs to be added in the SQL backend.
Attachments (1)
Change History (5)
comment:1 by , 18 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 0.10.4 |
Owner: | changed from | to
Priority: | normal → high |
follow-up: 3 comment:2 by , 18 years ago
Keywords: | review added |
---|
by , 18 years ago
Attachment: | conceal_passwd-r5130.diff added |
---|
Conceal the password string so that dumping it in backtraces will not show its sensitive content.
comment:3 by , 18 years ago
Replying to cboos:
Anyway, here's a possible solution for concealing database passwords, in general, attachment:conceal_passwd-r5130.diff. Please review.
First of all in the TracError you've left the "%s" in the string despite removing the parameter.
Secondly I think it'd be sufficient to simply return '' since revealing the length of the password also provides some information towards cracking it.
comment:4 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
What was the exact backtrace?
Were you using
mod_python
with thePythonDebug
directive set toOn
, by any chance? If so, consider turning it off, see the mod_python docs.Anyway, here's a possible solution for concealing database passwords, in general, attachment:conceal_passwd-r5130.diff. Please review.