Skip to content

[BUGFIX] EntropySpam: catch mixed-case salad with short consonant runs - #81

Merged
svewap merged 1 commit into
release/v14from
bugfix/entropyspam-caseflip-syllable-gate
Nov 15, 2026
Merged

svewap merged 1 commit into
release/v14from
bugfix/entropyspam-caseflip-syllable-gate

Conversation

@svewap

@svewap svewap commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Two contact-form submissions on wappler.systems (14.11.2026) passed EntropySpam with the current release/v14:

Token Length lower→upper flips longest consonant run
lCRRyywrOPYgKTeXYAzGy 21 5 4
lwTehoSoWoWIJucUfHbOHPGF 24 7 4
MPUjyeEejiAlzedeysqZbfo 23 3 5
IBaUjxDSNPmphwUy 16 3 10 (caught)

Random draws from both cases get a vowel (y included) every few characters, so the syllable gate (maximumConsonantRun 5) waves them through. The one token that is caught made up 21 % of the characters; e-mail, phone number and topic diluted it below gibberishShare (25 %).

Change

New option caseFlipsWithoutSyllableGate (default 4): a letter-only token with at least this many lower-to-upper flips counts as gibberish without the consonant-run gate.

Threshold chosen by measurement (uniform random tokens, 15–25 letters, n = 5000; 40 CamelCase / gender-inclusive names):

Rule random detected real spam tokens (8) extra false positives
current 71.8 % 5 —
≥ 3 flips 97.8 % 8 16 (iPhoneProMax, WhatsAppBusinessApi, BürgerInnenServiceCenter, …)
≥ 4 flips 92.8 % 7 0

hunspell de_DE false-positive rate unchanged at 0.15 % (Build/Scripts/measure-entropy-spam-false-positives.php).

Tests

  • Both submission tokens added to SpamCorpus::botTokens(), the full 14.11. submission as its own test.
  • Three-flip names added to humanSubmissions() to pin the threshold.
  • raisingTheConsonantRunThresholdLetsGibberishThrough disables the new bypass so it keeps testing the consonant run (its sample has six flips).
  • Unit suite green locally (433), EntropySpam-related functional tests green on PHP 8.4 (44).

v13 port: separate PR against release/v13.

🤖 Generated with Claude Code

Random tokens drawn from both cases get a vowel ("y" included) every
few characters, so their longest consonant run stays at four or five
and the syllable gate let them through. Two contact-form submissions
of 11/2026 ("lCRRyywrOPYgKTeXYAzGy", "lwTehoSoWoWIJucUfHbOHPGF") passed
this way; the plausible e-mail, phone number and topic then kept the
share of the one other suspicious token below gibberishShare.

Tokens with at least caseFlipsWithoutSyllableGate (default 4)
lower-to-upper flips now count as gibberish without the consonant-run
gate. Three would also flag four-part names like iPhoneProMax,
WhatsAppBusinessApi or BürgerInnenServiceCenter; four flags none of 40
CamelCase and gender-inclusive names checked. Detection of uniform
random 15-25-letter tokens rises from 72 % to 93 %; false positives
against hunspell de_DE stay at 0.15 %.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@svewap
svewap merged commit 5d326ce into release/v14 Nov 15, 2026
3 checks passed
@svewap
svewap deleted the bugfix/entropyspam-caseflip-syllable-gate branch November 15, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant