Commit Graph
2228 Commits
Author SHA1 Message Date
Dylan M. Taylor 5a457dda6a Merge pull request #1341 from storytold/sec/pdf-no-rc4-create
craft-pdf: refuse to create RC4 encryption without an explicit legacy call
2026-11-14 14:43:13 -05:00
Dylan M. Taylor 9d9cd81013 Merge pull request #1344 from storytold/codex/pdfx1a-review-hardening
fix(prepress): address PDF/X review findings
2026-11-14 14:41:49 -05:00
Dylan M. Taylor cbf6ea8584 Merge pull request #1335 from storytold/codex/xml-dtd-review-hardening
fix(xml): address DTD validator review findings
2026-11-14 14:41:44 -05:00
Dylan M. Taylor 3a8797a7f4 Merge pull request #1345 from storytold/sec/dwg-fail-closed
craft-dwg: refuse to convert without a worker instead of running acadrust in-process
2026-11-14 14:22:47 -05:00
Dylan M. Taylor c6221e42ff Merge remote-tracking branch 'storytold/main' into sec/pdf-no-rc4-create
# Conflicts:
#	crates/pdf/src/crypt/tests.rs
2026-11-14 13:47:06 -05:00
Dylan M. Taylor 75a654f4f8 craft-pdf, craft-pkcs7: compare password-derived verifiers without an early exit (#1340)
The PKCS#12 MAC and the PDF security handler's /U, R5/R6 and file-key
checks used plain equality, which stops at the first differing byte and
narrows a guess. Both crates now use a length-checked comparison that
folds every byte (the helper craft-offcrypto already used).
2026-11-14 13:45:48 -05:00
Dylan M. Taylor c86ea6802a craft-ora, craft-kra: charge every entry to one document-wide total (#1339)
An archive could hold many individually allowed members whose combined
decompression was unbounded, because both readers passed
max_total_bytes: u64::MAX to craft-zip. Each now passes MAX_TOTAL (4 GiB)
and every entry read is charged to it.

craft-fig's declared-entry cap drops from 1,000,000 to 100,000 to match the
other ZIP readers; its images were already bounded by Limits::max_image_total.
2026-11-14 13:45:31 -05:00
Dylan M. Taylor 74509ff055 Merge pull request #1351 from storytold/fix/reland-word6-doc-reader
craft-doc-binary: re-land Word 6.0/95 reader on main
2026-11-14 13:28:47 -05:00
Dylan M. Taylor 3032d970a6 craft-doc-binary: Word 6.0/95 text in an East Asian code page is refused, not lost
The review of wordcraft#6345 found that text in code page 932, 936, 949 or 950
was read a byte at a time, each byte above ASCII becoming U+FFFD, and the file
opened with its characters gone. Such a file is refused as every Word 6.0/95
file was before, until the piece walk decodes byte pairs. The test that
asserted the replacement characters is replaced by one that asserts the
refusal and that the same text in a Western font still opens.

The module comment on the Word 6 stylesheet header now matches the reader (a
u16 header size, then the header), as the other review comment asked.

(cherry picked from commit 92f8dd24d1)
2026-11-14 13:27:16 -05:00
kiwi4boy 387eab39f4 .doc import: Word 6.0/95 files open with their text, formatting, tables and styles
Ported from storytold/wordcraft#6317, #6335 and #6345 (one series): Word 6.0
and Word 95 files are read instead of refused: text in its code page (by font
charset, language and style), character and paragraph formatting, tables and
paragraph styles. Paths follow craft-doc-binary (craft-wordmodel,
craft-codepage, craft-cfb).

(cherry picked from commit aa220afc77)
2026-11-14 13:27:16 -05:00
Dylan M. Taylor 81e1dcec5a craft-dwg: refuse to convert without a worker instead of running acadrust here
The bridge fell back to decoding in the calling process whenever no worker
was configured, or the worker failed to start, which is exactly the case the
audit called out: acadrust allocates from sizes a hostile file declares, and
an allocation failure or stack overflow ends the process. Conversions are
now refused without a worker, a worker that cannot start is an error, and
allow_in_process() is the explicit opt-in for input known to be trusted.
2026-11-14 13:16:57 -05:00
Dylan M. Taylor d74e60b2d5 craft-pdf: refuse to create RC4 encryption without an explicit legacy call
The create() API exposed RC4-40 and RC4-128 behind a doc comment, so an app
could write files whose encryption protects nothing. create() now returns
Unsupported for both schemes; create_legacy() and
Document::set_encryption_legacy() are the explicit ways to write a file that
must stay readable by an old reader. Tests and the encrypt example, which
read and write every algorithm, use the legacy entry points.
2026-11-14 12:57:23 -05:00
Dylan M. Taylor b6b222afb0 fix(prepress): address PDF/X review findings 2026-11-14 17:45:53 +00:00
Dylan M. Taylor f5720d8f69 refactor(xml): share bounded tree-node validation 2026-11-14 17:36:14 +00:00
Dylan M. Taylor bac1a19d93 fix(xml): harden DTD validation bounds and parsing 2026-11-14 17:10:03 +00:00
Dylan M. Taylor 7ad4765ee5 Merge pull request #1325 from storytold/codex/docx-level-presence
docx: retain explicitly defined numbering levels
2026-11-14 11:48:48 -05:00
Dylan M. Taylor c9bf4a34a6 Merge pull request #1242 from alehel/claude/issue-1230-c0c8eb
craft-audio: write AAC, ALAC, MP3, AC-3 and E-AC-3 files
2026-11-14 11:46:38 -05:00
Dylan M. Taylor 874c94f2b1 Merge pull request #1311 from pakiat/fix/field-results-complex-script
craft-docx: a field's Thai result takes the complex-script formatting only where Word does
2026-11-14 11:43:58 -05:00
Dylan M. Taylor 9053f5389f Merge pull request #1225 from Bra1nZ/fix/7230-legacy-v3-driver-zero-media-side
fix(print): trust one side of a legacy V3 driver's paper metric
2026-11-14 11:43:38 -05:00
Dylan M. Taylor d542e68c5b Merge pull request #1305 from TrevorBrown-dev/fix/web-jpeg-oversized-xmp
image-codecs: the web JPEG encoder trims or leaves out an XMP packet past one segment
2026-11-14 11:40:56 -05:00
Dylan M. Taylor 1f96d6b6bb Merge pull request #1278 from naxvog/docx/cell-margins-without-table-style
craft-docx: a file with no default table style gives its tables no cell margins
2026-11-14 11:36:33 -05:00
Dylan M. Taylor 689bd18cb6 Merge pull request #147 from midasmatterhorn/fix/r4-print-shrink-zero-scale
print: shrink-to-fit refuses a sheet the written matrix cannot represent
2026-11-14 11:34:07 -05:00
Dylan M. Taylor 29fb8f8e86 Merge pull request #1216 from dotCooCoo/feat/craft-texture-planes
craft-texture: add bounded float image planes and texture sampling
2026-11-14 11:28:44 -05:00
Dylan M. Taylor 15b013b305 Merge pull request #637 from dotCooCoo/fix/linesweeper-sweep-doc-left-scan
linesweeper: the left intersection scan in docs/sweep.typ compares with alpha^(i+1)
2026-11-14 11:19:24 -05:00
Dylan M. Taylor 553d10d5a4 Merge pull request #1221 from dotCooCoo/fix/hdr-isize-bound
craft-hdr: refuse buffers past isize::MAX bytes when limits are raised
2026-11-14 11:17:00 -05:00
Dylan M. Taylor 19a4929a80 Ignore reader provenance in numbering equality 2026-11-14 15:38:05 +00:00
Dylan M. Taylor a5ac3aa05c Merge pull request #1322 from storytold/codex/craft-xml-dtd
prepress: share PDF/X-1a finalization and checks (official replacement)
2026-11-14 10:14:26 -05:00
Dylan M. Taylor 5c8e1b0d82 docx: retain explicit numbering level presence 2026-11-14 15:10:43 +00:00
Dylan M. Taylor 53cc3c0f1a Merge pull request #1315 from storytold/sonar/s7688-bash-conditionals
scripts: test with [[ in fetch-opus-vectors.sh (SonarCloud S7688)
2026-11-14 10:00:27 -05:00
Dylan M. Taylor a207d20700 Merge pull request #1314 from AlexChambers/craft-raw/nikon-z6-z7-distortion
craft-raw: Nikon Z 6 and Z 7 in-file distortion; modes 1 and 3 only
2026-11-14 09:54:06 -05:00
Dylan M. Taylor bfea7d9800 Merge pull request #1317 from storytold/codex/jpeg-cmyk-app-compat-official
Preserve unmarked CMYK JPEG sample polarity
2026-11-14 09:38:51 -05:00
Naxvog 5f67d91eee craft-docx: a file with no default table style gives its tables no cell margins
Port of storytold/wordcraft#3821, whose reader code moved here with storytold/wordcraft#6603. Word's 0.08" cell margin comes from the Normal Table default table style; without a default table style a table that sets no margins (and whose style sets none) has zero margins. The zeros are kept as the table's own, also for the old properties of a tblPrChange, so they survive saving. w:default="on" now marks a default style too.
2026-11-14 15:27:22 +01:00
Dylan M. Taylor cebc847ba8 Merge pull request #1320 from storytold/codex/docx-normal-default-official
Respect default Normal styles in DOCX
2026-11-14 09:21:31 -05:00
Zinadin Zidan 45a8e16669 craft-midi: say when a lenient read left part of a file out at a limit (#1308)
read_smf_lenient keeps what comes before MAX_EVENTS events or MAX_TRACKS
tracks and only says so in a warning. Those warnings are words, and at
most MAX_WARNINGS of them are kept: when earlier damage has filled them,
nothing tells the caller that the file was cut.

LenientRead gets over_limit, set whenever either limit left something
out, full warnings or not. A caller that refuses over-limit files, as
read_smf does, can now do so after a lenient read. LenientRead is
non_exhaustive, so the new field breaks no caller.
2026-11-14 15:20:22 +01:00
midasmatterhorn 08c206f4ae Merge remote-tracking branch 'upstream/main' into r4-print-shrink-147 2026-11-14 16:55:58 +03:00
Dylan M. Taylor 8ef708255e test(jpeg): cover unmarked CMYK craft decoding 2026-11-14 13:39:46 +00:00
Trevor Brown 25d56bb49c Merge upstream/main into fix/web-jpeg-oversized-xmp 2026-11-14 08:32:33 -05:00
Dylan M. Taylor 8097ede0ff Resolve DOCX migration conflict with current main 2026-11-14 13:29:23 +00:00
Dylan M. Taylor 8f3247882d Fix unmarked CMYK polarity on craft JPEG path 2026-11-14 13:26:52 +00:00
Dylan M. Taylor 6d19bb44f3 fix(docx): preserve Normal inference compatibility 2026-11-14 13:25:25 +00:00
Dylan M. Taylor 6beefd7e95 fix(wordmodel): mark Normal as default in new documents 2026-11-14 13:25:25 +00:00
Dylan M. Taylor 31f4185fa5 test(docx): preserve explicit Normal-off serialization 2026-11-14 13:25:25 +00:00
Dylan M. Taylor 90d20fd39f fix(docx): keep default Normal for fresh documents 2026-11-14 13:25:25 +00:00
Dylan M. Taylor 00fdde1f06 docx: retain explicit nondefault Normal on write 2026-11-14 13:25:25 +00:00
Dylan M. Taylor a94c1a386a Respect on-valued default paragraph styles 2026-11-14 13:25:25 +00:00
Dylan M. Taylor 15740f3083 fix(docx): mark declared Normal as the default 2026-11-14 13:25:13 +00:00
Dylan M. Taylor c2a69bbdc6 Preserve unmarked CMYK JPEG samples 2026-11-14 13:23:47 +00:00
Dylan M. Taylor 3400dbc4d7 scripts: test with [[ in fetch-opus-vectors.sh
SonarCloud S7688 counts the POSIX [ tests in the Opus vector fetcher. The
script already needs bash for arrays and ${!ranges[@]}, so the tests use
[[ ... ]], which neither word-splits nor globs its operands.
2026-11-14 08:19:09 -05:00
Dylan M. Taylor d15bf1f35b Merge pull request #1288 from despotak/fix/12473-jpeg-past-2-30
image-codecs: jpeg_info, a JPEG's frame and held coefficients from its markers
2026-11-14 07:42:05 -05:00
Dylan M. Taylor 94777dcf7f Merge pull request #1298 from dylanmtaylor/codex/jpeg-baseline-encoder
jpeg: add optimized baseline encoder
2026-11-14 07:30:54 -05:00