Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Checkmarx says document.url is unsafe

We have a potential XSS warning on this code:

if (someCondition) {
    //location.reload();
    window.location = document.URL;
}

The message is:

The application's FunctionName embeds untrusted data in the generated output with location, at line 433 of Directory\CodeFile.js. This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output.

Is there any actual vulnerability here (and if yes, what should we use instead, knowing that location.reload() wasn't satisfying?), or should I simply flag this as Not Exploitable and move on?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

URL escape the document.URL before passing the value to window.location

if (someCondition) {
    location.href = encodeURIComponent(document.URL);
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!