-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grommunio-{spam,ham}-run.sh: Insecure way of passing password to mysql(1) #2
Comments
Hey,
Yeah, i remember that issue and wanted to do that but it just didn't happen yet 🙈
I asked the support about it and they told me it would only exist in the (private afaik) OBS where the builds are happening..
thats just from my internal work repo i keep separate from/to i merge changes manually.
No access as said before to my knowledge and yeah it has the same flaws.
I will send in an report to grommunio. |
Please check out bd52b78 if i didn't miss anything. |
yep, the latest one 🙈 |
Thanks for the clarification, I'll have a look to it in the next days. |
Thanks for looking over it and yeah i will send it in. |
fyi, 6345741 [client]
user=${MYSQL_USERNAME}
-password=${MYSQL_PASSWORD}
+password='${MYSQL_PASSWORD}'
host=${MYSQL_HOST}
database=${MYSQL_DBNAME}
CONFFILE needed if you use e.g. which isn't a problem with the grommunio-setup defaults
still waiting for them to implement at least the |
As of writing
grommunio-spam-run.sh
andgrommunio-ham-run.sh
parse/etc/gromox/mysql_adaptor.cfg
and construct arguments tomysql
– including the password (aside of this the current implementation might break with passwords containing spaces, semicolons or other characters interpreted by the bash).https://mariadb.com/kb/en/mysql-command-line-client/ (more or less a web version of the
man
page) says:The MySQL 8.0 Reference Manual goes into the details with § 6.1.2.1 End-User Guidelines for Password Security regarding
-p
:While I expect a system running grommunio to be sealed system (= not to be used by regular shell users), this can not be expected in general, nor does it seem to be required by the documentation. This insecure way of passing a password to
mysql
might be treated as security flaw, e.g. CWE-214: Invocation of Process Using Visible Sensitive Information. Note that I don't treat this as overly critical, because of the before mentioned behavior of MySQL clients.My recommendation is to parse
/etc/gromox/mysql_adaptor.cfg
and to write a temporary configuration file (often known as.my.cnf
) that could be passed using--defaults-file=<path to temporary configuration file>
tomysql
. Of course that temporary configuration file needs proper permissions and should be deleted after usage.Interestingly, grommunio-index had the same issue, being fixed with grommunio/grommunio-index@4ebe9ad, thus a similar solution should also fit for
grommunio-spam-run.sh
andgrommunio-ham-run.sh
. By the way, I did not find any upstream forgrommunio-spam-run.sh
, even 629ab04 mentions one, however/usr/sbin/grommunio-spam-run.sh
shipped by "grommunio-antispam" (RPM) package looks very similar. Is it possible that not all source code of the "grommunio-antispam" (RPM) package is currently publicly accessible (but still affected by the same weakness)?The text was updated successfully, but these errors were encountered: