Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.0 fails to convert mermaid SVGs properly #90

Open
aloisklink opened this issue Aug 20, 2022 · 0 comments
Open

v0.6.0 fails to convert mermaid SVGs properly #90

aloisklink opened this issue Aug 20, 2022 · 0 comments

Comments

@aloisklink
Copy link

Version 0.6.0 of convert-svg introduced a fix for CVE-2021-23631. Unfortunately, this fix also breaks some mermaid SVGs.

I don't expect this to be fixed (I'm guessing the mermaid SVGs have some insecure content), but maybe it's worth adding a CLI option like --unsafe-rendering that prints a warning like: WARNING: Unsafe SVG rendering. Do not use on untrusted SVGs.

Example input SVG:

flowchart1

After running: npx convert-svg-to-png@0.5.0 flowchart1.svg

flowchart1

After running npx convert-svg-to-png@0.6.0 flowchart1.svg (or v0.6.4)

flowchart1

Interestingly, if I right-click the above SVG and press "Open Image in new Tab", I get the same black boxes and an error:

Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'none'". Either the 'unsafe-inline' keyword, a hash ('sha256-/C0W1MmEdSZ8Qc3zqXhUQUNNeN8XEY/0XTJGaU0Iwws='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant