You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c883416
Browse filesBrowse the repository at this point in the historyBrowse files
fix(security): read Image() masks through the path allowlist, stop writeHTML() copying CSS url() and img| bullet files to the temp dir, keep the system temp dir out of the markup allowlist, check the image size probe, Annotation() attachments and setHyphenPatterns() paths against the allowlist, convert legacy img| list bullets to list-style-image; require tc-lib-pdf ^8.82.2 (v7.0.20)
Copy file name to clipboardExpand all lines: CHANGELOG.TXT
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,13 @@
1
+
7.0.20 (2026-10-24)
2
+
- Fixed Image() with a mask handle ($imgmask) reading the image and the mask outside the local path allowlist: both files are now read through the engine file helper, as for a plain Image() call.
3
+
- Fixed writeHTML() copying files referenced by CSS url() values and legacy list image bullets into the system temp directory: paths with uppercase characters were copied, without an allowlist check, to a predictable file name readable through the allowlisted temp directory. The copy is removed; the engine resolves these paths directly.
4
+
- Resources referenced by HTML, CSS and SVG markup are no longer read from the system temp directory. List the directory in K_ALLOWED_PATHS to allow it. Image(), ImageSVG() and the other API methods keep access to it.
5
+
- Image() reports an unknown size for paths outside the allowlist instead of probing the file. Annotation() file attachments and setHyphenPatterns() treat such paths as missing files.
6
+
- Fixed writeHTML() ignoring the legacy list-style-type:img|type|width|height|path list bullets: they are converted to list-style-image:url(path). The marker size follows the font size; the width and height fields are ignored.
7
+
- Requires `tecnickcom/tc-lib-pdf` ^8.82.1, which applies the path allowlist to PDF import and the host allowlist to signature timestamp requests.
8
+
9
+
*************************************************
10
+
1
11
7.0.15 (2026-10-03)
2
12
- Fixed headers and footers drawn with writeHTML() (or other flowing content) in an overridden Header() or Footer(): content placed below the automatic page break margin, such as a footer, was moved to another page. On the last page an extra page was added; on the other pages the footer was drawn at the top of the next page. The graphics state was also left unbalanced (poppler: "Restoring state when no valid states to pop").
3
13
- Headers and footers are now always drawn on their own page, over the full page width, also on pages with columns. Content that does not fit is clipped at the page edge, as in TCPDF 6.
Copy file name to clipboardExpand all lines: SECURITY.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ The table below describes structural exposure in 6.x. It is not an inventory of
41
41
| Class | CWE | Origin in TCPDF 6.x | Handling in TCPDF 7.x |
42
42
|---|---|---|---|
43
43
| Server-side request forgery |[CWE-918](https://cwe.mitre.org/data/definitions/918.html)| Images, fonts, and other resources are fetched from caller-supplied URLs through cURL and stream functions. | Remote loading is disabled by default; hosts must be listed in `K_ALLOWED_HOSTS`. |
44
-
| Path traversal and local file disclosure |[CWE-22](https://cwe.mitre.org/data/definitions/22.html), [CWE-73](https://cwe.mitre.org/data/definitions/73.html)| Filesystem paths supplied by the caller are opened directly for images, fonts, ICC profiles, and templates, and for the `Output()` file destinations. | Local reads, and the `Output()``F`/`FI`/`FD` destination, are restricted to a `realpath()` allowlist of trusted roots, widened only by `K_ALLOWED_PATHS`. The written file name is sanitized by the engine. |
44
+
| Path traversal and local file disclosure |[CWE-22](https://cwe.mitre.org/data/definitions/22.html), [CWE-73](https://cwe.mitre.org/data/definitions/73.html)| Filesystem paths supplied by the caller are opened directly for images, fonts, ICC profiles, and templates, and for the `Output()` file destinations. | Local reads, and the `Output()``F`/`FI`/`FD` destination, are restricted to a `realpath()` allowlist of trusted roots, widened only by `K_ALLOWED_PATHS`. Image masks follow the same allowlist. Resources referenced by HTML, CSS, and SVG markup use it without the system temp directory. The written file name is sanitized by the engine. |
45
45
| Unsafe stream wrappers and object injection |[CWE-502](https://cwe.mitre.org/data/definitions/502.html)| Path arguments reach PHP file APIs, so wrapper schemes such as `phar://` are reachable from caller-controlled strings. | Constrained by the same path allowlist; `setAllowLocalFiles()` no longer widens access. |
46
46
| XML external entities and entity expansion |[CWE-611](https://cwe.mitre.org/data/definitions/611.html), [CWE-776](https://cwe.mitre.org/data/definitions/776.html)| SVG input is processed by an XML parser. | SVG parsing is performed by the engine; report against `tc-lib-pdf`. |
47
47
| Uncontrolled resource consumption |[CWE-400](https://cwe.mitre.org/data/definitions/400.html), [CWE-674](https://cwe.mitre.org/data/definitions/674.html), [CWE-1333](https://cwe.mitre.org/data/definitions/1333.html)| HTML, CSS, and SVG are parsed with recursive descent and extensive regular expressions over unbounded input. | Parsing is performed by the engine; remote downloads are capped by `K_MAX_REMOTE_SIZE`. |
@@ -69,7 +69,7 @@ Until the upgrade is complete, treat every TCPDF 6.x deployment as an accepted r
69
69
TCPDF 7.x is deprecated and receives security fixes only. The mitigations above are defaults, not guarantees. While migration to `tc-lib-pdf` is pending, and in particular when rendering untrusted input:
70
70
71
71
- Leave `K_ALLOWED_HOSTS` empty unless remote resources are required, and list exact host names when they are.
72
-
- Keep `K_ALLOWED_PATHS` as narrow as the deployment allows, and lower `K_MAX_REMOTE_SIZE` to the expected asset size.
72
+
- Keep `K_ALLOWED_PATHS` as narrow as the deployment allows, and lower `K_MAX_REMOTE_SIZE` to the expected asset size. Do not list the system temp directory when rendering untrusted markup.
73
73
- Use AES encryption (`setProtection()` modes 2 or 3) instead of the legacy RC4 modes.
74
74
- Do not build embedded JavaScript, annotations, links, or form actions from unescaped user input.
75
75
- Run PDF generation in an isolated process with restricted filesystem and network permissions.
0 commit comments