As far as I understand, everything is already protected (without CSP and file restrictions in wwwroot\Images), but I have to attach (additionally) a hardened converter to upload images. Yes? Please give me a link to an example with a hardened converter for upload images (in C#)? Thanks!
How to protect Net.Core server from malicious content uploads by users?
Hi!
I have a website where on certain pages the user can (through checks in the controller method):
- To save (upload to server) text in text fields and to CKEditor.
- To save (upload to server) images (.jpg) to website through CKEditor and through system explorer.
- To add links to multimedia in CKEditor (YouTube, Vimeo, Twitter, Google Maps).
All image files are saved in wwwroot\Images in subfolders.
Can I somehow protect these pages from embedding malicious code, iframes, viruses, and so on?
For example, can I just somehow prevent any code from running in files in the wwwroot\Images folder?
I tried using CSP, but it's just kind of AWFUL - everything breaks and nothing works on these pages.
Who, in general, came up with this nightmare - CSP, this is some kind of mockery of common sense.
Does CKEditor protect itself from malicious content that is uploaded to the server using it?
Probably not, judging by this explanation (but this is again CSP that cannot be embedded - it creates a nuclear explosion on the pages of the site):
Content Security Policy
https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/csp.html
Why do websites and interactivity in browsers are created at all, if it's all impossible to somehow protect?
So that special services, hackers and others can hack anyone at any time and take everything they need?)))
Thanks!
Developer technologies | ASP.NET | ASP.NET Core
2 answers
Sort by: Most helpful
-
-
Volk Volk 551 Reputation points
2023-11-01T06:52:27.9833333+00:00 Many thanks to everyone! I figured out how to install ClamAV. The code works, the virus scan works. The question is closed. :)