security - How can a server know the request is coming from client, not an eavesdropping hacker? -
i have simple question can not find simple answer to, missing or don t know how networking concept works. , want know don t know.
simply, question while eavesdropping possible, how can server know request coming client, not eavesdropping hacker.
scenario :
whatever security policy having, should send client. might asymmetric encrypted token or sth. client has no private key, whatever client able do, send etc, hacker can do, send too.
what might logic behind securing web application. there should secret client knows.
btw learning jwt , first time learning auth. simple question still unable find answer to.
how can server know request coming client, not eavesdropping hacker?
it doesn't.
it client verify server 1 expects talking to. it's called public key infrastructure.
tls/ssl can used connection on https - note not have diffie hellman, there other key exchange mechanisms such rsa.
imagine following scenario.
client --> https --> example.com
the client dns lookup example.com, , 203.0.113.10 returned. client connect 203.0.113.10 on https, , initial part of connection called handshaking process. here client checks domain thinking of connecting to, example.com, has certificate signed trusted certificate authority subject set "example.com
". prevent following happening:
client --> https --> attacker (fake example.com)
for example, if attacker had taken on dns server , changed example.com point him (198.51.100.200).
this attack prevented because attacker cannot prove ownership of example.com certificate authority , therefore won't able certificate signed in order prove clients server trusted.
https encrypts connection, , exchanges keys in secure manner. ensures established connection cannot read.
so once connection established, , user logs in, server send session token client, can in form of jwt. if cookie , secure flag set, can transmitted on https connection. how server knows hasn't been intercepted because client has verified server , has encrypted data in transit using unique keys agreed both parties.
client --> https --> attacker (fake example.com) --> https --> example.com
is not possible (active man-in-the-middle), shows situation in original question intercepts communications , passes jwt real server, observing private data in transit. this, if plain http used (no ssl/tls):
client --> http --> attacker (fake example.com) --> http --> example.com
Comments
Post a Comment