I'm using rich:fileUpload in my application on linux when I try to upload any file containing html code in file name i.e "file<img src=xyz onerror=alert('TEST')>Name.png"
, it gives me javascript alert before uploading the file. I tried it on live demo and found the same issue there as well. How can I restrict/escape execution of html/script or XSS in file name on linux?
You can try it yourself by following steps on linux.
Create a file with name "file<img src=xyz onerror=alert('TEST')>Name.png"
Access rich:fileUpload demo on richfaces showcase using below url.
Upload file and you will see a javascript alert.
http://showcase.richfaces.org:8000/richfaces/component-sample.jsf?demo=fileUpload&skin=blueSky