marshmallow/bot-shield
marshmallow/bot-shield provides lightweight bot protection for Laravel applications. Use configurable middleware and detection rules to identify and block suspicious automated requests, reduce spam, and protect forms and endpoints without complex setup.
calls, malformed array payloads) while preserving reports for genuine developer mistakes — e.g. a typo in a real method name still reports, and a component mutating its own reactive prop still reports. That distinction directly affects alert fatigue, Sentry/error-tracker spend, and on-call quality of life.MethodNotFoundException, CannotMutateReactivePropException, reactive prop snapshots). Adopting it creates a compatibility surface that should be considered when planning Livewire major upgrades or component refactors.exceptions.rules replace defaults rather than merge, so existing installs silently do nothing new until config is edited. This is a product decision about default behavior vs. explicit opt-in, and it must be scheduled as a deployment task, not assumed.Consider adoption when:
config/bot-shield.php, reviewing rule lists on each upgrade, and adding explicit env toggles (e.g. forged_updates) so behavior can be disabled without code changes.Look elsewhere or defer when:
Livewire\Exceptions\MethodNotFoundException and Livewire\Features\SupportReactiveProps\CannotMutateReactivePropException, so Livewire version changes are a maintenance consideration.For executives: This release tightens a security layer we can buy rather than build. It detects tampered Livewire requests — malformed data, injection-style method calls, unauthorized prop mutations — and stops them from polluting our error tracking, while still surfacing genuine bugs. The business case is reduced on-call noise, consistent rejection of probe traffic, and avoided engineering time maintaining bespoke framework-internals logic. The cost is a config review on upgrade, not a re-architecture.
For engineering leads: v1.2.0 makes the exception rules detector-gated and condition-aware. New when conditions (ForgedMethodName, ForgedReactivePropUpdate) let rules fire only when both the exception class and the request shape match, which is materially better than string-matching alone. The critical operational detail: a published exceptions.rules list replaces package defaults, so existing installs must add the new rules explicitly, and forged_updates must be added to the exceptions block if we want the ability to disable it via BOT_SHIELD_FORGED_UPDATES=false. Treat the upgrade as a config change with a review step, not a composer bump.
For security reviewers: The package is defense-in-depth for Livewire request integrity, not a WAF. It rejects forged array updates, non-identifier method calls, and self-targeted reactive prop mutations with client errors regardless of user agent, while preserving reports for legitimate typos and legitimate self-mutation. Confirm that suppressed events are still observable in logs or metrics if auditability is required, and pin/review the Livewire exception class imports on each Livewire upgrade.
How can I help you explore Laravel packages today?