From b187a42f029790441d0f555f532b77ce5567ce9f Mon Sep 17 00:00:00 2001 From: ildyria Date: Wed, 18 Jun 2025 00:55:32 +0200 Subject: [PATCH] comments from d4715 --- docs/releases.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/releases.md b/docs/releases.md index b656121e..bd36e79b 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -50,17 +50,17 @@ Or modify the value of `APP_KEY` in your `.env` file. This will also invalidate #### The vulnerability -This vulnerability miss-uses the `$path` variable sent to the server, which is used to access the photos via the `SecurePathController`. +This vulnerability misuses the `$path` variable sent to the server, which is used to access the photos via the `SecurePathController`. We wrongly assumed that `Storage::disk(StorageDiskType::LOCAL->value)->path($path);` was protected against path traversal attacks which lead to this vulnerability. -When both the encrypted links and the temporary links are disabled, it is possible to call the endpoint with fictitious path values. Ironically, by enabling either of the functionality, the endpoint becomes secure again. +When both the encrypted links and the temporary links are disabled, it is possible to call the endpoint with path values that are out of scope. Ironically, by enabling either of the functionality, the endpoint becomes secure again. #### The fix We applied defense in depth: -1. when neither functionality are enabled, we directly return a 401/403 error on any call to `/image/{path}`. -2. when either of the functionality are enabled, we check that the `$path` value generated by `Storage::disk(StorageDiskType::LOCAL->value)->path($path);` is within the intended image directory. Should this happen, we return a 418 error code (I'm a teapot) which can later be used to detect malicious calls and combined with fail-2-ban to block the IP address of the attacker. +1. when neither functionality is enabled, we directly return a 401/403 error on any call to `/image/{path}`. +2. when either of the functionalities are enabled, we check that the `$path` value generated by `Storage::disk(StorageDiskType::LOCAL->value)->path($path);` is within the intended image directory. Should this happen, we return a 418 error code (I'm a teapot) which can later be used to detect malicious calls and combined with fail-2-ban to block the IP address of the attacker. #### Credits