Repository navigation
README: document PHP_NO_EXEC_PATHS=/storage/* for Laravel - #14
Merged
Merged
Conversation
The base image ships no no-exec policy, so a .php file dropped under /storage (the Livewire GHSA-29cq-5w36-x7w3 exploit path) executes when requested. Tested on the 8.4-frankenphp image: with the setting, PHP under /storage returns 404/400 and never runs, while other files still serve. ALI-1102
… is covered Review of #14 found the 404/400 summary omitted the 308 redirect a trailing slash gets (verified: shell.php/ -> 308 -> shell.php -> 404), and that the section did not say the rule covers only the /storage/ URL path.
Member
Author
Review round 1 (fresh-context reviewer,
|
| Finding | Outcome |
|---|---|
| P3: "404 or 400" omits the 308 a trailing slash gets | Fixed in 79f8dbc after verifying shell.php/ -> 308 -> shell.php -> 404. |
P3: the rule covers only the /storage/ URL path; apps serving uploads elsewhere need to add it |
Fixed in 79f8dbc (one clause in the same paragraph). |
P3: exact /storage (no slash) falls through to the front controller |
Declined. It runs public/index.php, the app itself, not storage content. Harmless. |
P3: /storage/a.php.jpg is served as image/jpeg with the PHP source as its bytes |
Declined. Normal static serving; it is not executed. The hide-extension rule only targets a trailing extension by design. |
| Scope: base image default left empty | Kept, as the ticket recommends. The reviewer noted nothing here claims the consumer check was done; it was not. Whether to default /storage/* stays open on ALI-1102 until Alios and other consumers are checked. |
Not run: nothing beyond local containers; this is README-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes ALI-1102 (https://linear.app/alias-project-inc/issue/ALI-1102).
Why
The base image ships no no-exec policy, so a
.phpfile under/storageexecutes when requested. That is the path the Livewire RCE (GHSA-29cq-5w36-x7w3) was exploited through in the wild. Upstream serversideup blocks it by default (their PR #641); we have the stronger mechanism (PHP_NO_EXEC_PATHS) but nothing set for Laravel.What
README only: a "Laravel hardening" section with the recipe.
Tested
Against the local
8.4-frankenphpimage with a fixture app:PHP_NO_EXEC_PATHS=/storage/*/storage/a/b/shell.php/storage/a/b/shell.php/foo/storage/SHELL.PHP/storage/pic.png/index.phpNot in this PR
Defaulting the setting in the base image. That stays a decision on the ticket: only do it after checking that no consumer serves PHP from
/storage.