REST user updates need to validate password using UserAuthInterface

Created on 9 June 2015, almost 10 years ago
Updated 8 April 2025, 9 days ago

Follow-up to #2418119: REST user updates bypass tightened user account change validation โ†’

The original fix invoked the password service directly. Instead it needs to invoke the user.auth service, since the password validation may proceed thorough an external service or alternative password storage.

The UserAuthInterface may need to be enhanced to also have a method to accept a pre-loaded user entity rather than always loading based on user name.

Problem

Proposed resolution

Remaining tasks

-

๐Ÿ› Bug report
Status

RTBC

Version

11.0 ๐Ÿ”ฅ

Component

user.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States pwolanin

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupalโ€™s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the โ€œReport a security vulnerabilityโ€ link in the project pageโ€™s sidebar. See how to report a security issue for details.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    It has been over 9 years since there was work here.

    Can someone confirm if this is still relevant?

    I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    This looks like it's still valid, at least in the sense that User::checkExistingPassword() has the same code that's changed in this issue and it's still called from ProtectedUserFieldConstraintValidator. I think we

    There's now UserAuthenticationInterface which accepts an $account, which covers the last paragraph of the issue summary.

    Having said that I'm not convinced that the patch is correct, it's calling the auth service from the user entity, but I think we might want to call the auth service from the validator instead, and then maybe deprecate the method on User.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92
  • Pipeline finished with Failed
    3 days ago
    Total: 106s
    #472896
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92

    Hello, I've created a merge request to move the checkExistingPassword method into the UserAuthenticationInterface and use it in the ProtectedUserFieldConstraintValidator. Let me know if I can do any other task.

  • Pipeline finished with Failed
    3 days ago
    Total: 145s
    #472913
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Believe we are still suppose to use dependency injection.

    Also issue summary should be complete

    Thanks

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92

    Sure, dependency injection added to the Constraint Validator, let me know if i can help with other tasks.

  • Pipeline finished with Failed
    3 days ago
    Total: 120s
    #473141
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92
  • Pipeline finished with Failed
    3 days ago
    Total: 106s
    #473222
  • Pipeline finished with Canceled
    3 days ago
    Total: 73s
    #473229
  • Pipeline finished with Failed
    3 days ago
    #473230
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Haven't fully reviewed but issue summary is incomplete

  • Pipeline finished with Failed
    3 days ago
    Total: 111s
    #473237
  • Pipeline finished with Failed
    3 days ago
    #473253
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92

    Summary updated

  • ๐Ÿ‡ฎ๐Ÿ‡นItaly rafuel92
Production build 0.71.5 2024