OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Provide a way to validate SVG files

Open infofromca opened this issue 1 year ago • 8 comments

Describe the bug

Orchard Core version

main

To Reproduce

Expected behavior

<PackageReference Include="Svg" Version="3.4.7" />

Logs and screenshots

infofromca avatar Apr 24 '25 13:04 infofromca

Can you rephrase your questions? Is your problem that SVG tags are not rendered correctly?

sebastienros avatar Apr 24 '25 17:04 sebastienros

No. Because Media module allows .SVG WHICH IS RISK FOR ATTACK

infofromca avatar Apr 24 '25 19:04 infofromca

So your issue is that when users allow svg files to be uploaded they could be a threat? I believe svg files are allowed by default based on this doc https://docs.orchardcore.net/en/latest/reference/modules/Media/#configuration

1- You can disable this extension, the same way .exe or .zip are not allowed by default 2- We could add a feature that would allow custom implementations to validate file when they are uploaded (independently of the extension) to add some validation (size, format, threats, ...)

sebastienros avatar Apr 24 '25 19:04 sebastienros

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

github-actions[bot] avatar Apr 24 '25 19:04 github-actions[bot]

For 2., that could be a new method in IMediaEventHandler.

Piedone avatar Apr 24 '25 19:04 Piedone

For 1, I had #17840

infofromca avatar Apr 24 '25 19:04 infofromca

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

github-actions[bot] avatar May 09 '25 20:05 github-actions[bot]

Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details.

github-actions[bot] avatar May 17 '25 00:05 github-actions[bot]