Closed SKdft closed 2 years ago
No better solution have been found except to prohibit users from uploading PDF files, can you give some help to me, thanks.
Adding the “Content-Disposition: Attachment” and “X-Content-Type-Options: nosniff” headers to the response of static files https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload
reference,we recommend the following:
location /{
if ($request_filename ~* ^.*?.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){
add_header Content-Disposition attachment;
}
}
https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload
--- It is recommended that this practice be performed for all of the files that users need to download in all the modules that deal with a file download.currently we do this.3.nginx detects the uploaded pdf and find the xss features such as 'app.alert(....)'.
Hope can help you!
A stored cross-site scripting (XSS) vulnerability exists in LightCMS that allows an user authorized to upload a malicious .pdf file which acts as a stored XSS payload. If this stored XSS payload is triggered by an administrator it will trigger a XSS attack.