Skip to content
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

(dev/core#178) Redis - Report error messages #12303

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

totten
Copy link
Member

@totten totten commented Jun 12, 2018

Overview

If the Redis server returns an error message (e.g. due to malformed requests or credentials), the substance of this message is invisible to the site administrator.

See also: https://lab.civicrm.org/dev/core/issues/178

Before

The reported error is opaque -- specifying that some $key was unavailable, but not reporting why it was unavailable.

After

The reported includes the reason provided by Redis.

@civibot
Copy link

civibot bot commented Jun 12, 2018

(Standard links)

@colemanw
Copy link
Member

Is there any possibility of sensitive information being contained in that message? If so we should check permissions "view debug output" before appending that info.

@totten
Copy link
Member Author

totten commented Jun 14, 2018

I suspect the error messages are safe, but it's hard to know because it's an open-set. Adding the permission check sounds smart from a policy perspective...

But I'm not so sure about bootstrap mechanics -- the thing is that caches are used very early during the bootstrap process, and permission-checks feel like something that requires more services... feels likely to create strange-loop. (Witness: CRM_Core_Permission::check() fires hooks. If the cache is failing, then we may not be able to display the error about the cache failing because we can't check permissions because we can't fire hooks because we can't access the extension-mapping cache.) I'll push up a revision which tries to take a more conservative tact.

Relatedly, I think the call to the CRM_Core_Error::fatal() has been misusing the second parameter in a way that might leak inappropriate data. I'm updating to fix that too.

@colemanw colemanw merged commit b782c36 into civicrm:master Jun 14, 2018
@colemanw
Copy link
Member

This looks good now.

@totten totten deleted the master-redis-errmsg branch June 14, 2018 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants