Problem/Motivation
This is a followup to SA-CORE-2024-002 which affected CKEditor5ImageController.
We should have a test that prevents this vulnerability from being reintroduced.
Private issue link (restricted access): https://security.drupal.org/node/180295
Proposed resolution
We should add a unit test that replicates the upload conditions that triggered the vulnerability.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3527408
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
prudloff commentedI added and updated the patch from the private issue.
People from the "Fixed by" section of https://www.drupal.org/sa-core-2024-002 should probably be credited.
Comment #4
smustgrave commentedReading https://www.drupal.org/sa-core-2024-002 believe this is a good coverage.
Comment #5
xjmIn reply to:
I don't think the following paragraph contains sufficient information to determine if it is good test coverage or not:
The test code in the MR doesn't appear to have anything to do with that, if one doesn't already know the internal details of the vulnerability as I do.
The commit corresponding to the SA might be more helpful to review.
Ideally, it would be reviewed by someone with access to the original private issue report (which I've added to the summary). Reviewing it might be a good task for one of our provisional Security Team members. (If you're given access, provisional team, remember not to make any of the info from the private issue public in the course of posting here.)
Comment #6
xjmAnother step I would expect to see for reviewing this would to be to revert the commit that fixed SA-CORE-2025-002, and have the test fail as expected, and then document that failure here on the issue.
Comment #11
xjmCrediting folks who contributed to the fix and review thereof on the private issue.
Comment #13
smustgrave commentedUploaded an MR with the fix reverted and the unit test added fails
So believe this is test coverage works
Comment #14
xjmI still don't think we're quite at a complete RTBC from the above, but I re-reviewed the full details of the private issue and will add my +1 to the RTBC confirming that it does indeed provide test coverage that should prevent the vulnerability from being reintroduced, despite that it is not possible to create an actual full exploit test in this situation. :)
Comment #19
xjmCommitted to 11.x, and cherry-picked to 11.2.x, 10.6.x, and 10.5.x as a test coverage improvement for a security issue. Thanks everyone!
Comment #20
larowlanThis broke head on 10.5.x and 10.6.x https://git.drupalcode.org/project/drupal/-/jobs/5716804
Reverting from there and setting to patch to be ported - the class
Drupal\file\Upload\FileUploadHandlerInterfacewas only added in 11.1 (from memory).Comment #23
xjmWhoopsidaisy, configuring email notifications for core pipelines is clearly still an issue for me. Only thing I miss about DrupalCI. RIP, Testbot.
Comment #25
xjmI dug a 10.2.x patch out of the private issue and spliced out the test. Applied locally, it has this diff against the previous commit:
Let's see if it passes on 10.6.x.
Comment #28
smustgrave commentedSeems the unit test keeps failing, re-ran twice
Comment #29
xjmFailing test output is:
Comment #30
prudloff commentedI fixed the D10 test.
Comment #31
smustgrave commentedSeems like a good backport now.
Comment #33
longwaveCommitted and pushed e4a89e5ef80 to 10.6.x and f1f81bba162 to 10.5.x. Thanks!