Install

Works with Drupal: ^10.3 || ^11 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 275.28 KB
MD5: defe8e7965fdeca9f00adfb8edd9a482
SHA-1: 11ee7acd266167e9f7bbc586c0bd756a51a56e7f
SHA-256: dfa21d13f05641701dc7d8004f6bc546aedcd6d39ef893f48cdc329afdf747b6
Download zip 378.61 KB
MD5: e0a4ca10ff6c0620cfd2b2c621b62100
SHA-1: b75c9e71015a5806ae8d398db2c3dba04301e79e
SHA-256: e7bf4e3e45c865db933c957d42ea9b06fd161b194168b4f582d69601dc8ca5bf

Release notes

Upgrading is recommended for all sites

This is the largest security release Typdf has had. It combines an audit of every outbound call the module makes with six adversarial re-audit cycles, where each cycle re-examined the previous cycle's fixes instead of moving on. That process repeatedly found fixes that had closed the obvious code path and missed a sibling one.

Three of the issues below are things a 1.2.0-alpha5 site is running right now. Sites using the Views PDF export, the webform submodule, or Universe-scaffolded templates should read the relevant entries — several of those features did not behave as documented.

Security

  • The escaper could be undone after it ran. Source normalization was applied to the fully assembled output after escaping, and it decoded HTML entities. Named entities decode straight back into the characters the escaper removes, so text supplied through content could emerge from the compile phase as live Typst directives. This was reachable anonymously through the webform submodule. Normalization now runs only on author-written template source.
  • Content could make the site issue arbitrary outbound HTTP requests. The compile phase downloaded any remote URL it matched in the rendered source — including URLs sitting inside an image alt attribute or a link title, which Typst would never execute. Every render triggered the request. The compile phase no longer downloads; it logs a warning pointing at the typst_file filter, which routes through the SSRF-safe fetcher.
  • Private PDF downloads were granted by the wrong module. Download denials returned a value Drupal reads as "no opinion" rather than "deny", and the media-library integration published a media entity for those same files — so core granted access on the media permission instead. Denials are now explicit, scoped so they cannot veto another module's files, and private-scheme PDFs are no longer published as media.
  • Two users exporting the same view could receive each other's PDF. Per-user isolation for Views exports applied only on the private file scheme. The default is public, and the access token did not include the user id — so on a stock install two users exporting the same view produced identical paths and identical tokens, and the compile lock handed one of them the other's rendered document. The user id is now part of the token on every scheme.
  • A filtered Views export returned the entire result set. In batch mode the re-executed view never had the user's exposed filters applied, while the filename advertised that it was the filtered export. A user who narrowed an export to their own records received every row the view could produce.
  • Anonymous visitors shared a single export folder. Because anonymous is one shared user id, the per-user grant gave every anonymous visitor access to every other anonymous visitor's export. Restricted to authenticated owners, in both places the pattern was used.
  • The SSRF protections could be silently disabled. The cURL extension was assumed but never declared. Without it, the HTTP client falls back to a handler that discards cURL options — disarming both the DNS-rebinding pin and the download size cap. The extension is now declared, surfaced in the status report, and the fetcher refuses to fetch rather than fetching unprotected.
  • A colour-syntax repair could break out of a Typst string literal. A repair that rewrote single-quoted hex colours ran over assembled output, so a link title or image alt containing that pattern injected bare quotes into the surrounding literal. It now runs only on the author's own source, before any content is interpolated.
  • Resolved file paths were written into Typst string literals unescaped, while the adjacent alt text was escaped. Drupal ships filename sanitization disabled by default, so an uploaded filename can carry a quote character. Escaped at both sites.

Fixed

  • The Views table filter returned nothing, in every configuration, since it shipped. It called an execute method that is empty in the base display class, so the result set was never populated and the table silently vanished from the PDF. A zero-row result now logs a notice, because "returned empty" being indistinguishable from "no rows" is what hid this.
  • Universe-scaffolded templates could not resolve bundled assets outside the admin preview. The lookup used a route parameter that only the admin routes define, so assets resolved correctly in preview and silently returned an unusable path on the public route, in the queue worker, under drush and in webform.
  • Imported package assets were stored in the PDF cache and deleted on every template save. These files are not regenerable, so a routine admin action destroyed them. They now live in a separate directory, with an update hook that migrates existing sites.
  • Concurrent Views exports overwrote each other. Every set of arguments resolved to one destination, so simultaneous exports either clobbered each other or returned the other export's document behind a valid token. Destinations now include a variant key derived from the view's arguments and exposed input.
  • Multi-line image calls emitted a bare URL and failed the whole document. The remote-asset pattern required the closing parenthesis on the same line, so the idiomatic multi-line form was never rewritten. URLs containing a Twig expression were also mishandled.
  • File-based templates behaved differently from inline ones. A .twig template containing a literal remote URL failed where an inline template worked. Both template types, and every render site — templates, frame components, components, Views exports in both modes, and webform custom Twig — now share one preparation step. Twig errors in file-based templates name the file again instead of a generated hash.
  • Pasted-source repairs ran on saved templates. Entity decoding, smart-quote normalization and non-breaking-space stripping exist to clean up source pasted into the admin test form. On the render path they turned typographic quotes into straight ones, producing a Twig syntax error on every render.
  • A cached empty theme registry could white-screen the site. The Universe theme hook wrapper fell back to an empty array, which the registry caches.
  • Frame components resolved assets against the wrong template after a nested render, because the active template was cleared rather than restored.
  • Deleted templates kept producing download links. The lookup memo was cleared on update only — not on insert or delete.
  • Anonymous private-scheme exports compiled fully and then failed at download. They are refused up front now.
  • Deprecated APIs replaced — the config entity annotation, the last procedural theme hook, the webform queue worker annotation, and a dependency ceiling that conflicted with the advertised core constraint. The Drupal 10.3 floor is unchanged.
  • A slow-drip host could pin a PHP worker indefinitely; the compiler error page leaked filesystem paths to every visitor; a malformed registry feed took down the Universe catalog; an empty catalog was cached for a full day; a failed scaffold could destroy a working template; and archive extraction did not check entry types.

Performance

  • Remote images are fetched once, not once per render. They previously had no cache and no deduplication — not even for a second occurrence of the same URL within one document. Fetches are now cached on disk, and entries past their freshness window are revalidated with a conditional request, so an unchanged asset costs a small response instead of its full size.
  • Admin listings no longer re-hydrate every template on every row.

Under the hood

  • The Twig extension has been split: asset resolution and HTML-to-Typst conversion now live in dedicated services. Every registered filter and function name is unchanged, so templates are unaffected.
  • The subprocess environment is shared between the compiler and the scaffolder so the two cannot drift, and the asset-function list and remote-URL pattern each exist in exactly one place rather than four and three.
  • The webform submodule is now covered by static analysis in continuous integration.

Verification

260 tests and 1,491 assertions, zero failures, both locally and on Drupal.org CI. Static analysis at level 8 reports no errors, and coding standards are clean. The test suite grew from 245 tests during this release, with new coverage pinning the Views export grant and denial paths, the render-path behaviour of asset-URL rewriting, and the subprocess environment — the last verified by running a real child process and asserting a canary variable is absent from it.

The full, detailed list of changes is in CHANGELOG.md.

Created by: mayankguptadotcom
Created on: 27 Jul 2026 at 00:25 UTC
Last updated: 27 Jul 2026 at 00:25 UTC
Bug fixes

Other releases