You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
security: add Cloudflare Turnstile CAPTCHA to email endpoint
- Add Turnstile widget to share result modal (modal-templates.js)
- Add Turnstile script tag to index.html (explicit render mode)
- Validate CAPTCHA token before sending email (cloud-share.js)
- Server-side token verification + rate limiting in Apps Script
- New secured deployment URL replaces old unauthenticated endpoint
- Add test for CAPTCHA-blocked send, mock Turnstile in test setup
Secured the Google Apps Script email endpoint with **Cloudflare Turnstile CAPTCHA** and server-side rate limiting. Previously, the endpoint was publicly accessible with no authentication, allowing anyone to send spam or phishing emails from the owner's Google account.
6
+
7
+
## Changes
8
+
9
+
### Security
10
+
11
+
-**Cloudflare Turnstile CAPTCHA** — invisible CAPTCHA widget blocks bots from abusing the email endpoint
12
+
-**Server-side token verification** — Apps Script validates the CAPTCHA token with Cloudflare's `/siteverify` API before sending any email
13
+
-**Daily rate limiting** — max 20 emails/day via `PropertiesService` in the Apps Script
14
+
-**New deployment URL** — old (unsecured) endpoint replaced with new Turnstile-secured deployment
15
+
16
+
### Files Modified
17
+
18
+
-`js/modal-templates.js` — Added `#turnstile-container` and `#turnstile-error` elements in the email section
0 commit comments