pdfcraft/crates
jcl-bit bb8fcd006e
Security: refuse mailto attachments, show link hosts in punycode (follow-up to #104) (#337)
* Security: refuse email links that attach or insert a local file

Follow-up to #104. A document's mailto: link could ask the email app to
attach a file from the user's computer (Evolution, KMail and Claws Mail
honour attach=, Evolution and KMail also attachment=) or read one into
the body (Claws Mail's insert=).

document_url now refuses a mailto: address in which any word starting
with attach or insert (any case) is followed by =, wherever it stands
and after each layer of percent-decoding. It also refuses text that
some email tools decode before reading the address: RFC 2047 encoded
words, which KMail decodes across the whole address, and backslash
escapes, which xdg-email's echo decodes. The link is refused rather
than rewritten: PdfCraft doesn't change what a document asks to open,
and the email apps' parsers disagree with one another.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Security: show a link's host as the browser receives it, in punycode

Follow-up to #104. The link prompt's host now comes from
links::display_host, which reads it with url::Url: the webbrowser crate
hands the OS that crate's serialisation, and the web build's browser
parses by the same WHATWG standard. International hosts are shown in
punycode with a note, a label mixing writing systems (UTS #39 resolved
script sets) gets a red warning, numeric hosts such as 3232235777 show
as 192.168.1.1, and a host the browser would reject is refused as
malformed. The Unicode form isn't repeated in the prompt, so a
whole-script lookalike can't read as the real site.

url, idna and icu_properties become direct dependencies of
pdfcraft-engine; all three were already in the graph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Security: refuse document addresses the URL parser rejects

Follow-up to #104. egui opens links through the webbrowser crate, which
parses the address with url::Url and, when that fails, treats it as a
local file path and opens file:///<cwd>/<address> in the browser.
document_url accepted addresses that don't parse, such as
mailto://a^b/x or https://a^b/ (a forbidden host code point), so a
document could still get the browser to open a local path.

document_url now also requires url::Url to accept the address with the
same scheme, which is exactly the parse webbrowser does first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-08 16:07:25 -04:00
..
a11y Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
annot Measure: add distance, perimeter and area tools (#208) 2026-10-08 00:38:57 -04:00
automation M14: reject invalid combine page selector types (#329) 2026-10-08 15:55:42 -04:00
compare Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
content Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
cos M1: validate object-number ranges before reading cross references (#92) 2026-10-07 21:12:41 -04:00
create #190: choose DPI when creating PDFs from images (#206) 2026-10-07 23:14:22 -04:00
crypt Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
edit M7: preserve ideographic spaces in edited paragraphs (#309) 2026-10-08 13:29:15 -04:00
engine Security: refuse mailto attachments, show link hosts in punycode (follow-up to #104) (#337) 2026-10-08 16:07:25 -04:00
export Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
filters Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
fonts M14: Arabic and Hebrew file names render in the tab strip, recent files and Properties (#285) 2026-10-08 10:46:58 -04:00
forms Run set-layer-visibility actions from links and push buttons (#292) 2026-10-08 11:27:10 -04:00
geom Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
js XFA: run FormCalc scripts (#301) 2026-10-08 13:06:33 -04:00
measure Measure: add distance, perimeter and area tools (#208) 2026-10-08 00:38:57 -04:00
model Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
ocr Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
optimize Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
organize Issue #263: combine, extract and split keep the PDF/X output intent and identification (#334) 2026-10-08 16:04:03 -04:00
preflight Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
print Security: print jobs, new digital IDs and the --control file no longer write through planted links (#338) 2026-10-08 16:04:48 -04:00
redact Redact: operators split across a page's content streams are redacted whole (#153) 2026-10-07 21:12:27 -04:00
render Run set-layer-visibility actions from links and push buttons (#292) 2026-10-08 11:27:10 -04:00
sign M9: sign with the Windows certificate store (#179) (#304) 2026-10-08 13:02:52 -04:00
ui-egui Security: refuse mailto attachments, show link hosts in punycode (follow-up to #104) (#337) 2026-10-08 16:07:25 -04:00
xfa XFA: run FormCalc scripts (#301) 2026-10-08 13:06:33 -04:00
xfdf Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00