0

I am getting the following error in my Nodejs running app:

URIError: Failed to decode param '/cgi-bin/.%%%%32%%65/.%%%%32%%65/.%%%%32%%65/.%%%%32%%65/.%%%%32%%65/bin/sh'

What could be the cause and how to solve it ?

I searched for this error on web but did not found any results on how to solve the problem

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
Keloo Kel
  • 11
  • 2

1 Answers1

1

Thank you @devpolo , using the following lines of code, solved my problem:

app.use(function(req, res, next) {
var err = null;
try {
    decodeURIComponent(req.path)
}
catch(e) {
    err = e;
}
if (err){
    console.log(err, req.url);
    return res.redirect('/404');    
}
next(); });
Keloo Kel
  • 11
  • 2