SHADE is young: 0.1.0-next.2 is a pre-release, and 0.1.0 isn't out yet.

SHADE
People, security and privacy

Request protection

SHADE's admin and website talk to a server that anyone on the internet can reach, so SHADE guards itself against abuse. It limits how often one visitor may sign in, send a form or check out, makes sure a retried checkout does not create a second order, checks incoming payment notices, caps the size of what is sent, and only lets the client's own website (the Site URL under Settings) use its visitor features from a browser. This is part of SHADE; nobody switches it on or off. How the people who run an instance set it up is in Hardening a production instance and Setting up an instance (Coolify).

What users can do

Nobody configures request protection in the admin. What people notice:

Visitors:

  • After too many form submissions, bookings, checkouts or sign-in attempts in a short time, they get a "try again later" message instead of the normal result (see What visitors and the team see).
  • Pressing "pay" twice, or a network retry during checkout, does not start two orders or payments.
  • Bots that fill in the hidden "Website" field of a form, or send it within 3 seconds of loading the page, get a normal "sent" answer, but nothing is stored or emailed.
  • A form of the forms module also asks the visitor's browser to work out a small proof-of-work puzzle before it sends (ALTCHA, run by SHADE itself, no outside service): well under a second for a person, real work for a bot that sends thousands. Without the answer, or with one used before, the form gets the same normal answer and nothing is kept. See Forms.

Editors and admins:

  • After 10 sign-in attempts (or 10 two-factor codes) from one address within 15 minutes, sign-in is refused for the rest of that quarter hour.

Admins:

  • See refused sign-in bursts in the audit log (protection.rate-limited), once per address and window.
  • See refused calls to a module's webhook in the audit log (Webhook refused, protection.webhook-refused), with why, once per route a minute.
  • Enter a module's webhook signing secrets on its settings page, and during a rotation the previous one too. They are kept sealed and never shown again.

Who may do it

Request protection has no permissions of its own: it applies to everyone, signed in or not.

ActionPermissionRoles
Change the limitsnone: set by SHADE's code and by whoever runs the instancedevelopers / whoever deploys
Be rate limitednoneeveryone, including signed-out visitors and API tokens

In the admin

Nothing directly: there is no screen or setting. The only place editors meet it is the Sign in page, which shows "Too many requests. Try again later." when the sign-in limit is reached.

On the website

  • Forms (the forms module's forms on pages, and the appointments booking form) carry a hidden "Website" field that people never see or reach with Tab, and send how long the page was open. See The website and, for accounts, Accounts and personal pages. Forms get their own page later.
  • When a limit is reached, the site shows its own "too many" text, in Dutch or English (below).
  • The shop's cart sends a fresh check with each checkout attempt and keeps it for retries of that attempt, so a retry never orders twice.

What visitors and the team see

SituationWhat is shown
Over a rate limitForm: "You just sent this a few times. Please try again in a few minutes." Booking: "You just booked a few times. Please try again in a few minutes." Cart and account page: "Too many attempts. Try again in a minute." Admin sign-in: "Too many requests. Try again later." (Dutch: "Te veel verzoeken. Probeer het later opnieuw.")
A bot filled the hidden field, or sent the form within 3 secondsThe form's normal success message (nothing is stored)
What was sent is too largeThe form's generic "did not work" text
A media upload is too largeThe admin's error message "Upload too large"
Limits cannot be counted just now (see below)"Requests cannot be counted just now. Try again shortly."

The Dutch texts on the website exist next to the English ones (e.g. "Te veel pogingen. Probeer het over een minuut opnieuw."); the site picks them by the page's language.

Rules and limits

Rate limits

A rate limit allows one visitor a number of tries per time window. The window slides: someone cannot use the whole limit at the end of one window and again at the start of the next. Refused tries count too, so retrying while refused keeps someone refused.

WhatLimitWindowCounted per
Editor sign-in1015 minaddress
Editor two-factor code1015 minaddress (separate from sign-in)
Editor passkey sign-in (both steps)1015 minaddress (each step its own)
The account page's password checks: changing the password or the email, turning two-factor on or off, allowing a passkey5 together15 minteam member
AI assistants (MCP)1201 minAPI token
Sending a form510 minaddress
Page views counted by the analytics module1201 minaddress
Looking up free appointment times12010 minaddress
Booking an appointment510 minaddress
Checking out in the shop101 minaddress
Reading stock, the cart, an order's status120, 120, 601 minaddress
Accounts: signing in, signing up, resetting a password …101 minaddress, each action its own
Accounts: signing in, on top of the above2015 minthe account, however many addresses try
Accounts: sign-up and confirmation emails, on top of the above3 together1 hthe email address they go to
Accounts: password reset links, on top of the above31 hthe account, on their own
Confirming a user's address with the password101 minaddress
The same, on top of the above1015 minthe confirmation link, however many addresses try
Reading who is signed in on the website1201 minaddress
Downloading one's own data101 haddress
Payment notices from Mollie3001 minaddress
A module's routes for signed-in users, unless it sets its own601 minthe user
Every module route for signed-in users, on top of the above3001 minaddress
Browser errors the site reports (Errors and security alerts)3010 minaddress
  • Each limit has its own budget, so filling one form does not use up another's.
  • Every route a module opens to visitors has a limit, counted per address: SHADE does not load a module that leaves one out.
  • Address is the visitor's internet address. Someone with a block of addresses from one connection (IPv6) counts as one. The address itself is never stored.
  • The counts are kept only for the length of their window.
  • If limits cannot be counted (the instance's counting service is down), signing in, sending forms and every other limited action is refused with "Requests cannot be counted just now. Try again shortly." until it is back: nobody gets through uncounted. The error log shows it. Reading content keeps working.
  • The rest of the admin's work (editing, uploads, the site's build) has no rate limit.
  • Per account, too. Someone with many networks could guess one account's password from each, so the team's and users' sign-ins are also limited per account (20 a quarter hour), and the emails to one address to 3 an hour: the team's resets; users' sign-up and confirmation emails together, and users' reset links on their own, so sign-up and resend requests (which anyone can send for any address) never keep the owner from a reset. Anyone can use up one account's budget, so its owner may have to wait a quarter hour to sign in, or up to an hour for a reset link (accepted); an admin can send a user a link to choose a password from the Users screen meanwhile.
  • Audited refusals: team and user sign-ins record the first refused try of an address per window as protection.rate-limited (the limit's name as target, and a scrambled key, never the address), window after window while the refusals go on. When that entry can't be written, the answer is still 429 and the error log says why. Other limits are not audited: a flood of page views is no event. Each failed editor sign-in is audited on its own too, as team.login-failed, and repeated refusals raise a security alert (Errors and security alerts).

Idempotency keys

An idempotency key is a random string the browser sends with a request that must not run twice (a checkout). If the same request arrives again with the same key, SHADE answers with the first result instead of running it again.

  • Today only the shop's checkout uses one.
  • A key is remembered for 24 hours. The shop also never makes a second order for the same key, so a retry after 24 hours still finds the first order.
  • If the first try failed on SHADE's side, the same retry is run again.
  • If SHADE stopped in the middle of the first try (a crash or a restart), a retry is told the first one is still running for up to 5 minutes. After that the same retry runs.

Payment notices

Mollie tells the payments module when a payment changes. Mollie does not sign these notices, so the module trusts only the payment id in them, asks Mollie itself for that payment and believes only Mollie's answer. Unknown payments are ignored, and a paid amount or currency that differs from what was asked counts as failed. Refused notices are recorded and, in a burst, raise a security alert (Payments).

Modules' webhooks

A module that receives webhooks from a provider (Stripe, or one following Standard Webhooks) has each call checked before the module sees it: the call must be recent (within five minutes), signed with the module's signing secret (or the previous one while it is being changed), and a call delivered twice is handled once. Anything else is refused without saying why, and the refusal is audited. For developers: Incoming webhooks.

Request size

  • What is sent to SHADE is capped (1 MiB unless whoever runs the instance sets it otherwise).
  • Media uploads have their own limit: 20 MB per file, 100 MB for a video or audio file. See Media.

Security headers

SHADE's answers and the site's pages tell browsers to be careful: use only HTTPS for the site's domain and its subdomains once they have seen it (for a year), never let another site show the admin in a frame, and run only the scripts the admin and the site ship themselves, plus those from outside hosts a switched-on module declares. Content in a page can never widen that list. The exact headers are for whoever runs the instance: Hardening a production instance.

Form spam

The forms module and appointment booking share three measures: the hidden "Website" field, a minimum fill time of 3 seconds (a form sent without its time counts as too fast) and the per-address rate limit. The forms module also accepts only published forms and only their own fields, and stores only a scrambled form of the address.

Cleanup

Stored checkout answers go after a day (the fixed kind Request protection in Data retention). Rate-limit counts need no cleanup: they expire on their own.

For developers

The code and its tests: shade/kernel/protection/README.md in the shade repository.