weak-password-policy

A password policy weaker than OWASP ASVS asks for.

Group
Code
Runs
Runs under ur scan: ur scan --rule weak-password-policy
Level
warning
Reads
Every file
Fix
None: the safe form depends on what the value is meant to be

Why

A password may be shorter than 8 characters, which takes little time to guess, or may not be 64 characters long, which rules out passphrases and long passwords a manager makes, or must match a pattern that demands kinds of character, which pushes users to predictable ones such as Password1!. Ask for at least 8 characters, allow at least 64, and check new passwords against known breached ones instead of their composition.

The fix, as Ur suggests it: allow 8 to at least 64 characters, with no composition rules.

For agents

Ask passwords for at least 8 characters, allow at least 64, and demand no kinds of character.

Example

app/models/user.rb
class User < ApplicationRecord
  validates :password, presence: true, length: { within: 6..40 }
end
What Ur prints
$ ur scan --rule weak-password-policy
warning[weak-password-policy]: a password may be 6 to 40 characters long, where it should be at least 8 and may be at least 64
  --> ./app/models/user.rb:2:3 module's top level
  = hint: allow 8 to at least 64 characters, with no composition rules
  = see: OWASP Application Security Verification Standard 5.0, V6.2 Password Security, OWASP (2025-05-30), https://github.com/OWASP/ASVS/blob/v5.0.0/5.0/en/0x15-V6-Authentication.md
scanned 1 file (no framework recognized)
  weak-password-policy: 1 high, 0 medium
1 finding and 0 of medium confidence

Try it in the playground →

Source

OWASP Application Security Verification Standard 5.0, V6.2 Password Security, OWASP (2025-05-30).