베타 Shoulder는 베타 버전입니다 — 결과가 가끔 잘못될 수 있습니다. 여러분의 피드백이 다음에 무엇을 고칠지 결정합니다. 피드백 공유
🔓

Weak Password Requirements

🛡️ 2 개의 규칙이 이를 탐지합니다

Weak Password Requirements

The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.

Without strong password requirements, users often choose weak, easily guessable passwords. This makes brute-force and dictionary attacks more likely to succeed.

보급률
높음
자주 악용됨
영향
높음
1개의 높은 심각도 규칙
예방
문서화됨
2개의 수정 예시
2 예방
2 예방

이 취약점을 수정하는 방법

2개의 Shoulder 탐지 규칙을 기반으로 한 Weak Password Requirements 예방 전략.

Weak Password Policy MEDIUM

Enforce minimum 12-character passwords with complexity requirements

+14 -2 go
  func validatePassword(password string) error {
-     if len(password) < 6 {
-         return errors.New("too short")
+     if len(password) < 12 {
+         return errors.New("password must be at least 12 characters")
+     }
+     var hasUpper, hasLower, hasDigit, hasSpecial bool
+     for _, c := range password {
+         switch {
+         case unicode.IsUpper(c):  hasUpper = true
+         case unicode.IsLower(c):  hasLower = true
+         case unicode.IsDigit(c):  hasDigit = true
+         case unicode.IsPunct(c) || unicode.IsSymbol(c): hasSpecial = true
+         }
+     }
+     if !hasUpper || !hasLower || !hasDigit || !hasSpecial {
+         return errors.New("password must include upper, lower, digit, and special char")
      }
      return nil
  }
  
Weak Password Policy HIGH

Require minimum 12 characters with complexity checks or use a password strength library

+4 -2 javascript
- if (password.length < 6) {
-   throw new Error('Password too short');
+ const zxcvbn = require('zxcvbn');
+ 
+ if (password.length < 12 || zxcvbn(password).score < 3) {
+   throw new Error('Password too weak');
  }
  
3 탐지
3 탐지

코드에서 취약점 찾기

Shoulder를 사용하여 코드에서 Weak Password Requirements 패턴을 스캔하세요. 2 규칙.

터미널
# Scan with Shoulder CLI
npx @shoulderdev/cli trust --cwe=521

# Or scan entire project
npx @shoulderdev/cli trust .
4 경고 신호
4 경고 신호

코드 리뷰에서 주의할 점

이 패턴은 잠재적인 Weak Password Requirements 취약점을 나타냅니다. 코드 리뷰와 보안 감사 중에 찾아보세요.

🟠
Password validation at ... lacks proper complexity requirements javascript-weak-password-policy
🟠
password validation that lacks proper complexity requirements, making accounts vulnerable to brute f javascript-weak-password-policy
🔍

코드베이스를 스캔하세요: Weak Password Requirements

Shoulder CLI는 전체 코드베이스에서 취약한 패턴을 찾아냅니다.