📌
Software Security
  • README
  • Prerequisites
    • Prerequisites
  • Introduction
    • Cyber security principles
    • Basic web concepts
      • HTTP
      • JavaScript
      • Cookies
      • SQL
      • DOM
      • APIs and the multitier architecture
    • Basic browser security concepts
      • Same-Origin Policy (SOP)
      • Cross-Origin Resource Sharing (CORS)
      • Cookies
      • Tracking
    • Basic security concepts
      • Hashing
  • Access Control: Basics
    • Authentication
      • Passwords
      • Password managers
      • Attacking passwords - online
      • Attacking passwords - offline
    • Authorization
      • Insecure direct object references
    • Session Management
    • CSRF
      • CSRF: why & how it works
      • Protecting against CSRF attacks
    • SSRF
      • SSRF: how it works and how we can protect against it
  • Access Control: Advanced
    • Authentication
      • Federation
      • Alternative authentication mechanisms
      • FIDO2 and WebAuthn
  • Injection attacks
    • Injection attacks
    • SQL Injection
    • Command Injection
    • Cross-site scripting
      • Input validation
      • Context sensitive output encoding
      • About the HttpOnly flag
      • Content Security Policy
    • Subresource integrity
    • Sandboxing
  • HTTPS
    • HTTPS
    • Introduction to cryptography
    • PKI
    • Setting up HTTPS
    • References
  • HTTP Headers for security
    • HTTP Headers
  • Threat Modeling
    • Threat modeling introduction
    • Threat modeling basics
    • Inspiration for threats
  • Bringing it all together
    • A comprehensive overview of controls
Powered by GitBook
On this page
  • Weak passwords
  • Password guidelines
  • Commonly used or compromised passwords

Was this helpful?

  1. Access Control: Basics
  2. Authentication

Passwords

PreviousAuthenticationNextPassword managers

Last updated 1 year ago

Was this helpful?

Weak passwords

Something you know mechanisms such as passwords are among the most used authentication mechanisms out there, yet they sometimes do not provide sufficient security. The reason for this is because passwords are often created by humans and must be remembered by humans, resulting in weak passwords.

Password guidelines

To prevent attackers from simply guessing user's passwords, password guidelines were created that introduced complexity rules on passwords. The idea was to increase the unpredictability of a password (entropy), and thus making it less likely to be cracked by a bruteforce attack (see later). Composition rules were amongst the most common guidelines: you had to use at least one digit and symbol and capital and lowercase character. However, analyses of breached password databases have shown that the benefit of these rules is not as significant as we initially thought.

Therefore, which explicitly discourages the use of composition rules to determine a password's strength. Rather, they provide two simple rules that application owners should implement:

  • Require users to choose a password of at least 8 characters

  • Compare the chosen password against a list that contains values to be commonly used, expected, or compromised. This list may include:

    • Passwords obtained from previous breaches (e.g. https://haveibeenpwned.com/)

    • Dictionary words

    • Repetitive or sequential characters

    • Context-specific words (service name, username, etc.)

That's it.

Commonly used or compromised passwords

While the guidelines have become easier, the implementation of the last requirement (comparing the password) is relatively new and may require some extra development work. The '' database is among the most well-known publicly accessible databases containing compromised passwords. Users can manually check if their account is present in breaches (of course, only breach sources that are included in HIBP).

However, more interestingly, HIBP provides an API that can be used to programmatically query a password to check if it is present in the HIBP database. This allows system administrators and application developers to easily fulfill the second NIST requirement. Of course, the HIBP list should be complemented with other lists such as dictionaries and top 100 password lists.

Some people may wonder if it's a good idea to send passwords to HIBP. The maintainer of HIBP did a great job, and passwords should actually not be sent in plain text to the HIBP API. Rather, searches are carried out using the first 5 characters of the hashed version of the password. This may result in false positives, but it also prevents the HIBP API servers from knowing which exact password is being tested. For those interested, more information can be .

NIST has released a new version of the guidelines
have i been pwned (HIBP)
are publicly available
found here