StaleStateException message should not contain SQL parameters

Description

When a StaleStateException is raised, SQL parameters are always added to the exception message. As a result, sensible data may leak in the logs, without any option to turn it off (apart from hiding the exceptions, which does not sound like a good option)

Also see:

Environment

None

Activity

Show:
Sanne Grinovero
July 9, 2020, 12:49 PM

Thanks yes then I agree, we shouldn’t log the parameters. Looks like this was introduced as .

I don’t think this should be based on the show_sql property though, that’s meant for a different aspect and it would be confusing to have it interact with this aspect.

I actually think we should never log parameters in the stacktrace of a StaleStateExceptionso we could keep it simple and avoid any configuration property?

Mickaël TRICOT
July 9, 2020, 1:15 PM

I agree. Having the parameters logged somehow could be helpful but they probably should not be there by default. I’ll rework this issue.

Sanne Grinovero
July 20, 2020, 9:36 PM

I’ve created a PR:

Mickaël TRICOT
July 21, 2020, 3:35 PM

Thanks a lot Sanne, that is really useful to my company (dealing with health care data)

Sanne Grinovero
July 21, 2020, 3:40 PM

Thanks to you for reporting it

Assignee

Sanne Grinovero

Reporter

Mickaël TRICOT

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure