From 2f4863be910a200d704a23dec421063e604dd565 Mon Sep 17 00:00:00 2001 From: TehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com> Date: Sun, 25 Oct 2026 23:45:56 +0100 Subject: [PATCH 01/16] Accept a leading dot in disallowed_extensions entries --- index.php | 4 ++-- lib/config.original.php | 2 +- lib/functions.php | 31 ++++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 402e784..4384867 100644 --- a/index.php +++ b/index.php @@ -137,7 +137,7 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) { echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . $cfg['maximal_upload_size'] . " MB."; } ?>'); control_selected_file_extension(, '.')"/>

@@ -187,7 +187,7 @@ if ($cfg['maximal_upload_size'] >= 1024) { echo '

'; } if (!empty($cfg['disallowed_extensions'])) { - echo '

' . t('EXT_LIM') . ' ' . implode(', ', $cfg['disallowed_extensions']) . '

'; + echo '

' . t('EXT_LIM') . ' ' . implode(', ', jirafeau_disallowed_extensions($cfg)) . '

'; } ?> diff --git a/lib/config.original.php b/lib/config.original.php index e140067..54be072 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -172,7 +172,7 @@ $cfg['maximal_upload_size'] = 0; /* Forbid specific file extensions from being uploaded. * Leave empty to allow every extension. - * Extensions are matched case-insensitively and without the leading dot. + * Extensions are matched case-insensitively; a leading dot is optional. * Compound extensions such as 'tar.gz' are supported. Note that 'gz' * also covers 'tar.gz', while 'tar.gz' leaves plain '.gz' files allowed. * $cfg['disallowed_extensions'] = array('exe', 'bat', 'sh', 'php', 'tar.gz'); diff --git a/lib/functions.php b/lib/functions.php index 3e9155f..7f03b5f 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -229,6 +229,30 @@ function jirafeau_ini_to_bytes($value) return $bytes; } +/** + * returns the configured disallowed extensions, lower-cased and without + * a leading dot + * @param $cfg jirafeau config + * @returns array of normalized extensions + */ +function jirafeau_disallowed_extensions($cfg) +{ + if (empty($cfg['disallowed_extensions'])) { + return array(); + } + + // tolerate a leading dot in the config, e.g. '.jpg' instead of 'jpg' + $extensions = array(); + foreach ($cfg['disallowed_extensions'] as $extension) { + $extension = ltrim(strtolower(trim($extension)), '.'); + if ($extension !== '') { + $extensions[] = $extension; + } + } + + return $extensions; +} + /** * checks if a file name's extension is allowed to be uploaded * @param $cfg jirafeau config @@ -237,7 +261,8 @@ function jirafeau_ini_to_bytes($value) */ function jirafeau_is_extension_allowed($cfg, $filename) { - if (empty($cfg['disallowed_extensions'])) { + $extensions = jirafeau_disallowed_extensions($cfg); + if (empty($extensions)) { return true; } @@ -246,8 +271,8 @@ function jirafeau_is_extension_allowed($cfg, $filename) // suffix match so that compound extensions such as 'tar.gz' work too; // 'gz' still covers 'archive.tar.gz' - foreach ($cfg['disallowed_extensions'] as $extension) { - $suffix = '.' . strtolower($extension); + foreach ($extensions as $extension) { + $suffix = '.' . $extension; if (substr($filename, -strlen($suffix)) === $suffix) { return false; } -- 2.43.0 From 1140df55fd1c1eed68a3ed65eb4752890994d8e1 Mon Sep 17 00:00:00 2001 From: TehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com> Date: Sun, 25 Oct 2026 23:48:51 +0100 Subject: [PATCH 02/16] Show the disallowed extensions list only when the selected file matches --- index.php | 3 ++- lib/functions.js.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 4384867..454bc52 100644 --- a/index.php +++ b/index.php @@ -187,7 +187,8 @@ if ($cfg['maximal_upload_size'] >= 1024) { echo '

'; } if (!empty($cfg['disallowed_extensions'])) { - echo '

' . t('EXT_LIM') . ' ' . implode(', ', jirafeau_disallowed_extensions($cfg)) . '

'; + // only shown when the selected file matches, see control_selected_file_extension() + echo ''; } ?> diff --git a/lib/functions.js.php b/lib/functions.js.php index 65febf1..355cbe7 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -356,6 +356,8 @@ function control_selected_file_size(max_size, error_str) // just warns the user before they submit a doomed upload. function control_selected_file_extension(disallowed_extensions, error_str) { + if (disallowed_extensions.length === 0) + return; f_name = document.getElementById('file_select').files[0].name.replace(/[\s.]+$/, '').toLowerCase(); // suffix match so that compound extensions such as 'tar.gz' work too if (disallowed_extensions.some(function (ext) { return f_name.endsWith('.' + ext); })) @@ -369,7 +371,10 @@ function control_selected_file_extension(disallowed_extensions, error_str) // keep the button visible but disabled so the user sees it is forbidden document.getElementById('send').style.display = 'block'; document.getElementById('send').disabled = true; + document.getElementById('disallowed_extensions').style.display = 'block'; } + else + document.getElementById('disallowed_extensions').style.display = 'none'; } function XHRErrorHandler(e) -- 2.43.0 From 03ed5327384d8fb6f25fc60f6f4e249458f15c8a Mon Sep 17 00:00:00 2001 From: TehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com> Date: Mon, 26 Oct 2026 00:19:25 +0100 Subject: [PATCH 03/16] Use braces on every if in control_selected_file_extension --- lib/functions.js.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/functions.js.php b/lib/functions.js.php index 355cbe7..c468d18 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -357,7 +357,9 @@ function control_selected_file_size(max_size, error_str) function control_selected_file_extension(disallowed_extensions, error_str) { if (disallowed_extensions.length === 0) + { return; + } f_name = document.getElementById('file_select').files[0].name.replace(/[\s.]+$/, '').toLowerCase(); // suffix match so that compound extensions such as 'tar.gz' work too if (disallowed_extensions.some(function (ext) { return f_name.endsWith('.' + ext); })) @@ -365,16 +367,22 @@ function control_selected_file_extension(disallowed_extensions, error_str) // control_selected_file_size runs first: keep its error, if any, and add ours var error_pop = document.getElementById('error_pop'); if (error_pop.style.display === 'none') + { pop_failure(error_str); + } else + { error_pop.innerHTML += '
' + error_str; + } // keep the button visible but disabled so the user sees it is forbidden document.getElementById('send').style.display = 'block'; document.getElementById('send').disabled = true; document.getElementById('disallowed_extensions').style.display = 'block'; } else + { document.getElementById('disallowed_extensions').style.display = 'none'; + } } function XHRErrorHandler(e) -- 2.43.0 From 4962046265a4a0328a07b12a2a13918c6c44e2d8 Mon Sep 17 00:00:00 2001 From: Blackeye <> Date: Wed, 28 Oct 2026 16:45:13 +0100 Subject: [PATCH 04/16] fix for issue 53 - fixed hash compare in script.php --- script.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.php b/script.php index bcca4f7..3fcb859 100644 --- a/script.php +++ b/script.php @@ -185,7 +185,8 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) echo 'Error 9'; exit; } - if (strlen($link['key']) > 0 && hash('sha256', $key) != $link['key']) { + $file_hash = "[SHA256]" . hash('sha256', $key); + if (strlen($link['key']) > 0 && $file_hash != $link['key']) { sleep(2); echo 'Error 10'; exit; -- 2.43.0 From 28f463b24538dfba26dd186bd9f63144f5f8ca21 Mon Sep 17 00:00:00 2001 From: Blackeye <> Date: Wed, 28 Oct 2026 16:49:53 +0100 Subject: [PATCH 05/16] added comment for explanation why the hash needs a prefix --- script.php | 1 + 1 file changed, 1 insertion(+) diff --git a/script.php b/script.php index 3fcb859..da3785f 100644 --- a/script.php +++ b/script.php @@ -185,6 +185,7 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) echo 'Error 9'; exit; } + // info: link contains the used hash as prefix $file_hash = "[SHA256]" . hash('sha256', $key); if (strlen($link['key']) > 0 && $file_hash != $link['key']) { sleep(2); -- 2.43.0 From bb3992d7f138eee6ec77b17c5027abec8ca474d6 Mon Sep 17 00:00:00 2001 From: Blackeye <> Date: Wed, 28 Oct 2026 17:17:28 +0100 Subject: [PATCH 06/16] aligned to fix_issue_53 --- f.php | 8 ++++++-- script.php | 9 ++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/f.php b/f.php index 9454540..13fe280 100644 --- a/f.php +++ b/f.php @@ -171,9 +171,13 @@ if (!empty($link['key'])) { require(JIRAFEAU_ROOT.'lib/template/footer.php'); exit; } else { - if (strpos($link['key'], '[SHA256]') == 0 && hash_equals(substr($link['key'], 8), hash('sha256', $_POST['key']))) { + $sha_hash_compare = strpos($link['key'], '[SHA256]') === 0 && hash_equals(substr($link['key'], 8), hash('sha256', $_POST['key'])); + // legacy md5 compare - before prefixing + $md5_legacy_hash_compare = hash_equals($link['key'], md5($_POST['key'])); + + if ( $sha_hash_compare ) { $password_challenged = true; - } elseif (hash_equals($link['key'], md5($_POST['key']))) { + } elseif ( $md5_legacy_hash_compare ) { $password_challenged = true; } else { sleep(2); diff --git a/script.php b/script.php index da3785f..b0cc0ac 100644 --- a/script.php +++ b/script.php @@ -185,9 +185,12 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) echo 'Error 9'; exit; } - // info: link contains the used hash as prefix - $file_hash = "[SHA256]" . hash('sha256', $key); - if (strlen($link['key']) > 0 && $file_hash != $link['key']) { + // sha hash compare + $sha_hash_compare = (strpos($link['key'], '[SHA256]') === 0 && hash_equals(substr($link['key'], 8), hash('sha256', $key))); + // legacy md5 compare - before prefixing + $md5_hash_compare = hash_equals($link['key'], md5($key)); + + if (strlen($link['key']) > 0 && !$sha_hash_compare && !$md5_hash_compare ) { sleep(2); echo 'Error 10'; exit; -- 2.43.0 From c3d4265642e86ce44576036a2c3ae233d42fba63 Mon Sep 17 00:00:00 2001 From: Blackeye <> Date: Sat, 31 Oct 2026 13:45:41 +0100 Subject: [PATCH 07/16] aligned naming convention for md5_legacy_hash_compare so it is the same in both files (script, f) --- script.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.php b/script.php index b0cc0ac..c4fbba5 100644 --- a/script.php +++ b/script.php @@ -188,9 +188,9 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) // sha hash compare $sha_hash_compare = (strpos($link['key'], '[SHA256]') === 0 && hash_equals(substr($link['key'], 8), hash('sha256', $key))); // legacy md5 compare - before prefixing - $md5_hash_compare = hash_equals($link['key'], md5($key)); + $md5_legacy_hash_compare = hash_equals($link['key'], md5($key)); - if (strlen($link['key']) > 0 && !$sha_hash_compare && !$md5_hash_compare ) { + if (strlen($link['key']) > 0 && !$sha_hash_compare && !$md5_legacy_hash_compare ) { sleep(2); echo 'Error 10'; exit; -- 2.43.0 From 4b26c67e408860c8ed61f8cf5bf3bd34a0f0ca24 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Mon, 2 Nov 2026 20:24:34 +0100 Subject: [PATCH 08/16] Allow to set disallowed file extensions in Docker using an env variable --- docker/README.md | 1 + docker/docker_config.php | 1 + 2 files changed, 2 insertions(+) diff --git a/docker/README.md b/docker/README.md index d170d70..619772a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -101,6 +101,7 @@ Available options: - `UPLOAD_IP`: set one or more ip allowed to upload files (separated by comma). - `UPLOAD_IP_NO_PASSWORD`: set one or more ip allowed to upload files without password (separated by comma). - `PROXY_IP`: set one or more proxy ip (separated by comma). +- `DISALLOWED_EXTENSIONS`: forbid specific file extensions from being uploaded (separated by comma). - `STORE_UPLOADER_IP`: set to 1 or 0 to enable or disable keeping sender's IP with the _link_ file. - `DOWNLOAD_PASSWORD_REQUIREMENT`: set to 'optional' (default), 'required' or 'generated' to make a password for downloading optional, required or generated - `DOWNLOAD_PASSWORD_GEN_LEN`: set length of generated download passwords diff --git a/docker/docker_config.php b/docker/docker_config.php index d814a8e..c589a13 100644 --- a/docker/docker_config.php +++ b/docker/docker_config.php @@ -201,6 +201,7 @@ function run_setup(&$cfg) env_2_cfg_string_array($cfg, 'admin_ip'); env_2_cfg_string_array($cfg, 'upload_ip_nopassword'); env_2_cfg_string_array($cfg, 'proxy_ip'); + env_2_cfg_string_array($cfg, 'disallowed_extensions'); // this is a key value based value env_2_cfg_array_from_json($cfg, 'availabilities'); env_2_cfg_bool($cfg, 'store_uploader_ip'); -- 2.43.0 From 5825452a9810099554dd124a158b0a74af417863 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Mon, 2 Nov 2026 20:37:26 +0100 Subject: [PATCH 09/16] (Very) Simple check for debug output if we are running in Docker --- lib/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/functions.php b/lib/functions.php index 7f03b5f..c660ec3 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1047,6 +1047,7 @@ function jirafeau_admin_bug_report($cfg) $out .= "# OS details
"; $out .= "- OS: " . php_uname() . "
"; + $out .= "- Docker: " . (is_file('/.dockerenv') ? 'yes' : 'no') . "
"; $out .= "
"; $out .= "# Browser details
"; -- 2.43.0 From 31a958b13b5a2c06ec7fdaf31fcb4432bf96d10c Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Wed, 4 Nov 2026 18:05:52 +0100 Subject: [PATCH 10/16] Ignore config.local.php when building the Docker image --- .dockerignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.dockerignore b/.dockerignore index 670c268..ce24959 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ +lib/config.local.php screenshots AUTHORS.md CHANGELOG.md -- 2.43.0 From 16a87073b8e84430d58a866d387c0854b6f9d243 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Wed, 4 Nov 2026 18:13:10 +0100 Subject: [PATCH 11/16] Added EXT_LIM EXT_NOT_ALLOWED to remaining locale files and added German translation --- lib/locales/ar.json | 2 ++ lib/locales/be.json | 2 ++ lib/locales/bn_IN.json | 2 ++ lib/locales/bo.json | 2 ++ lib/locales/ca.json | 2 ++ lib/locales/ckb.json | 2 ++ lib/locales/cs.json | 2 ++ lib/locales/da.json | 2 ++ lib/locales/de.json | 2 ++ lib/locales/el.json | 2 ++ lib/locales/es.json | 2 ++ lib/locales/et.json | 2 ++ lib/locales/fi.json | 2 ++ lib/locales/fr.json | 2 ++ lib/locales/he.json | 2 ++ lib/locales/hi.json | 2 ++ lib/locales/hr.json | 2 ++ lib/locales/hu.json | 2 ++ lib/locales/id.json | 2 ++ lib/locales/it.json | 2 ++ lib/locales/ja.json | 2 ++ lib/locales/ko.json | 2 ++ lib/locales/la.json | 2 ++ lib/locales/mfe.json | 2 ++ lib/locales/ms.json | 2 ++ lib/locales/nb_NO.json | 2 ++ lib/locales/nl.json | 2 ++ lib/locales/pl.json | 2 ++ lib/locales/ps.json | 2 ++ lib/locales/pt.json | 2 ++ lib/locales/pt_BR.json | 2 ++ lib/locales/ro.json | 2 ++ lib/locales/ru.json | 2 ++ lib/locales/sh.json | 2 ++ lib/locales/si.json | 2 ++ lib/locales/sk.json | 2 ++ lib/locales/sl.json | 2 ++ lib/locales/sq.json | 2 ++ lib/locales/sr.json | 2 ++ lib/locales/sv.json | 2 ++ lib/locales/ta.json | 2 ++ lib/locales/template.json | 2 ++ lib/locales/th.json | 2 ++ lib/locales/tr.json | 2 ++ lib/locales/uk.json | 2 ++ lib/locales/vi.json | 2 ++ lib/locales/zh.json | 2 ++ lib/locales/zh_TW.json | 2 ++ 48 files changed, 96 insertions(+) diff --git a/lib/locales/ar.json b/lib/locales/ar.json index 83227b4..8c7dd01 100644 --- a/lib/locales/ar.json +++ b/lib/locales/ar.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/be.json b/lib/locales/be.json index 4dc371c..8a90428 100644 --- a/lib/locales/be.json +++ b/lib/locales/be.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/bn_IN.json b/lib/locales/bn_IN.json index c0d7a26..c115719 100644 --- a/lib/locales/bn_IN.json +++ b/lib/locales/bn_IN.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/bo.json b/lib/locales/bo.json index 9d08b73..2e3a873 100644 --- a/lib/locales/bo.json +++ b/lib/locales/bo.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ca.json b/lib/locales/ca.json index 2d259b9..31cc56e 100644 --- a/lib/locales/ca.json +++ b/lib/locales/ca.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ckb.json b/lib/locales/ckb.json index bbc76bc..3778d4f 100644 --- a/lib/locales/ckb.json +++ b/lib/locales/ckb.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/cs.json b/lib/locales/cs.json index 9db9731..479c51b 100644 --- a/lib/locales/cs.json +++ b/lib/locales/cs.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/da.json b/lib/locales/da.json index af0ccb8..08daf4e 100644 --- a/lib/locales/da.json +++ b/lib/locales/da.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/de.json b/lib/locales/de.json index 8936ee1..18f487e 100644 --- a/lib/locales/de.json +++ b/lib/locales/de.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "Nicht erlaubte Dateitypen:", + "EXT_NOT_ALLOWED": "Dieser Dateityp ist nicht erlaubt", "NO": "Nein", "YES": "Ja", "ENCRYPTED": "Verschlüsselt", diff --git a/lib/locales/el.json b/lib/locales/el.json index 2676b18..e63d83f 100644 --- a/lib/locales/el.json +++ b/lib/locales/el.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/es.json b/lib/locales/es.json index 3c6bac0..3c30602 100644 --- a/lib/locales/es.json +++ b/lib/locales/es.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "No", "YES": "Sí", "ENCRYPTED": "", diff --git a/lib/locales/et.json b/lib/locales/et.json index bbc76bc..3778d4f 100644 --- a/lib/locales/et.json +++ b/lib/locales/et.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/fi.json b/lib/locales/fi.json index debff9c..21ecda8 100644 --- a/lib/locales/fi.json +++ b/lib/locales/fi.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/fr.json b/lib/locales/fr.json index 8629b76..46cea4e 100644 --- a/lib/locales/fr.json +++ b/lib/locales/fr.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "Non", "YES": "Oui", "ENCRYPTED": "", diff --git a/lib/locales/he.json b/lib/locales/he.json index ea0f4e5..19b98d9 100644 --- a/lib/locales/he.json +++ b/lib/locales/he.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/hi.json b/lib/locales/hi.json index fdca622..b112888 100644 --- a/lib/locales/hi.json +++ b/lib/locales/hi.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/hr.json b/lib/locales/hr.json index d1994d6..2c4c99c 100644 --- a/lib/locales/hr.json +++ b/lib/locales/hr.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/hu.json b/lib/locales/hu.json index a4a075e..8632ef5 100644 --- a/lib/locales/hu.json +++ b/lib/locales/hu.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/id.json b/lib/locales/id.json index 24cea50..6696234 100644 --- a/lib/locales/id.json +++ b/lib/locales/id.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/it.json b/lib/locales/it.json index 4be5d53..262d916 100644 --- a/lib/locales/it.json +++ b/lib/locales/it.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "No", "YES": "Sì", "ENCRYPTED": "", diff --git a/lib/locales/ja.json b/lib/locales/ja.json index 04e6735..e81d789 100644 --- a/lib/locales/ja.json +++ b/lib/locales/ja.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ko.json b/lib/locales/ko.json index fdca622..b112888 100644 --- a/lib/locales/ko.json +++ b/lib/locales/ko.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/la.json b/lib/locales/la.json index b5cf0a2..a5b7b13 100644 --- a/lib/locales/la.json +++ b/lib/locales/la.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/mfe.json b/lib/locales/mfe.json index bbc76bc..3778d4f 100644 --- a/lib/locales/mfe.json +++ b/lib/locales/mfe.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ms.json b/lib/locales/ms.json index 27575f7..670834c 100644 --- a/lib/locales/ms.json +++ b/lib/locales/ms.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/nb_NO.json b/lib/locales/nb_NO.json index 939f52b..40d7487 100644 --- a/lib/locales/nb_NO.json +++ b/lib/locales/nb_NO.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/nl.json b/lib/locales/nl.json index c817eee..1ff7fc2 100644 --- a/lib/locales/nl.json +++ b/lib/locales/nl.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/pl.json b/lib/locales/pl.json index d70f0de..cf13ca9 100644 --- a/lib/locales/pl.json +++ b/lib/locales/pl.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ps.json b/lib/locales/ps.json index bbc76bc..3778d4f 100644 --- a/lib/locales/ps.json +++ b/lib/locales/ps.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/pt.json b/lib/locales/pt.json index 812b59d..f93a029 100644 --- a/lib/locales/pt.json +++ b/lib/locales/pt.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/pt_BR.json b/lib/locales/pt_BR.json index 1e36b53..145c6c5 100644 --- a/lib/locales/pt_BR.json +++ b/lib/locales/pt_BR.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ro.json b/lib/locales/ro.json index 6d76460..00eb47a 100644 --- a/lib/locales/ro.json +++ b/lib/locales/ro.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ru.json b/lib/locales/ru.json index 6b0f951..98a490b 100644 --- a/lib/locales/ru.json +++ b/lib/locales/ru.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sh.json b/lib/locales/sh.json index bbc76bc..3778d4f 100644 --- a/lib/locales/sh.json +++ b/lib/locales/sh.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/si.json b/lib/locales/si.json index 842db6c..e713a3a 100644 --- a/lib/locales/si.json +++ b/lib/locales/si.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sk.json b/lib/locales/sk.json index 8c42dc5..5151b3b 100644 --- a/lib/locales/sk.json +++ b/lib/locales/sk.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sl.json b/lib/locales/sl.json index 463d58b..65dd58b 100644 --- a/lib/locales/sl.json +++ b/lib/locales/sl.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sq.json b/lib/locales/sq.json index bbc76bc..3778d4f 100644 --- a/lib/locales/sq.json +++ b/lib/locales/sq.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sr.json b/lib/locales/sr.json index 6aca55f..e6c2671 100644 --- a/lib/locales/sr.json +++ b/lib/locales/sr.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/sv.json b/lib/locales/sv.json index 59c215b..b8778ea 100644 --- a/lib/locales/sv.json +++ b/lib/locales/sv.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/ta.json b/lib/locales/ta.json index c46fd97..6116896 100644 --- a/lib/locales/ta.json +++ b/lib/locales/ta.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/template.json b/lib/locales/template.json index ce688bf..6b31c4e 100644 --- a/lib/locales/template.json +++ b/lib/locales/template.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/th.json b/lib/locales/th.json index bbc76bc..3778d4f 100644 --- a/lib/locales/th.json +++ b/lib/locales/th.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/tr.json b/lib/locales/tr.json index 76287db..675bd2a 100644 --- a/lib/locales/tr.json +++ b/lib/locales/tr.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/uk.json b/lib/locales/uk.json index bd8f31c..3cddd54 100644 --- a/lib/locales/uk.json +++ b/lib/locales/uk.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/vi.json b/lib/locales/vi.json index 35bb24e..52ce1b0 100644 --- a/lib/locales/vi.json +++ b/lib/locales/vi.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/zh.json b/lib/locales/zh.json index 5b01550..4811364 100644 --- a/lib/locales/zh.json +++ b/lib/locales/zh.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", diff --git a/lib/locales/zh_TW.json b/lib/locales/zh_TW.json index 43877f5..7d08dc5 100644 --- a/lib/locales/zh_TW.json +++ b/lib/locales/zh_TW.json @@ -1,4 +1,6 @@ { + "EXT_LIM": "", + "EXT_NOT_ALLOWED": "", "NO": "", "YES": "", "ENCRYPTED": "", -- 2.43.0 From 31055e9be977d176b233b54edf11d5a82397ff85 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Fri, 13 Nov 2026 19:44:59 +0100 Subject: [PATCH 12/16] Updated CHANGELOG --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c463437..bd7e318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,12 @@ 5. Follow the installation wizard, it should propose you the same data folder or even update automatically 6. Check your `/lib/config.local.php` and compare it with the `/lib/config.original.php` to see if new configuration items are available. If a new item is missing in your `config.local.php`, this may trigger some errors as Jirafeau may expect to have them. -## Version 4.7.x (not yet released) +## Version 4.8.0 (not yet released) +- Allow to configure file extensions disallowed from being uploaded. +- It was possible for an unauthenticated attacker to abuse the asynchronous upload workflow to write attacker-controlled data outside the intended directory and finalize it as a real Jirafeau file/link object. - Download stats are written before a one-time link is deleted. The other way around would cause write attempts to a directory that was already gone. +- Fixed downloading password-protected download using `script.php`. - The `time` parameter is now optional in `script.php` - Few little more fixes and refactoring - ... -- 2.43.0 From 9b334d5232964c328d895b55026dfec48ab4cb31 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Fri, 13 Nov 2026 19:45:54 +0100 Subject: [PATCH 13/16] We require PHP 8.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d3de30..48bd7a6 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ also use a [docker image](https://gitlab.com/jirafeau/Jirafeau/container_registr it yourself. Check [docker folder](docker/README.md) for more information. System requirements: -- PHP >= 7.4 +- PHP >= 8.1 - Optional, but recommended: Git >= 2.7 - No database required, no mail required -- 2.43.0 From a1d47e7e8ce29d48801c0ceacb5b4e9191d5aac9 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Sun, 15 Nov 2026 14:51:39 +0100 Subject: [PATCH 14/16] Updated CHANGELOG, AUTHORS and Docker README --- AUTHORS.md | 1 + CHANGELOG.md | 10 ++++++---- docker/README.md | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 84f5110..710511c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -84,6 +84,7 @@ This is a list of people who contributed to Jirafeau over the years. The list wa - omar anwar aglan - Oskar Fagerfjäll - Patrick Canterino +- Pedro Delgado - Pierre-Alain Bandinelli - pixelbrackets - Poorchop diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7e318..92b1190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,15 +14,17 @@ ## Version 4.8.0 (not yet released) -- Allow to configure file extensions disallowed from being uploaded. -- It was possible for an unauthenticated attacker to abuse the asynchronous upload workflow to write attacker-controlled data outside the intended directory and finalize it as a real Jirafeau file/link object. +- Allow to configure file extensions forbidden from being uploaded. +- It was possible for an unauthenticated attacker to abuse the asynchronous upload workflow to write attacker-controlled data outside the intended directory and finalize it as a real Jirafeau file/link object. This was reported by Pedro Delgado. - Download stats are written before a one-time link is deleted. The other way around would cause write attempts to a directory that was already gone. -- Fixed downloading password-protected download using `script.php`. +- Fixed downloading password-protected files using `script.php`. - The `time` parameter is now optional in `script.php` - Few little more fixes and refactoring -- ... - Upgrade from 4.7.2: in-place upgrade +New configuration items: +- `disallowed_extensions` for configuring the forbidden file extensions + ## Version 4.7.2 - Added a button for showing the download password before uploading the file diff --git a/docker/README.md b/docker/README.md index 619772a..77dddd8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -96,6 +96,7 @@ Available options: - `ONE_TIME_DOWNLOAD_PRESELECTED`: set to 1 or 0 to preselect the checkbox for one time downloads. - `ENABLE_CRYPT`: set to 1 or 0 to enable or disable server side encryption. - `DEBUG`: set to 1 or 0 to enable or disable debug mode. +- `DEBUG_ENFORCE_CLASSIC_UPLOAD`: set to 1 or 0 to enforce the classic (synchronous) file upload mechanism. - `MAXIMAL_UPLOAD_SIZE`: maximal file size allowed (expressed in MB). - `UPLOAD_PASSWORD`: set one or more passwords to access Jirafeau (separated by comma). - `UPLOAD_IP`: set one or more ip allowed to upload files (separated by comma). -- 2.43.0 From e89ffa8b97e5bd2dcfe08db4f8944690629f3ced Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Sun, 15 Nov 2026 14:55:58 +0100 Subject: [PATCH 15/16] Updated README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 48bd7a6..ebec88e 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Welcome to the official Jirafeau project, an [Open-Source software](https://en.w Jirafeau is a "one-click-filesharing": Select your file, upload, share a link. That's it. -See [jirafeau.net](https://jirafeau.net/) for a demo. - ![Screenshot1](screenshots/upload1.png) ## DISCLAMER @@ -29,6 +27,7 @@ In this repository we are aiming to continue development of the original Jirafea - Option to require, check or generate file download passwords - Set expiration time for downloads - Option to self-destruct after first download +- Option to configure forbidden file extensions - Shortened URLs using Base64 encoding - Maximal upload size configurable - No database, only use basic PHP -- 2.43.0 From 8f196e16aebd9aa84bf8c6d356d499dec4e9885e Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Sun, 15 Nov 2026 14:57:09 +0100 Subject: [PATCH 16/16] Jirafeau 4.8.0 is ready --- CHANGELOG.md | 2 +- lib/settings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b1190..539a936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ 5. Follow the installation wizard, it should propose you the same data folder or even update automatically 6. Check your `/lib/config.local.php` and compare it with the `/lib/config.original.php` to see if new configuration items are available. If a new item is missing in your `config.local.php`, this may trigger some errors as Jirafeau may expect to have them. -## Version 4.8.0 (not yet released) +## Version 4.8.0 - Allow to configure file extensions forbidden from being uploaded. - It was possible for an unauthenticated attacker to abuse the asynchronous upload workflow to write attacker-controlled data outside the intended directory and finalize it as a real Jirafeau file/link object. This was reported by Pedro Delgado. diff --git a/lib/settings.php b/lib/settings.php index 55bf11a..0ab54f3 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -43,7 +43,7 @@ if ($cfg['debug'] === true) { /* Jirafeau package */ define('JIRAFEAU_PACKAGE', 'Jirafeau'); -define('JIRAFEAU_VERSION', '4.7.x-dev'); +define('JIRAFEAU_VERSION', '4.8.0'); define('JIRAFEAU_WEBSITE', 'https://gitlab.com/jirafeau/Jirafeau'); -- 2.43.0