I am trying to implement some anti-spamming mechanism into my server. I need to know whether req.ip can be faked by the remote hacker in Express.js. Could someone please confirm this with me?
I am trying to implement some anti-spamming mechanism into my server. I need to know whether req.ip can be faked by the remote hacker in Express.js. Could someone please confirm this with me?
Share Improve this question asked Jul 4, 2018 at 4:47 Chong Lip PhangChong Lip Phang 9,2797 gold badges75 silver badges114 bronze badges1 Answer
Reset to default 6Yes, it can be faked. request.ip
getting it's value from the left most entry of the X-Forwarded-For header, which can be faked.
Express docs: https://expressjs./en/api.html#req.ip