1

I have a NodeJS application on the server. The attacker from the client system already knows how the success response looks like for a request. Next time he sends a request with wrong credentials, here even if the request responses with failure status, he manipulates the response to success state and sends to the client (Angular 4). Thus now he can access rest of the process.

Node server already has HTTPS certification.

I do not understand what kind of attack this is? How can one solve such attack? IS there any way in NodeJS to protect from this kind of attacks?

Example:

Normal req and res flow:

A(client) ---> B(server) [A to B request]

B(server) ---> A(client) [B to A response]

Attacked req and res flow:

A(client) ---> B(server) [A to B request]

B(server) ---> C(attacker) --> A(client) [B to C, response is modified from failure to success status by c and sent to A]

2
  • 2
    what do you mean with "next time he steals someone else's link" ?? Also since you tagged as MITM, you already know its a kind of MITM, to tell you more about it you need to be a bit more descriptive
    – game0ver
    Commented Mar 26, 2018 at 17:12
  • "Thus now he can access rest of the process" - authorize all future requests, don't rely on client-side code respecting previous authorization failures.
    – gronostaj
    Commented Mar 28, 2018 at 6:10

1 Answer 1

1

This is a standard man-in-the-middle attack. You protect against it by using HTTPS. That adds encryption (confidentiality), tampering protection (integrity), and authentication. You'll need a TLS server cert installed in Node.

4
  • If you don't have a cert, you can get one for free from letsencrypt.org. Commented Mar 26, 2018 at 18:09
  • How do you suggest that HTTPS protects from response tampering? How can the client code identify such cases? Commented Mar 27, 2018 at 5:11
  • @VisheshMadhusudhana If your application use HTTPS, then the response from the server B will be encrypted and the attacker won't be able to modify it.
    – game0ver
    Commented Mar 27, 2018 at 9:29
  • @VisheshMadhusudhana - see this answer or google 'tls integrity'. But this is what TLS does. Commented Mar 27, 2018 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .