fix(admin): unblock space creation blocked by WAF (v2.5.2) - #25
Merged
Conversation
…list The admin console proxies tool calls through POST /api/tool, which is routed through the Coraza WAF. Markdown rules in the request body tripped OWASP CRS XSS/SQLi heuristics (the '<' chars in "< 8 KB" / "< 15 KB" and the word "delete"), pushing the anomaly score past the threshold. Coraza returned a 403 with an empty body, surfaced in the UI as space_create failing with "Empty response". Exclude the /api/tool request body from CRS inspection (ctl:requestBodyAccess=Off scoped to REQUEST_URI @beginswith /api/tool). The endpoint is already gated by an HttpOnly cookie + write permission and only proxies structured {tool, arguments} calls — same trust rationale as /mcp*. Rate-limiting, body-size limits and URI/header inspection stay on. Also turn the Owner field on "Create Space" into a <datalist> of active token holders (free text still allowed), and document the WAF exception in DEPLOIEMENT_PRODUCTION.md §5. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion list Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
La création de space via la console
/adminéchouait avec "Empty response", sans rapport avec le champ Owner (qui est optionnel et purement informatif côté serveur).Cause racine (infrastructure, pas le code applicatif)
La console admin proxifie ses appels via
POST /api/tool, routé à travers le WAF Coraza (OWASP CRS). Le markdown des rules transite dans le corps de requête et déclenche des faux positifs XSS/SQLi du CRS — notamment les<des rules par défaut (activeContext.md < 8 KB,< 15 KB) et le motdelete(delete sections superseded…). Le score d'anomalie dépasse le seuil (5), Coraza renvoie un 403 à corps vide, affiché par l'UI commespace_createéchouant en "Empty response". C'est pourquoispace_listfonctionnait mais passpace_createavec rules.Correctif
waf/Caddyfile: exclusion du corps de requête de/api/toolde l'inspection CRS (ctl:requestBodyAccess=Offscopé àREQUEST_URI @beginsWith /api/tool). L'endpoint est déjà verrouillé par cookie HttpOnly + permissionwriteet ne proxifie que des appels structurés{tool, arguments}— même logique de confiance que/mcp*. Rate-limiting, limites de taille et inspection URI/headers restent actifs.<datalist>des détenteurs de tokens actifs (saisie libre toujours possible), valeur stockée = nom du token.DESIGN/live-mem/DEPLOIEMENT_PRODUCTION.md§5 documente l'exception.Déploiement requis
./waf/Caddyfile:/etc/caddy/Caddyfile:ro) → un simpledocker compose restart wafsuffit, pas de rebuild d'image.Tests
413 passed, 1 xfailed(assertion de version mise à jour 2.5.0 → 2.5.2 danstest_security_hardening_v2.py).🤖 Generated with Claude Code