diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f03232f..5e12d11f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 4.10.1 + +### Fix: MCP commit_draft published raw bzip2 bytes into page HTML (header/footer section CSS not decompressed) + +Publishing a page through the MCP `commit_draft` flow could inject raw bzip2-compressed binary (magic `BZh9…`) into the published HTML, inside `' + . '

café — 日本語

'; + $this->assertFalse(KytePageController::hasBinaryContamination($html)); + } + + public function testDetectsEmbeddedBzip2Stream(): void + { + // The exact failure mode: a compressed stylesheet concatenated into a + // '; + $this->assertTrue(KytePageController::hasBinaryContamination($html)); + } + + public function testDetectsInvalidUtf8(): void + { + $html = '

' . chr(0xFF) . '

'; // 0xFF is never valid UTF-8 + $this->assertTrue(KytePageController::hasBinaryContamination($html)); + } + + public function testDoesNotFalsePositiveOnLiteralBZhText(): void + { + // Prose that merely contains "BZh" (no full bzip2 block magic) and is + // valid UTF-8 must publish normally. + $html = '

The BZh2 compression algorithm is great.

'; + $this->assertFalse(KytePageController::hasBinaryContamination($html)); + } + + public function testEmptyStringIsClean(): void + { + $this->assertFalse(KytePageController::hasBinaryContamination('')); + } +}