Skip to content

Commit ea258d4

Browse files
committed
Disable PHAR protocol
1 parent ed27e28 commit ea258d4

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

CHANGELOG.TXT

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
6.9.0 (2025-04-03)
2-
- Fixed Path Traversal security vulnerability reported by Positive Technologies.
1+
6.9.2 (2025-04-18)
2+
- Fixed "Deserialization of untrusted data" security vulnerability reported by Positive Technologies.
3+
4+
6.9.1 (2025-04-03)
5+
- Fixed "Path Traversal" security vulnerability reported by Positive Technologies.
36

47
6.9.0 (2025-03-30)
58
- Added PHP 8.4 testing.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.9.1
1+
6.9.2

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"barcodes"
1313
],
1414
"homepage": "http://www.tcpdf.org/",
15-
"version": "6.9.1",
15+
"version": "6.9.2",
1616
"license": "LGPL-3.0-or-later",
1717
"authors": [
1818
{

include/tcpdf_static.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TCPDF_STATIC {
5555
* Current TCPDF version.
5656
* @private static
5757
*/
58-
private static $tcpdf_version = '6.9.1';
58+
private static $tcpdf_version = '6.9.2';
5959

6060
/**
6161
* String alias for total number of pages.

tcpdf.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
//============================================================+
33
// File name : tcpdf.php
4-
// Version : 6.9.1
4+
// Version : 6.9.2
55
// Begin : 2002-08-03
6-
// Last Update : 2025-04-03
6+
// Last Update : 2025-04-18
77
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
88
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
99
// -------------------------------------------------------------------
@@ -104,7 +104,7 @@
104104
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
105105
* @package com.tecnick.tcpdf
106106
* @author Nicola Asuni
107-
* @version 6.9.1
107+
* @version 6.9.2
108108
*/
109109

110110
// TCPDF configuration
@@ -128,7 +128,7 @@
128128
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
129129
* @package com.tecnick.tcpdf
130130
* @brief PHP class for generating PDF documents without requiring external extensions.
131-
* @version 6.9.1
131+
* @version 6.9.2
132132
* @author Nicola Asuni - [email protected]
133133
* @IgnoreAnnotation("protected")
134134
* @IgnoreAnnotation("public")
@@ -7865,7 +7865,7 @@ public function _destroy($destroyall=false, $preserve_objcopy=false) {
78657865
}
78667866
if (isset($this->imagekeys)) {
78677867
foreach($this->imagekeys as $file) {
7868-
if (strpos($file, K_PATH_CACHE) === 0 && TCPDF_STATIC::file_exists($file)) {
7868+
if (strpos($file, K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_') === 0 && TCPDF_STATIC::file_exists($file)) {
78697869
@unlink($file);
78707870
}
78717871
}

tcpdf_autoconfig.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// File name : tcpdf_autoconfig.php
44
// Version : 1.1.1
55
// Begin : 2013-05-16
6-
// Last Update : 2014-12-18
6+
// Last Update : 2025-04-18
77
// Authors : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - [email protected]
88
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
99
// -------------------------------------------------------------------
10-
// Copyright (C) 2011-2014 Nicola Asuni - Tecnick.com LTD
10+
// Copyright (C) 2011-2025 Nicola Asuni - Tecnick.com LTD
1111
//
1212
// This file is part of TCPDF software library.
1313
//
@@ -37,9 +37,14 @@
3737
* @file
3838
* Try to automatically configure some TCPDF constants if not defined.
3939
* @package com.tecnick.tcpdf
40-
* @version 1.1.1
40+
* @version 1.2.1
4141
*/
4242

43+
// Disable phar stream wrapper to prevent deserialization vulnerability.
44+
if (in_array('phar', stream_get_wrappers(), true)) {
45+
stream_wrapper_unregister('phar');
46+
}
47+
4348
// DOCUMENT_ROOT fix for IIS Webserver
4449
if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
4550
if(isset($_SERVER['SCRIPT_FILENAME'])) {

0 commit comments

Comments
 (0)