mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-03-17 22:36:17 +00:00
enhance security by adding cache control headers, validating password length, and rejecting encoded slashes in path processing
This commit is contained in:
@@ -7,7 +7,12 @@ from auth_gateway.models.auth import UserModel
|
||||
password_hasher = PasswordHasher()
|
||||
|
||||
|
||||
MAX_PASSWORD_LENGTH = 1024
|
||||
|
||||
|
||||
def verify_user_password(username: str, password: str, users: dict[str, UserModel]) -> UserModel | None:
|
||||
if not password or len(password) > MAX_PASSWORD_LENGTH:
|
||||
return None
|
||||
user = users.get(username)
|
||||
if not user or not user.password_hash:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user