Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename Restriction Bypass Leading To Persistent Cross-site Scripting Vulnerability #3617

Closed
passtheticket opened this issue Nov 30, 2023 · 1 comment

Comments

@passtheticket
Copy link

Describe the bug
A html file can be uploaded with .html.aaa or .htm.aaa file extensions. When the file is opened, it executes the Javascript code inside it. On the other hand, file uploading with the .html. and .htm. file extensions are enough to execute Javascript for Linux servers. The WinRemoveTailDots plugin prevents uploading these file extensions using rtrim function for Windows server.

To Reproduce

  1. Select arbitrary png file to upload.
  2. Capture request with Burp and set content as test<img/src/onerror=alert(document.cookie)>
  3. Set filename like test.html.aaa or test.htm.aaa
  4. After forwarding the request, the file is successfully uploaded under the files directory.

Screenshots
7
8

Tested on:

  • OS: Windows & XAMPP server
  • OS: Debian & Apache2
@nao-pon
Copy link
Member

nao-pon commented Dec 20, 2023

@passtheticket Thank you for your report. I think this problem is caused by the fact that MIME detection of multiple extensions is not supported. I will fix this.

nao-pon added a commit that referenced this issue Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants