Harden KantSites after the security review

- The installer only opens with a per-installation key that install.php
  creates and shows; the key is deleted with the first account.
- Lock files keep .env, the database, backups and logs out of reach when a
  domain points at the project folder instead of public/.
- Linked sections render by their own schema version, so an old section
  cannot carry unfiltered HTML into a newer page.
- Editors no longer move, trash or change areas and post data of published
  pages; a scheduled publication goes live with the revision that was
  scheduled (migration 20261012000100).
- Form stamps are bound to their form, IPv6 senders count per /64, and a
  flood per form or overall stops storing with a visible message.
- The consent redirect rejects control characters, update targets must look
  like 1.2.3, and own CSS cannot reach outside its block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Opus 5.5 committed 2026-10-12 14:38:25 +02:00
1 parent 14e7a3b310
commit ad7c333215
43 files changed
+810 -53

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
# Dieser Ordner gehoert nicht ins Netz (ADR 116). Zeigt die Domain richtig auf public/, wird diese
# Datei nie gelesen; zeigt sie versehentlich auf den Projektordner, sperrt sie hier alles.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
+1 -1
View File
@@ -138,7 +138,7 @@
{% if editing|default(false) %}<p id="{{ block.id }}" class="block-unavailable{{ designClasses }}" role="note">Verknüpfte Sektion: unter Inhalt die Adresse einer Sektion eintragen.</p>{% endif %}
{% elseif section %}
<div id="{{ block.id }}" class="block-partialref{{ designClasses }}">
{% for child in section.blocks %}{% include 'blocks/block.html.twig' with {block: child, editing: editing|default(false), postLists: postLists|default({}), forms: forms|default({}), breadcrumbs: breadcrumbs|default([]), navigation: navigation|default({}), sections: sections|default({}), richText: richText|default(false), richHeadings: richHeadings|default(false), neighbours: neighbours|default({}), eagerImage: eagerImage|default(null), inHeader: inHeader|default(false)} only %}{% endfor %}
{# Die Sektion nach ihrem eigenen Schema-Stand: ihr Text wurde nach diesem gefiltert, nicht nach dem der Seite (ADR 116). #}{% for child in section.blocks %}{% include 'blocks/block.html.twig' with {block: child, editing: editing|default(false), postLists: postLists|default({}), forms: forms|default({}), breadcrumbs: breadcrumbs|default([]), navigation: navigation|default({}), sections: sections|default({}), richText: section.schemaVersion|default(1) >= 12, richHeadings: section.schemaVersion|default(1) >= 17, neighbours: neighbours|default({}), eagerImage: eagerImage|default(null), inHeader: inHeader|default(false)} only %}{% endfor %}
</div>
{% elseif editing|default(false) %}
<p id="{{ block.id }}" class="block-unavailable{{ designClasses }}" role="note">Die verknüpfte Sektion „{{ props.partial }}“ gibt es nicht mehr. Der Verweis bleibt gespeichert.</p>
+3 -1
View File
@@ -17,7 +17,9 @@
{# Bait for automated senders. Hidden from view, from assistive technology and from tab order. #}
<div class="form-trap" aria-hidden="true"><label for="website-{{ blockId }}">Website</label><input id="website-{{ blockId }}" name="website" type="text" tabindex="-1" autocomplete="off"></div>
{% if errors is not empty %}
{% if errors._form is defined %}
<p class="form-error-summary" role="alert">{{ errors._form|kant_t }}</p>
{% elseif errors is not empty %}
<p class="form-error-summary" role="alert">{{ (errors|length == 1 ? 'Bitte prüfe 1 Eingabe. Die betroffenen Felder sind unten gekennzeichnet.' : 'Bitte prüfe %d Eingaben. Die betroffenen Felder sind unten gekennzeichnet.')|kant_t|format(errors|length) }}</p>
{% endif %}
+15
View File
@@ -0,0 +1,15 @@
{% extends 'install/base.html.twig' %}
{% block heading %}Installationsschlüssel{% endblock %}
{% block lead %}
<p class="muted">Damit niemand anderes diese Installation zu Ende führt, öffnet sich der Installer nur mit dem Schlüssel dieser Installation. Er steht auf der Abschlussseite von <code>install.php</code>. Wer die Dateien per FTP hochgeladen hat, findet ihn in der Datei <code>{{ keyFile }}</code> – herunterladen und öffnen, er besteht aus 32 Zeichen.</p>
{% endblock %}
{% block content %}
<form method="post" action="{{ path('install_key') }}">
<label for="schluessel">Schlüssel</label>
<input id="schluessel" name="schluessel" required maxlength="80" autocomplete="off" spellcheck="false" autofocus>
<p class="muted">Mit dem ersten Konto ist die Installation abgeschlossen; dann wird der Schlüssel gelöscht.</p>
<div class="sheet-actions">
<button class="primary" type="submit">Weiter <span aria-hidden="true">→</span></button>
</div>
</form>
{% endblock %}