I use an online photo editor on my web store. User can edit photo using svg-edit and save changes. User results are stored as SVG source code (...). I have to send that SVG source code through the PHP form, save it in database and show in the Administration Panel.
I'm afraid of any injections or attacks on my web store. Is there any possibility to make it secure?
I can't generate private hash for SVG source code, because it's client side and any request I can make is via AJAX.
@EDIT
Example: user saves ... code and that code is being sent through POST. In PHP script I can access $svg = $_POST['svg_source']; I am worring about injection in that POST value. Attacker may inject any HTML, JS, other, source code.
@EDIT:
And then in DB I can store that $_POST value ... and view it in PA. But the attacker can write some ... code and it will be executed in PA where I view SVG image (based on SVG code)
@EDIT:
I need some solution to check that SVG code is valid and don't contain any JS, HTML code. OR - I need some solution for secure viewing SVG code on a website.