Problem/Motivation
Proposed resolution
Remaining tasks
Update issue summary
Review code.
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | interdiff_21-27.txt | 1.79 KB | pooja saraah |
| #27 | 2930182-27.patch | 3.73 KB | pooja saraah |
| #26 | 2930182-nr-bot.txt | 2.79 KB | needs-review-queue-bot |
| #25 | 2930182-21.patch | 3.77 KB | idebr |
| #25 | interdiff-21-25.txt | 1.41 KB | idebr |
Comments
Comment #2
wim leersThe failing test-only patch that proves this is a bug, lifted from #2824851-199: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior.
Comment #3
wim leersTo make this work, we'll need to ensure that the
Userentity'spassfield does get set even when editing it is not allowed.Comment #4
wim leers#3 depends on #2824851: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior having landed first.
Comment #5
wim leers#2 will have failed at
With #3, the failure will have shifted down a few dozen lines in the test scenario, to:
IOW: thanks to #3, at least
// Test case 1: changing email.can be completed successfully. But// Test case 2: changing password.fails.Why?
Because
\Drupal\rest\Plugin\rest\resource\EntityResource::patch()calls\Drupal\rest\Plugin\rest\resource\EntityResourceValidationTrait::validate(), which calls$violations->filterByFieldAccess();… and since thepassfield cannot be edited according to the field access checking, there also shouldn't be any validation errors for it.But of course, #3 does allow the
passfield to be set (although only to be able to check that the correct password was provided when modifying security-sensitive fields:mail,nameandpass) … which is how you're effectively able to bypass security, thanks to the patch in #3 (not in HEAD).Comment #6
wim leersIf you want to confirm #5 yourself, add this debug output:
Comment #16
quietone commentedThis issue this was postponed on was committed to Drupal 8.5.x
This needs an issue summary update and reroll.
Comment #17
quietone commentedComment #18
immaculatexavier commentedComment #19
immaculatexavier commentedComment #20
immaculatexavier commentedRerolled patch against #3.
Comment #21
ranjith_kumar_k_u commentedComment #23
tvb commentedComment #25
idebr commentedFixed the test failures on 10.1.x
Comment #26
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #27
pooja saraah commentedFixed failed commands on #25
Attached patch against Drupal 10.1.x
Comment #28
pooja saraah commentedComment #29
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
For the issue summary requested in #16.
Fyi rerolls should not be put into review when there are outstanding issues.