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

+3 -2
View File
@@ -4,6 +4,7 @@ namespace App\Tests;
use App\Content\DemoContent;
use App\Content\DocumentValidator;
use App\Content\FormRepository;
use App\Content\Languages;
use App\Content\MediaLibrary;
use App\Content\PageRepository;
@@ -312,7 +313,7 @@ final class TranslationTest extends TestCase
public function testFormsSpeakTheLanguageOfThePageButSendInTheMainLanguage(): void
{
$this->languages->save(['en']);
$forms = new \App\Content\FormRepository($this->db);
$forms = new FormRepository($this->db);
$translations = ['en' => ['buttonLabel' => 'Send request', 'success' => 'Thanks!', 'fields' => [
'art' => ['label' => 'Type of enquiry', 'options' => ['Beratung' => 'Advice', 'Angebot' => 'Quote', 'Gibt es nicht' => 'x']],
'email' => ['label' => 'Email', 'help' => ''],
@@ -352,7 +353,7 @@ final class TranslationTest extends TestCase
self::assertStringNotContainsString('name="language"', $german);
$issued = time() - 10;
$body = ['page' => 'kontakt', 'block' => 'f1', 'language' => 'en', 'issued' => (string) $issued, 'issuedSignature' => hash_hmac('sha256', (string) $issued, 'test-only'), 'art' => 'Beratung', 'email' => ''];
$body = ['page' => 'kontakt', 'block' => 'f1', 'language' => 'en', 'issued' => (string) $issued, 'issuedSignature' => FormRepository::stamp('anfrage', $issued, 'test-only'), 'art' => 'Beratung', 'email' => ''];
$refused = $this->request('/formular/anfrage', 'POST', $body);
self::assertSame(422, $refused->getStatusCode());
self::assertStringContainsString('This field is required.', (string) $refused->getContent());