Background information
- confidential private issue: https://git.drupalcode.org/security/185098-drupal-security/-/work_items/1
(included for reference. Please do not report access denied as an error.)
Problem/Motivation
Passing user input to Htmx::trigger() could be used for DDOS attacks if the trigger is set to a very low interval.
This is slightly mitigated by the fact HTMX waits for the current request to complete before starting the next.
It should be fairly obvious that passing user input to this method is a bad idea but we might still want to state that explicitly in the docblock.
Steps to reproduce
$userProvidedValue = 'every 0.001s';
// The browser will start spamming the URL.
Htmx::trigger('click', $userProvidedValue);
Proposed resolution
Add a warning to the docblock saying $triggerDefinition should not be provided by untrusted users.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3614219
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:
- 3614219-add-warning-about
changes, plain diff MR !16639
Comments
Comment #3
prudloff commentedComment #4
smustgrave commentedSeems straight forward enoguh
Comment #5
fathershawn+1 from me. As a general principal, no HTMX attribute values should be constructed using user input.
Comment #8
godotislateCommitted and pushed 924d508 to main and 49373f8 to 11.x. Thanks!