event-catalog / eventcatalog

An open source documentation tool to bring discoverability to your event-driven architectures
https://eventcatalog.dev
MIT License
1.64k stars 135 forks source link

content security policy need to have unsafe-eval to render the generated event page from AWS event bridge #497

Closed wliew99 closed 1 month ago

wliew99 commented 4 months ago

Have you read the Contributing Guidelines on issues?

Description

Cannot render the generated events without granting unsafe-eval to the content security policy, which is very concerning as it opens up room for cross site scripting attack.

Steps to reproduce

content security policy on CloudFront distribution to serve s3 static files build from event catalog have default-src https: wss: 'self'; style-src https: 'unsafe-inline'

If i changed content security policy to default-src https: wss: 'unsafe-eval'; style-src https: 'unsafe-inline' then everything is fine.

When drilling down to our generated event details page (from plugin generation from EB), getting this on client side image

F12 console gave this image image

Expected behavior

the generated event page to be rendered with default-src https: wss: 'self'; style-src https: 'unsafe-inline'

Actual behavior

got client side exception as it's looking for unsafe-eval to be part of CSP

Your environment

boyney123 commented 1 month ago

Thanks for raising this issue.


EventCatalog v2 is coming out very soon, so going to close this as I believe it’s no longer an issue in the new version.


If you still experience this issue please raise a new issue.


Thank you!