Skip to content

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

Closed
@passtheticket

Description

@passtheticket

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions