Network Security and Authentication Lecture

Identification, Authentication, and Authorization

  • Identification: This is the initial claim of identity, typically represented by a unique identifier such as a username.

  • Authentication: This is the process of proving a claimed identity. It involves presenting a secret that only the authorized user or device should possess.

  • Authorization: This defines the specific set of activities, permissions, or resources a user is permitted to access once their identity has been successfully authenticated.

Multi-Factor Authentication (MFA)

  • The Concept of Factors: MFA involves using two or more independent categories of credentials. Using multiple factors from the same category (e.g., a password and a PIN) is insufficient because they can often be bypassed using similar types of attacks.

  • Categories of Factors:

    • Something You Know (Knowledge-based): Secrets that exist in the user's mind, such as passwords, PINs, or security questions.

    • Something You Have (Possession-based): A physical device or software token that the user must possess, such as an authenticator app on a smartphone or a hardware security key (e.g., YubiKey). For apps, the phone must be in possession and typically unlocked.

    • Something You Are (Inherence-based): Biometric data unique to the individual, such as fingerprints, Face ID, or Touch ID.

  • Efficacy of MFA: While MFA significantly augments security, it is not undefeatable. It is a workaround built onto the flawed password system rather than a perfect solution.

The Persistence and Limitations of Passwords

  • Historical Context: Passwords have been a known security liability for decades. Research in usable security has long documented their flaws, yet they remain the industry standard due to several factors.

  • Memory Issues: Passwords are difficult to memorize. Users often cope by adopting unsafe practices, such as writing them down, choosing simple/predictable strings, or reusing the same password across multiple platforms.

  • Path Dependency and Inertia: Passwords persist because they are firmly entrenched. The established infrastructure and user familiarity create immense inertia; any replacement must be significantly better to overcome this.

  • Optimality Constraint: Despite their flaws, passwords are often viewed as the least bad option among available authentication methods because they satisfy a broad set of constraints across usability and deployment.

Password Attacks and Defensive Countermeasures

  • Online Guessing: Attackers repeatedly try common or predicted passwords against a live service.

    • Defense: Implementation of rate limiting and account lockouts after a specific number of failed attempts.

  • Credential Stuffing: Utilizing combinations of usernames and passwords leaked from previous data breaches to attempt logins on different services.

    • Defense: Websites check passwords against known breach databases to block their use. Password managers also provide notices when a saved credential appears in a leak.

  • Offline Cracking: Attackers obtain a database of password hashes and use brute force to find the original passwords by running various inputs through the hash algorithm until a match is found.

    • Defense: The use of "salts." A salt is a unique piece of data added to the password before hashing. This prevents the use of precomputed "rainbow tables" (lists of common passwords and their hashes), as an attacker would need a separate table for every possible salt-password combination. Additionally, computationally expensive (slow) algorithms should be used to increase the time required for brute-forcing.

  • Phishing and Exfiltration: Tricking users into revealing passwords or using malware/keyloggers to steal them.

    • Defense: Moving toward authentication methods that do not share secrets directly, like public key cryptography.

  • Plain Text Storage: A major security failure where passwords are saved without hashing. Even today, some services accidentally send cleartext passwords in recovery emails.

Password Recovery Protocols

  • Procedure: Users claim they have forgotten their password. The service requires strong evidence of ownership, usually via an email address.

  • Mechanism: The service sends a single-use token to the registered email. This token allows the user to log in once and establish a new password.

  • Critical Vulnerability: If the user's primary email address is compromised, the attacker can use the password recovery mechanism to seize control of all other accounts linked to that email.

