Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down