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

258
Views
Checkmarx scan issue for express js res.send() with array response data

I am using axios lib in express middleware for getting response from API's

router.post(someurl,req,res)
{

axios
.get(someurl)
.then((response=>{
**res.send(response.data);**//contains array object which would be send as a JSON response by send()
}

}

Checkmarx scan reports this as untrusted data and possibly reflected XSS attack since the response.data could be vulnerable. It says : The applications .then() embeds untrusted data in the generated output with send() and the data is embedded straight into the output without proper sanitization or encoding enabling an attacker to inject malicious code.

How to overcome this issue since the UI renders the array response to render list. or if we can encode the array object which can be rendered back as response?

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

0

JSON.stringify(response.data) worked for me.

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!