Case Study: The Uber Infrastructure Breach

  • Initial Vector: An attacker purchased stolen credentials for an Uber employee on the dark web.

  • The MFA Bypass: The attacker contacted the employee via WhatsApp, posing as a member of Uber's security team. They informed the employee to approve multiple MFA requests they were about to send.

  • MFA Fatigue: The employee was bombarded with authentication prompts. Ultimately, the user succumbed to "MFA fatigue" and approved a request either to make the notifications stop or under the false belief they were assisting security.

  • Lateral Movement: Once inside, the attacker accessed the VPN and the internal network. On an internal server, they discovered a PowerShell script containing plain text admin credentials.

  • Consequences: The attacker gained access to secrets for various other systems. The motivation appeared to be notoriety rather than financial gain, as no known data destruction occurred.

  • Lessons: The breach highlights the danger of credentials stored in plain text by administrators for convenience and the psychological vulnerabilities in push-based MFA.

Public Key Cryptography and Passkeys

  • The Flaw in Shared Secrets: Passwords are shared secrets; once you send a secret across the internet, you lose exclusive control over it. Public key cryptography addresses this by never sharing the private key.

  • The User Experience Challenge: Implementing raw public key cryptography for average users is difficult. Keys are long, hard to remember, difficult to transfer between devices, and the concept is unintuitive for non-technical users.

  • Passkeys Defined: Passkeys are a modern implementation of public key cryptography designed for mass usability. They are registration-based and domain-bound.

  • Technical Implementation:

    • Registration: A public-private key pair is generated. The public key is sent to the website, while the private key remains on the local device.

    • Domain Binding: The key pair is tied to a specific domain (e.g., google.com). If a phishing site requests the key, the device will refuse to respond, effectively neutralizing phishing.

    • Hardware Security: Keys are ideally stored in secure hardware modules like the Secure Enclave (Mac/iOS) or Trusted Platform Module (TPM). This makes it impossible to extract the key from the device.

    • Authentication Flow: The website issues a "challenge." The user verifies their identity locally (via Face ID or Touch ID), which authorizes the secure hardware to sign the challenge with the private key. The website verifies the signature with the public key.

    • Cloud Synchronization: Services like iCloud Keychain can sync encrypted passkeys across a user's devices so they are not locked into a single physical machine.

Web Authentication and Session Management

  • Session Tokens: To avoid requiring a login on every page load, websites generate a session token after the initial authentication. This token is stored in the browser as a cookie.

  • Security Risks: Session tokens are high-value targets. If stolen, an attacker can impersonate the user without ever knowing their password.

  • Cookie Protections:

    • Secure Flag: Ensures the browser only sends the cookie over encrypted HTTPS connections.

    • HttpOnly Flag: Prevents client-side scripts (like JavaScript) from accessing the cookie, protecting it from Cross-Site Scripting (XSS) attacks.

Enterprise and Federated Identity

  • Single Sign-On (SSO): Allows users to authenticate once to a master central location to gain access to multiple related services within an organization (e.g., university systems).

  • Federated Identity: A system where a user signs in using a third-party provider (e.g., "Sign in with Google"). The provider authenticates the user and informs the destination website of the successful login.

  • Kerberos: A specific protocol used by organizations to manage SSO. Users authenticate to a Kerberos server, which issues "tickets" that are used to log into various services across the network.

  • Machine Authentication: It is not just humans who authenticate; devices and servers must prove their identities to each other using tools like TLS certificates and SSH host keys.

Questions & Discussion

  • Question: How would hosting verification protect a user on a compromised Wi-Fi network?

  • Answer: On a normal browser using TLS, the client (the browser) checks the digital certificate received from the website against the domain in the URL bar. If the certificate doesn't match the destination the user requested, the browser throws an error and stops the connection. This protects users automatically unless they are using specialized TLS configurations where verification is disabled.

  • Question: What happens if a user loses all their devices that have passkeys stored on them?

  • Answer: This is a complex edge case currently hindering universal adoption. However, if the passkeys are synced to a cloud-based manager (like Apple or Google), the user can regain access by signing into their primary cloud account on a new device.

  • Question: How easy is it for an attacker to steal a session token?

  • Answer: It is relatively easy if the user's device is compromised. If a malicious process or malware has permissions to read the browser's cache or memory, it can exfiltrate the token. Once the attacker has this token, they can often sign in as the user immediately.