TYPO3: protect your forms with SilentShield
The “silentshield” extension protects forms built with the TYPO3 form framework (EXT:form). You drag an invisible element into the form; on submit, your server asks SilentShield whether a person sent it.
Beta
The extension is in beta and not yet published in the TYPO3 Extension Repository (TER). You can get the installation package (ZIP file) and the package source for Composer from our support.
Requirements
- TYPO3 13.4 LTS (recommended) or 12.4 LTS
- PHP 8.1 or later, with TYPO3 13 PHP 8.2 or later; without Composer also the PHP extensions curl, sodium and json
- Forms built with EXT:form
- A SilentShield account with an API key for your website's domain
Free maintenance of TYPO3 12.4 has ended. The extension runs there (tested with 12.4.45), but we recommend 13.4.
How the protection works
- On the page with the form, the extension loads the SilentShield script. It observes how the form is used and puts a one-time proof into a hidden field. Your visitors solve no puzzle and click nothing extra.
- When the form is submitted, your server uses the secret key to ask SilentShield whether a person filled it in.
- In “enforce” mode, only a submission that SilentShield judges human gets through. All others are rejected with an error message at the form.
Installation
With Composer (recommended)
For TYPO3 installations managed with Composer. The SilentShield PHP SDK comes from its GitHub repository:
composer config repositories.silentshield-sdk vcs https://github.com/forge12interactive/silentshield-sdk-php
composer require forge12interactive/silentshield-typo3
vendor/bin/typo3 extension:setupWithout Composer (ZIP file)
- In the TYPO3 backend, open the Extension Manager (“Admin Tools → Extensions”).
- Upload the ZIP file (silentshield_<version>.zip) with “Upload Extension”.
The package includes the PHP SDK. If the SDK is missing (for example in a copy without the package) or cannot be loaded, the extension rejects every submission in “enforce” mode.
Enter your keys
You need two values from the SilentShield dashboard. You find both under “API keys” with your key:
- Site key (in the extension: “Site key”): public. It loads the script and appears in your page source. It is valid for the domain you entered when you created it.
- Secret key (in the extension: “Server secret”): stays on your server and is never sent to the browser. Do not share it.
- Open “Admin Tools → Settings → Extension Configuration” and then “silentshield”.
- Enter the site key under “siteKey”.
- The secret key is best set as the environment variable SILENTSHIELD_SERVER_SECRET on the server. Alternatively, enter it under “serverSecret”.
- “mode”: enforce rejects bots, observe only logs. “failureMode”: open accepts submissions during an outage (default), closed rejects them. “apiRegion”: default (api.silentshield.io) or eu (api-eu.silentshield.io).
- Save.
Several websites: every value can be overridden per site as the site setting “silentshield.<name>”, for example silentshield.siteKey. In TYPO3 13 the site set “SilentShield” adds the fields to the settings editor, without the secret key, because the editor shows values in plain text. A secret key per site is best entered as a placeholder for an environment variable:
silentshield.serverSecret: '%env(SS_SECRET_SHOP)%'Recommended start
Set the mode to “observe” for the first few days. No submission is rejected then, and the extension records what would have been rejected (where, see “Check that it works”). If everything looks as expected, switch to “enforce”.
Protect a form
- Open the form in the form editor.
- Drag the element “SilentShield (bot protection)” from the “Custom” group onto the page of the form where it is submitted. The element is invisible to visitors.
- Save the form.
In multi-page forms, the element belongs on the last page before submitting. The element brings its check along; it cannot be removed by accident in the editor.
In a form definition (YAML), the element looks like this:
-
type: SilentShield
identifier: silentshield-1
label: SilentShieldProtected forms
- Forms built with EXT:form that contain the element “SilentShield (bot protection)”
Not protected: forms without the element, and powermail forms (powermail is not connected yet).
Check that it works
- Open a page with a protected form and view the page source (right-click, “View page source”). Search for “client.js?k=”. If you find a script from api.silentshield.io or api-eu.silentshield.io with your site key, the script is in place.
- Fill in the form like a visitor and submit it. It must go through without an error message.
- Counter-check in “enforce” mode: turn off JavaScript for the page in your browser, reload it and submit the form again. The proof is then missing, and the submission is rejected with an error message, just like a bot that skips the script.
If the “Reports” extension (EXT:reports) is installed, you find the “SilentShield” section under “Reports → Status Report”. It shows whether the PHP SDK is present and whether site key, secret key and API address are set up per site; if something is missing, it shows an error with the consequence for your forms. Rejected submissions and submissions accepted unchecked during an outage are in the TYPO3 log.
If SilentShield cannot be reached
If SilentShield cannot be reached (outage, maintenance, timeout) or your secret key is refused, the extension's outage setting decides. With “accept” (default), submissions go through unchecked and are logged: your forms keep working but are not protected during that time. With “reject”, they stay protected but accept nothing from real visitors either. A bot verdict is never let through, whatever is set.
Troubleshooting
- The page source shows no client.js
- Check that a site key is set up (globally or for the site) and that the element “SilentShield (bot protection)” is in the form. The status report shows missing values per site.
- Every submission is rejected: “The spam protection is temporarily unavailable”
- Most common cause: the PHP SDK is missing or cannot be loaded, for example because the PHP extension curl is missing. The status report then shows an error for “PHP SDK”. Install the extension via Composer or with the ZIP file, which includes the SDK.
- Real visitors see “The spam protection could not run”
- The script did not run, so the proof is missing. If the TYPO3 Content Security Policy is active, the extension adds the SilentShield address itself. If you maintain your own Content Security Policy in the web server or proxy, allow https://api.silentshield.io or https://api-eu.silentshield.io in script-src and connect-src there.
- Submissions go through and the log shows warnings
- SilentShield could not be reached, or your secret key was refused (reason “auth”). Check the secret key and the status of your API key in the dashboard.
- Real visitors are rejected for a short time
- If a very large number of submissions arrives in a short time, SilentShield temporarily rejects further ones, even if submissions should be accepted during an outage. Otherwise an attacker could first fill the limit and then get every bot through. After a short time, real visitors get through again.
- Forms appear in the dashboard under a new name
- The extension reports the supported forms to SilentShield under their own name, so a verdict only applies to that form. Check the settings of the forms under the new name in the dashboard.
Limits
- powermail is not connected yet.
- Only a form that contains the element is checked.
- While SilentShield cannot be reached and failureMode is set to open, your forms are not protected. Every such submission is logged.
- Every form with the element reports to SilentShield under its own name, for example typo3:contact-12. If you assign the form to a different content element, the name changes.