Repository navigation
Widen the upload blocklist to the executable spellings it forgot - #48
Merged
AllTerrainDeveloper merged 1 commit intoAug 29, 2026
Merged
Conversation
The Forminator arbitrary-upload bug (CVE-2026-15748) turned on two things: a handler that trusted upload-field configuration from the request, and a dangerous-extension check that matched pipe-joined MIME keys with exact comparison. We share neither — the accepted types come from the stored schema, and the check matches one real extension against a flat set — but that flat set was not as complete as it claimed. Add the executable spellings a bypass reaches for precisely because a shorter list forgets them: pht, phtm, php1/php2/php6, phpt, hphp, and the SSI trio shtml/shtm/stm. Even without them a crafted name was caught by the byte check and the deny-all directory; a blocklist that is the unconditional first gate should not lean on the layers behind it to cover a spelling. With a dedicated upload-security suite pinning both defenses: every executable extension refused even when the field's own allow-list names it, a double extension caught by the byte check, and — the Forminator lesson in one assertion — accepted types read from the schema while a forged config in the request changes nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVAaHFURDGeBzeuWHZ2dcP
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.
Why
Prompted by the Forminator arbitrary file upload write-up (CVE-2026-15748, CVSS 9.8, ~600k sites). I audited our upload path against its two root causes.
We share neither root cause — this PR is defense-in-depth, not a fix for an active hole.
alltfo_handle_uploads()readsfiletypes/maxsize/maxfilesonly fromalltfo_get_form_schema($form_id)— the stored form. The request supplies bytes, never configuration.php|php3|…)pathinfoextension against a flat set — no alternation to hide inside — thenwp_check_filetype_and_ext()sniffs bytes,wp_handle_upload()runs with amimesmap scoped to the field, files land under a hashed name in aRequire all denieddirectory asprivateattachments.Also confirmed: no standalone/
noprivupload endpoint (Forminator'shandle_file_uploadwas directly reachable); ours only runs inside the authenticated-or-not submission pipeline, after nonce/spam gating.What changed
The blocklist claimed to cover "anything the web server might execute" but omitted several real spellings. Added:
pht,phtm,php1,php2,php6,phpt,hphp, and the SSI trioshtml/shtm/stm. These were already caught by the byte check + deny-all directory in practice, but the unconditional first gate shouldn't rely on the layers behind it to cover a missing spelling.Tests
New
tests/phpunit/tests/uploads.php(4 tests, 37 assertions):evil.php.jpgcaught by the byte checkfiletypesin the request changes nothing.txtis accepted and storedprivate744 PHPUnit ✓ · PHPCS 0 errors🤖 Generated with Claude Code
https://claude.ai/code/session_01DVAaHFURDGeBzeuWHZ2dcP