Needs work
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2026 at 08:47 UTC
Updated:
19 Aug 2026 at 06:17 UTC
Jump to comment: Most recent
Comments
Comment #2
vishal.kadamComment #3
brian@graith commentedCode review at commit fa42b93. Full manual read of all files, phpcs (Drupal + DrupalPractice), and — because the normalizer class is dependency-free — I executed it directly, so every behavioural claim below is verified rather than inferred.
Verdict up front
The core matching algorithm is broken in both directions: it blocks everyday innocent input with the module's own shipped default configuration, and it fails to catch the evasions the project description advertises. Verified by running
LeetspeakNormalizer:ass→ BLOCKED (both normalize toas)ass→ BLOCKED (4→a,5→s, so "45" →as)boob→ BLOCKED (repeat-collapse turns "boob" into "bob")バカ→ BLOCKED (both normalize to the empty string)fuck→ passes — the advertised example is not caught (*is stripped, "fck" ≠ "fuck")ass→ passes — the settings form's own help table claims this is caughtThe default config ships
assin the word list with real-time JS enabled, so out of the box any webform user typing "as" or "45" gets an error.Major issues
normalize()collapses all repeated letters to one (ass→as,boob→bob), so every bad word with double letters equals a shorter innocent word; digit mapping makes number tokens match too. Thev→umapping mangles ordinary words ("love"→"loue"). Consider collapsing runs of 3+ to 2 (catches elongation without merging legitimate doubles), applying digit/symbol maps only inside mixed alphanumeric tokens, and testing against a corpus of innocent text.normalize()strips everything outside[a-z], so non-Latin lists (the form's own examples:ja|バカ,ar|كلب) normalize to''. The server-sidefindBadWord()lacks the empty-string guard the JS has, so a configured Japanese/Arabic word never matches its real occurrence and instead matches any punctuation-only token (":)" triggers a block).hook_webform_submission_form_alter()only checks the globalenable_js_realtimetoggle (default TRUE) and never checks whether the webform has this handler attached. Client-side blocking (including a submit guard) is enforced on all webforms while server-side validation runs only where the handler exists — JS users are hard-blocked on forms never configured for filtering; JS-off users pass on the same forms. The hook must check$webform->getHandlers().drupalSettingsin the page source of every webform, anonymous included, by default. That hands evasion-testers the exact list, and many sites won't want their moderation vocabulary readable in source. Needs prominent documentation at minimum; better, make real-time checking server-backed or opt-in.Moderate
validateForm()skips any non-string value, so multi-value textfields and composite elements (name, address) are never validated — a trivial bypass. Needs recursive traversal.administer webform leetspeakis defined but the settings route requiresadminister webforminstead.t():$this->t($errorMessage, ...)on admin-configured text; only literals should go through t() — useFormattableMarkupfor the token replacement.\Drupal::statics avoid "property redeclaration conflicts with WebformHandlerBase" while using inherited$this->configFactorylines later. There is no conflict; use normal DI viacreate().findBadWord()re-normalizes every bad word for every word of every field, twice (two passes), in both PHP and JS. Pre-normalize the list once.ass→aswithout noticing that makes the word "as" a false positive). The documentation needs regenerating from tested behaviour.Minor
wlsf) ≠ module machine name (webform_leetspeak) — the packaged tarball/composer package will bewlsfwith a differently-named module inside; rename one before release.LICENSE.txtmust not be committed — drupal.org packaging adds it.README.mdandREADME.txtpresent with duplicate content; keep one.drupal:languageis unnecessary (languageManager()exists in core without it) and forces the module's installation.core_version_requirement: ^9— Drupal 9 is EOL; suggest^10.3 || ^11.isExcluded()uses substring matching (excludingnamealso excludesfirst_name) while PHP uses exactin_array()— inconsistent semantics..gitlab-ci.yml.LeetspeakNormalizeris pure static and trivially unit-testable — a small test suite would have caught every major finding above.Security
No injection/XSS found: the JS inserts messages via
text:, drupalSettings encoding is core-handled, watchdog uses placeholders. The serious concerns are functional and disclosure-related (#3, #4), not classic vulnerabilities.Summary
Clean intentions and reasonable structure (separate normalizer class, PHP/JS mirror), but the module fails its own advertised examples and false-blocks ordinary English with the shipped defaults — verified by execution. It needs an algorithm redesign, unit tests for the normalizer, scoping of the JS to handler-enabled webforms, and a documentation rewrite before production use.
Comment #4
nikky171091 commentedThank you @brian.willows — this is exactly the kind of review the module needed. Every finding is valid, and I appreciate that you executed the normaliser directly rather than reading it statically. I'll address each point:
Comment #5
avpadernoThank you for applying!
Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review. See also Policy on the use of AI when contributing to Drupal, which is valid when contributing to Drupal, either by committing code in a project, or by creating a merge request for an existing project.
The important notes are the following.
Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
To the reviewers
Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.
The important notes are the following.
For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.
Comment #6
solideogloria commentedStatus should be Needs Work after comment #3
Comment #7
vishal.kadam1. FILE: README.md
The README file is missing the required sections - Requirements.
2. FILE: README.txt
Remove README.txt since README.md is already prsent.
3. FILE: webform_leetspeak.info.yml
core_version_requirement: ^9 || ^10 || ^11Projects used for these applications should not declare itself compatible with a Drupal release that is no longer supported. No site should be using Drupal 8 nor Drupal 9, and people should not be encouraged to use those Drupal releases.
The dependencies follow the format
<project name>:<module name>. What used for the Webform module is not correct.4. FILE: webform_leetspeak.module
For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.
It would require increasing the minimum Drupal 10 version supported, but Drupal 10.1 is no longer supported.
5. FILE: src/Form/WebformLeetspeakSettingsForm.php
With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.
Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.
For this change, it is necessary to require at least Drupal 10.3, but that is not an issue, since Drupal 10.2.x is no longer supported.
Comment #8
vishal.kadamI am changing priority as per Issue priorities.