Repository navigation
Harden upload and lazy endpoints - #9
Merged
Merged
Conversation
- Validate the upload component id before it is used in the storage path - Reject server-executable file extensions, including double extensions - Sign lazy placeholders (class, id, params) and verify on /ripple/lazy - Refuse to lazy-load components without #[Lazy] - Use a derived key for lazy signatures so state signatures never match
xentixar
requested changes
Oct 30, 2026
xentixar
left a comment
Member
There was a problem hiding this comment.
@abdulmajidcse
Thanks, looks good overall. Two nits before I approve:
- Invalid lazy signatures should return 403, not 500.
- Prefer an upload extension allowlist (configurable) over the current denylist.
- Throw InvalidSignatureException and answer /ripple/lazy with 403 JSON - Keep the lazy placeholder when the load is rejected - Add configurable file_upload.allowed_extensions (RIPPLE_FILE_ALLOWED_EXTENSIONS) - Keep executable extensions blocked even when listed in the allowlist
Member
Author
|
@xentixar Thanks for the review. Both points are addressed in f195fd1:
Tests are updated (156 passing), and CI is green. Ready for another look. |
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.
Summary
Fixes two security issues in the request endpoints.
Uploads (
/ripple/upload)iis now validated ([A-Za-z0-9_-]{1,64}) before it is used as a storage folder. Invalid ids return400.file_upload.allowed_extensions(RIPPLE_FILE_ALLOWED_EXTENSIONS, array or comma-separated). The default covers common images, documents, archives and media. Anything else is rejected with422.php*,phtml,phar,htaccess,ini,cgi,py,sh, …) are always rejected, even if listed, including double extensions such asx.php.jpg.[a-z0-9]{1,16}.FileUploadService::storeTemporary()for direct callers.Lazy loading (
/ripple/lazy)data-ripple-lx), which the client sends back asx./ripple/lazyanswers403with{"ok": false, "message": …}when the signature does not match, so mount params (which may set#[Locked]properties) can no longer be supplied by the client.loadLazy()refuses components without#[Lazy].Notes
allowed_extensions; uploads without an extension are rejected.resources/dist/ripple.min.jsis rebuilt from source.Tests
composer test(156 tests),composer analyseandcomposer cs-checkpass.