Forge Security Violation While Rendering Image from base64 string

Hello,
I need to get the attachment content and provide a preview of it to the user. I fetched the content using the following function:

resolver.define('downloadThumbnail', async (req) => {
    const apiResponse = await api
        .asUser()
        .requestJira(route`/rest/api/3/attachment/thumbnail/10011`, {
            headers: {
                'Accept': 'application/json'
            }
        });
    const bufferResponse = await apiResponse.arrayBuffer();
    const base64 = Buffer.from(bufferResponse).toString('base64')
    return `data:image/png;base64,${base64}`
});

When I get the result of this function and paste it to a regular html page, I can see the content. However in the app, it gives the following error:


How can I fix this?
Kind regards,
Odin