IntelOwl icon indicating copy to clipboard operation
IntelOwl copied to clipboard

bug: old_password not validated before check_password call

Open deepak0x opened this issue 2 months ago • 3 comments

Description

old_password is retrieved from request.data but never checked for None/empty before being passed to check_password(), unlike new_password which has an explicit guard at line 188.

Steps to reproduce

  1. Open authentication/views.py around line 184
  2. When old_password is absent from the request, check_password(None, user.password) silently returns False and the response is 'Invalid old password' instead of 'Old password is required', masking the real error.

Expected behavior

The None guard added for new_password (line 188-192) was not added symmetrically for old_password. should be handled correctly.

Actual behavior

When old_password is absent from the request, check_password(None, user.password) silently returns False and the response is 'Invalid old password' instead of 'Old password is required', masking the real error.

deepak0x avatar Sep 14 '26 11:09 deepak0x

This issue has been marked as stale because it has had no activity for 30 days. If you are still working on this, please provide some updates.

github-actions[bot] avatar Oct 14 '26 14:10 github-actions[bot]

Hi, I have read authentication/views.py around line 184. The old_password path has no None/empty guard before check_password, so a missing field returns 'Invalid old password' instead of a clear error.

I can add the guard mirroring the new_password check at line 188, plus a test for the missing-field case.

Can I be assigned?

zcosmicw avatar Oct 22 '26 03:10 zcosmicw

@zcosmicw thanks for the analysis. Looks like this was addressed in #4064 (merged into develop) — line 189 now has the if not old_password guard returning 400 with "Old password is required." before reaching check_password. The behavior described in the issue should no longer reproduce on the current develop branch.

deepak0x avatar Oct 23 '26 14:10 deepak0x