#18407·opencti

fix(notifier): embedded markdown images are not resolved by octi.markdownToHtml in mail notifiers

Author: romain-filigranCreated Sep 21, 2026Updated Sep 29, 2026
Labelsbugnotifications

Description

When an image is uploaded inside a markdown field (e.g. a Report description), the platform stores the file in the embedded/ storage area and rewrites the markdown destination to a platform-relative, context-dependent URL:

markdown
![](embedded/markdown-image-b671c4f1.jpg)

(see opencti-platform/opencti-graphql/src/database/middlewareEmbeddedImages.ts:285, .../database/middleware.ts:3984)

The UI resolves that URL at render time by prefixing the current entity route, so the backend can infer the entity and serve the file (opencti-front/src/components/markdownDisplay/markdownDisplayHelpers.ts, resolveContextualEmbeddedImageUrl).

The notification helper octi.markdownToHtml() does no such resolution. It is a plain marked() call:

typescript
// opencti-platform/opencti-graphql/src/utils/NotificationTool.ts
markdownToHtml(markdownText?: string): string | undefined {
  if (!markdownText) return undefined;
  return marked(markdownText) as string;
}

So in the Platform mailer / Simplified mailer notifiers, a template such as:

ejs
<%- octi.markdownToHtml(notification_content[0].events[0].message) %>
<%- octi.markdownToHtml(data[0].instance.description) %>

produces:

xml
<img src="embedded/markdown-image-b671c4f1.jpg">

which is a relative URL with no host and no entity context. In a mail client it resolves to nothing, so every embedded image in the mail is broken.

Environment

  1. OS: any
  2. Version: 7.260921.0 (current master)

Reproducible steps

  1. Create a Report and paste/upload an image into its description markdown field. The stored markdown becomes ![](embedded/markdown-image-<hash>.jpg).
  2. Create a live trigger on that Report with a Platform mailer notifier whose HTML template renders the description, e.g. <%- octi.markdownToHtml(data[0].instance.description) %>.
  3. Trigger a notification (update the report).
  4. Open the received email.

Expected output

The image uploaded in the description is visible in the email body (or, at minimum, degrades to something actionable such as a link to the entity rather than a broken <img>).

Actual output

The email body contains <img src="embedded/markdown-image-<hash>.jpg">, rendered as a broken image placeholder by every mail client. Text and other markdown constructs are converted correctly; only embedded images are affected.

Source: OpenCTI-Platform/opencti