Document password hash disclosure in User Update API#407
Open
elit3pwner wants to merge 1 commit intoAIxBlock-2023:mainfrom
Open
Document password hash disclosure in User Update API#407elit3pwner wants to merge 1 commit intoAIxBlock-2023:mainfrom
elit3pwner wants to merge 1 commit intoAIxBlock-2023:mainfrom
Conversation
The user update API exposes password hashes in the response, which poses a security risk. Recommendations include excluding the password field from API responses and implementing dedicated password management endpoints. Signed-off-by: Dikshant Singh <95041015+elit3pwner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The user update API exposes password hashes in the response, which poses a security risk. Recommendations include excluding the password field from API responses and implementing dedicated password management endpoints.
Password Hash Disclosure in User Update API
Severity
HIGH
CVSS Score & Vector
CVSS v3.1: 7.5 (High)
Vector: AV:N / AC:L / PR:L / UI:N / S:U / C:H / I:N / A:N
Vulnerability Description
The user update API endpoint returns the user's password hash in the HTTP response body after a successful update request. Although the password is stored using a strong hashing algorithm (
pbkdf2_sha256), exposing password hashes constitutes disclosure of sensitive authentication material.Password hashes must remain strictly server-side. Their exposure enables offline password cracking, facilitates credential reuse attacks, and significantly increases the impact of other vulnerabilities such as IDOR, XSS, or token compromise.
This issue indicates improper serialization of the User model, resulting in the inclusion of the
passwordfield in API responses.Proof of Concept
Request
Response
The
passwordfield containing the password hash is returned directly in the API response.Impact
High — enables offline password cracking, credential reuse attacks, and significantly increases the blast radius when chained with other vulnerabilities.
Recommendation
passwordfield from all API serializers used in responses.write_onlywhere input is required.Reference Links
Screenshot: