Skip to content

ObjectMapperWrapper logging sensitive data on deserialisation errors #601

@jlous

Description

@jlous

If ObjectMapperWrapper encounters a deserialisation error, it unconditionally dumps the entire json into the message of an IllegalArgumentException, which, if unexpected, will often make its way into the logs.

This is extremely ill-advised:
Json in the production database will often contain private or sensitive data that should not be accessible to everyone with access to the techincal logs.

Jackson does the same thing by default (although truncating the content a little), but it can at least be easily configured not to (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)
But this is of little help when the library using it logs it again by itself.

Logback-level pattern-based masking is not suitable for redacting large and arbitrary jsob clobs.

Please provide a config to omit json-content from these errors, to limit data-leakage via logs.
Or maybe even better: drop it entirely, and leave content-logging it to the root-cause message from jackson, which is more informative about what is wrong anyway, even with content-quoting turned off.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions