Skip to content
XSS Disclosed report Intermediate

Potential stored Cross-Site Scripting vulnerability in Support Backend

Skill names shown on internal hacker profiles in the Support Backend were inserted into HTML without sanitisation, so a crafted skill name could run JavaScript in an employee's browser. The author notes that in production inline JavaScript is blocked, which greatly reduces how exploitable this is.

jobert Follow

Originally disclosed on HackerOne

Medium 5.9 View original
  • Triaged in under an hour
  • Fixed in 10 days
  • Disclosed after 10 days

HackerOne maintains an internal Support Backend system for employees. On the internal user profiles for hackers, a small overview is shown that lists the skills the user tagged their penetration tester profile with. Although the skills are currently managed by HackerOne and a user can only pick skills from a list, an XSS payload can be injected in the skill name to execute JavaScript in the backend system. In case we would allow penetration testers to enter their own skills in a free-form text format, it could lead to a stored Cross-Site Scripting vulnerability that is exploited by people outside of HackerOne.

Proof of concept

To reproduce, make sure your local environment is set up correctly by running the following code:

Ruby
Skill.create! name: '<script>alert(/XSS/);</script>'
User.find_by!(username: 'hacker').update! h1_pentester: true

Next, authenticate as the hacker user and enable the pentester-profile feature. Go to http://localhost:8080/settings/pentests and create a penetration tester profile with the skill that was created earlier. When the profile is created successfully, sign in to the Support Backend at http://localhost:8080/support and navigate to http://localhost:8080/support/users/hacker. The XSS payload injected in the skill name will be executed.

████

Root cause

The following code leads to two Cross-Site Scripting vulnerabilities:

lib/support/app/controllers/support/tables/columns/pentester_profile_skills.rb

Ruby
def render(record)
  return unless record.pentester_profile.present?

  skill_names = record.pentester_profile.skills.map(&:name)
  content = "<span
    data-toggle='tooltip'
    data-placement='top'
    style='cursor: pointer; font-weight: bold'
    title='#{skill_names.join("\n")}'>
      #{skill_names.join(', ')}
    </span>"
  content.html_safe
end

Due to the lack of sanitization of the skill name, an attacker can append additional HTML attributes and elements, including elements and attributes that execute JavaScript. The code title='#{skill_names.join("\n")}'> can be exploited using skill name 'onclick='alert(/XSS/);. The code #{skill_names.join(', ')} can be exploited using <script>alert(/XSS/);</script>.

Impact

An attacker could use this in the future to execute arbitrary JavaScript in the Support Backend. Please note that in the production environment, inline execution of JavaScript is not allowed, significantly reducing the exploitability of these vulnerabilities.

The original report as published on HackerOne, by jobert. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the skill name was concatenated into an HTML string and marked as safe HTML without escaping or sanitising it.

Impact

An attacker could in future run arbitrary JavaScript in the Support Backend, but in production inline JavaScript is not allowed, significantly reducing exploitability.

What the attacker needed

Skills currently managed by HackerOne; attacker controls a skill name; support staff view the profile

The fix

Skill names should be escaped or sanitised before being placed in the page rather than marked as safe HTML.

How it was found

  1. Create a skill whose name contains a script payload in the local environment.
  2. Mark a user as a pentester and enable the pentester-profile feature.
  3. Sign in as that user and create a pentester profile using the crafted skill.
  4. Sign in to the Support Backend and open that user's page, where the payload runs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Cross-site scripting (XSS) is when a site puts text from a user into a page without cleaning it, so the browser treats it as code and runs it. Here the skill name was pasted straight into a page shown to support staff, so a name containing code would run in their browser. In production a security setting blocked that inline code, so the real risk was limited.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by jobert

View all

67 more disclosed reports, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.