Skip to content

Hotfix: some html is not being removed from MM notifications

Example notification:

{
        "target": "79590044-5d5c-4c05-a69e-b9d017d5e975",
        "summary": "test",
        "priority": "IMPORTANT",
        "body": "<html><style>should be removed</style><p>Test</p></html>"
}

Both mattermost consumer and email text template (probably push as well) are using a regex to strip some tags. This logic is faulty because it's not stripping the context of the style tag.

We need to make sure we strip style and script tags entirely, removing the content inside.

Edited by Carina Antunes