Skip to content

Use constant-time compare in BasicAuth#531

Open
Cycloctane wants to merge 1 commit intoaio-libs:masterfrom
Cycloctane:password_compare
Open

Use constant-time compare in BasicAuth#531
Cycloctane wants to merge 1 commit intoaio-libs:masterfrom
Cycloctane:password_compare

Conversation

@Cycloctane
Copy link
Member

@Cycloctane Cycloctane commented Jul 17, 2025

What do these changes do?

Using string comparison (==) to compare passwords may be vulnerable to timing attack under some scenario. This pr replaces it with constant-time compare (hmac.compare_digest) on password to reduce the risk.

Are there changes in behavior for the user?

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments