fix(security): headingLevel prüfen, überschreibende Tools kennzeichnen, Meta-Tools auf lit/ beschränken
- Divi-Vollformat: headingLevel nur h1 bis h6 (ValueCleaner, StoredNodeGuard, ShortformWriter); sonst ließ sich für Konten ohne unfiltered_html ein Skript-Element erzeugen. - content-update, divi-update und wp-settings-update sind destructive, damit MCP-Clients nachfragen. - mcp-adapter/execute-ability und get-ability-info nehmen auf dem OAuth-Server nur lit/-Abilities an. - release-publish.sh übergibt den Gitea-Token per Konfigurationsdatei statt als curl-Argument. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
194fd9e183
commit
165e61d7fe
@@ -374,4 +374,13 @@ final class ContentUpdateAbilityTest extends TestCase
|
||||
unlink($file);
|
||||
$log->assertRecorded([]);
|
||||
}
|
||||
|
||||
/** Security audit 2026-11, B2: overwriting a post must not look like "only adds" to an MCP client. */
|
||||
public function testOverwritesSoItIsMarkedDestructive(): void
|
||||
{
|
||||
$annotations = $this->ability(\Mockery::mock(PostWriter::class))->annotations();
|
||||
|
||||
self::assertTrue($annotations['destructive']);
|
||||
self::assertFalse($annotations['readonly']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,4 +284,13 @@ final class WpSettingsAbilitiesTest extends TestCase
|
||||
(new WpSettingsUpdateAbility(new SettingsWhitelist(), FakeChangeLog::forbidden()))->permission([])->get_error_code()
|
||||
);
|
||||
}
|
||||
|
||||
/** Security audit 2026-11, B2: site settings (front page, permalinks, title) are overwritten. */
|
||||
public function testUpdatingSettingsIsMarkedDestructive(): void
|
||||
{
|
||||
$annotations = (new WpSettingsUpdateAbility(new SettingsWhitelist(), FakeChangeLog::forbidden()))->annotations();
|
||||
|
||||
self::assertTrue($annotations['destructive']);
|
||||
self::assertFalse($annotations['readonly']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user