Bug: Description fields are vulnerable to XSS
18 °C
Bug #23

Description fields are vulnerable to XSS

Status: Closed
Priority:
Critical
Added by:
scot
on April 30, '24
Assigned to:
Due date:
Reported for: 0.6.0

Steps to Reproduce

  1. Create an issue or project
  2. In the description field, insert the XSS of your choice
  3. Insert any other content into the description field
  4. See your inserted JS affect the page

Explanation

XSS In description boxes. This applies to both project descriptions and issue descriptions. I've been poking around a bit, and it seems like any field that supports markdown is vulnerable. Thankfully, other fields seem unaffected.

It doesn't seem like there's any sanitization at all.

This is a link to one of the issues I opened in a test project. A few XSS tests in that project, nothing malicious though:
https://app.betahub.io/projects/190/issues/4 (this one's stupid but fun)

Also, check your console ;)
<script>console.log("Hello There :)")</script>

Screenshots

None

Video Clips

None

Log Files

None

Device
Device Type: PC
Cpu model: Ryzen 9 7900X
Cpu brand: AMD
Gpu model: GeForce RTX 3060 Ti
Gpu brand: NVIDIA
Memory: 64 GB
Operating system: Windows 10
[ #1 ] 5 months ago by

Hi Scot,
Excellent find, thank you! Will take care of it ASAP.

[ #2 ] 5 months ago by

Hey Scot,

The issue has been fixed.

A little background:
Betahub runs on Rails. Normally, every string rendered with the ERB engine is automatically escaped, so usually no additional work is required there. However, when we use Markdown, we had to allow HTML tags in those strings, which led us to forget about escaping raw user input before sending it to the Markdown parser.

We've fixed it by inserting an escaping function right before the Markdown parser.

Thanks again for reporting it!

[ #3 ] 5 months ago by

No problem at all! I appreciate the additional context as well.
Glad it got sorted quickly!

You must be a member of this project to comment.