Skip to content

It is too easy to accidentally log message contents in rageshakes #26380

Open
@richvdh

Description

@richvdh

There have been numerous occasions over the years where we accidentally include message contents in rageshakes, most recently #26376.

A common failure mode is to write something like:

let event = getEventFromSomewhere();
// ...
logger.info("Processing event", e);

What happens then is that we call JSON.stringify (https://github.com/matrix-org/matrix-react-sdk/blob/v3.82.0/src/rageshake/rageshake.ts#L94) which in turn calls MatrixEvent.toJSON, which includes the message content.

I assert that we should either:

  • change the existing consumers of MatrixEvent.toJSON to use some other method, then update toJSON to elide message content
  • special-case MatrixEvent in rageshake.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Developer-ExperienceO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MajorSeverely degrades major functionality or product features, with no satisfactory workaroundT-TaskTasks for the team like planning

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions