Skip to content

Turn any technical book PDF into a Claude Code skill — ready to study, reference, and use while you work.

fix(security): strip word joiners from extraction (#85)

Kushida9e75ad15df58
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d383933..cd53e99 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
before a generated skill is accepted or published. Findings identify only the
rule and file/line location and never echo attacker-controlled text (#73).
- **Invisible-Unicode extraction hardening** — every parser result now removes
- zero-width U+200B/U+200C/U+200D/U+FEFF characters and the Unicode tag block
+ zero-width U+200B/U+200C/U+200D/U+2060/U+FEFF characters and the Unicode tag block
U+E0000-U+E007F before metrics or `full_text.txt` are produced, reports the
removal count, and rejects sources containing no visible content after the scrub.
- **DOCX XXE / Billion Laughs hardening** — the DOCX extractor now scans the
diff --git a/book_to_skill/sanitize.py b/book_to_skill/sanitize.py
index e16ae63..d85ffb0 100644
--- a/book_to_skill/sanitize.py
+++ b/book_to_skill/sanitize.py
@@ -1,7 +1,7 @@
from __future__ import annotations
-_ZERO_WIDTH_CODEPOINTS = frozenset({0x200B, 0x200C, 0x200D, 0xFEFF})
+_ZERO_WIDTH_CODEPOINTS = frozenset({0x200B, 0x200C, 0x200D, 0x2060, 0xFEFF})
_TAG_BLOCK_START = 0xE0000
_TAG_BLOCK_END = 0xE007F
diff --git a/tests/test_sanitize_extracted_text.py b/tests/test_sanitize_extracted_text.py
index 77a016a..564cdbd 100644
--- a/tests/test_sanitize_extracted_text.py
+++ b/tests/test_sanitize_extracted_text.py
@@ -13,6 +13,7 @@ INVISIBLE_CODEPOINTS = (
"\u200b"
"\u200c"
"\u200d"
+ "\u2060"
"\ufeff"
"\U000e0000"
"\U000e0069"