document that the upload folder argument is trusted app input#1306
Merged
Conversation
Document that the folder/destination_folder argument of sqlpage.persist_uploaded_file must be chosen by the app author and never derived from untrusted request data. It is joined directly to the web root, so a value containing '..' or an absolute path would write the uploaded file outside the web root. Docs-only clarification of existing intended behavior; no logic change.
6f1e537 to
5d806b4
Compare
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.
document that the upload
folderargument is trusted app inputsqlpage.persist_uploaded_file(field, folder, ...)resolvesfolderrelative to the web root by joining it directly (functions.rs#L515-L517). Afoldercontaining..or an absolute path therefore writes the uploaded file outside the web root. This is intended behavior:folderis meant to be a constant the app author chooses, not request data.The docs never said this explicitly, so this PR adds the warning. No code path changes, no CHANGELOG entry (docs only).
39_persist_uploaded_file.sql: security note on thedestination_folderparameter (the function reference page).functions.rs: comment-only clarification thatfolderis trusted input.Verify the diff is docs/comment only: