This XSS is fixed in the parent issue. The purpose of this issue is to add a regression test.
Here are the steps to reproduce the XSS attack.
- Give user A permission 'administer search'
- As user A go to /admin/config/search/pages/manage/node_search
- Enter script in label textfield.
- As any user visit /search to trigger the script
Beta phase evaluation
| Issue category | Task because it is a follow-up regression test on a critical bug. |
|---|---|
| Issue priority | Major because it is a security regression test and a follow-up to a critical issue. |
| Unfrozen changes | Unfrozen because it only changes tests. |
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | interdiff-2539246-23.txt | 637 bytes | brandon.holtsclaw |
| #23 | 2539246-23.patch | 1.31 KB | brandon.holtsclaw |
| #21 | interdiff-2539246-20.txt | 1.36 KB | brandon.holtsclaw |
| #21 | 2539246-20.patch | 1.25 KB | brandon.holtsclaw |
| #19 | interdiff-2539246-19.txt | 1.09 KB | brandon.holtsclaw |
Comments
Comment #1
brandon.holtsclaw commentedI'm at DrupalGovCon and working on this test.
Comment #2
brandon.holtsclaw commentedThis test will fail until the parent issue is committed.
Comment #4
cilefen commentedComment #7
brandon.holtsclaw commentedSo if I'm understanding whats going on here correctly ... this is passing on the old testbots but is failing on the new testbots, the link https://www.drupal.org/node/3060/qa shows that core IS passing on "PHP 5.5 & MySQL 5.5 12,999 pass"
So I'd like to investigate this further but I do not know how to find out the exact PHP 5.5 versions that are running on the old and new testbots.
Comment #8
brandon.holtsclaw commentedAfter a little prodding on the issue, it seems that it was just non-obvious that when you click "retest" , its ONLY for the old testbot and I had wrongly assumed it would kick off a retest for both. After telling the new testbot to kick-off again against PHP 5.5 all seems to be right with the world.
So this is now fully ready for review & commit.
Comment #9
cilefen commentedThis is a nice regression test. +1 for RTBC. One minor thing:
These line changes at the end of the test class should be removed in the next patch.
Comment #10
brandon.holtsclaw commentedI've removed the changes at the end of the patch per suggestion from @cilefen
Comment #12
brandon.holtsclaw commentedre-rolling last patch that did not apply cleanly to head
Comment #13
brandon.holtsclaw commentedComment #14
brandon.holtsclaw commentedComment #15
cilefen commented@brandon.holtsclaw It is good work, but it needs peer review.
Comment #16
cilefen commentedI added the beta evaluation. The #12 patch tests exactly what is needed—an XSS vulnerability that was fixed in the parent issue.
It is not possible to reproduce the problem any more, however, early versions of this patch failed (as they should) before the parent was committed.
The code looks good, and the changes are in-scope. It expands test coverage to prevent a regression.
Comment #17
alexpottThe blank lines before the method close curly brace is not necessary.
I don't think these steps are necessary.
Comment #18
brandon.holtsclaw commentedI've updated the patch per the comments from alexpott in #17 and included and interdiff
Comment #19
brandon.holtsclaw commentedHere is a new interdiff and patch per feedback on IRC from alexpott
Comment #21
brandon.holtsclaw commentedOne more patch to fix the syntax error and to remove the admin user ... this should have been in the last patch :(
Comment #22
pwolanin commentedChanging the component since while this is a regression test against the local task system, the test is under the search module.
Test code looks good and patch seems to have taken all the feedback into account.
Minor additional code comment cleanup I'd suggest:
minor:
"Tests for XSS in search module local menu task label." -> either "menu local task" or just "local task" I think.
it might also be helpful to add a note about where the original bug was fixed
Similar to core/modules/user/src/Tests/UserRegistrationTest.php which has:
Comment #23
brandon.holtsclaw commentedHere is a new interdiff and patch that incorporates the feedback from pwolanin in #22
Comment #24
pwolanin commentedThanks, this looks like a good addition to the tests.
Comment #25
alexpottCommitted 93cb20d and pushed to 8.0.x. Thanks!
Comment #28
gábor hojtsy