Session Hijacking Can Bypass the Password Question
An application session connects a series of requests so a website can recognize an ongoing visit. Session hijacking happens when an unauthorized person takes over that recognized session. For a signed-in account, the attacker may be able to act as the user without learning the password.
The missing piece is a session identifier, also called a session token. It is a value the application accepts to connect a new request with an existing session. After login, that value can temporarily stand in for the identity check the user has already passed.
The software-security organization OWASP describes this role in its session-management guidance. Protecting the password is necessary, but it doesn't remove the need to protect this continuing proof.
Why the website doesn't ask for your password on every page
A site needs a way to connect “open my inbox” with the person who just signed in. One common approach is to put the session identifier in a cookie, a small piece of data the browser stores and sends with matching requests.
The browser doesn't have to send the password again each time. It sends the identifier, and the application checks the session associated with it. A session cookie can therefore be valuable even when it contains no readable username or password.
How a Stolen Session Can Take Over a YouTube Channel
Suppose an attacker obtains a valid identifier that the application accepts from another requester. The attacker may then submit requests using that value. The application can mistake those requests for the continuation of the user's signed-in activity.
The available actions still depend on the account's permissions and any extra checks the application requires. Session hijacking doesn't automatically grant control of the whole computer or make every account setting available.
The identifier can be exposed in more than one way
Capture is one route, but it isn't the only one. An attacker might obtain a leaked token, predict a poorly generated identifier or arrange for a user to authenticate with an identifier the attacker already knows.
That last route is called session fixation. Instead of having to steal a new value after login, the attacker tries to preserve a known value through the login process. Renewing the session identifier when privileges change helps address that problem.
An attack involving stolen session proof also explains a limit of additional login factors. An extra factor can strengthen the original authentication check. It doesn't automatically prevent reuse of every token issued after that check succeeds.
- Make a stolen password useless without the key in your hand.
- Sign in with a tap instead of typing a code.
- Protect Google, Microsoft, Apple and more than 1,000 other accounts.
Each protection closes a different route
HTTPS protects web communication using TLS, Transport Layer Security. It makes the contents difficult for a network eavesdropper to read and helps detect tampering. Someone sharing the same Wi-Fi doesn't thereby gain the ability to read a properly protected session token.
Cookie settings address more specific problems. The Secure setting tells the browser to send the cookie over a secure connection. HttpOnly prevents scripts, small programs running in a page, from reading the cookie's value directly. Harmful code inserted into a page can still misuse the signed-in session in other ways.
Applications also need limits on how long a session is accepted. An idle timeout expires a session after inactivity. An absolute timeout sets an overall limit; it doesn't depend on the session becoming quiet. The latter matters when an attacker keeps sending requests.
These are recommendations for application behavior, not proof that every site implements them.
Ending the visit must end the server's acceptance
A visible browser window isn't the same thing as the session stored by the application. Closing the window doesn't reliably tell the server to invalidate its session.
Explicit logout should invalidate the session on the server, so the old identifier is no longer accepted. A password change also shouldn't be assumed to revoke every existing session unless the service actually does that.
Browser Cookies: What They Remember About You

JWT: The Readable Token a Service Still Has to Check

Two-Factor Authentication: A Stolen Password Isn’t Enough

QUOTE:
"Amateurs hack systems, professionals hack people."
