Guides: Add note on ActiveStorage URL security#40675
Merged
composerinteralia merged 1 commit intorails:masterfrom Nov 25, 2020
Merged
Guides: Add note on ActiveStorage URL security#40675composerinteralia merged 1 commit intorails:masterfrom
composerinteralia merged 1 commit intorails:masterfrom
Conversation
daa1ee8 to
82b3aa1
Compare
Member
composerinteralia
left a comment
There was a problem hiding this comment.
Thanks for following up with this addition to the documentation. Since this PR doesn't include other code changes, please add [ci skip] to the commit message to avoid running CI (otherwise it looks like the build is failing for unrelated reasons).
d24507f to
f2b6ed8
Compare
It might be non-obvious to a user that's new to ActiveStorage, how access control to files is handled.
f2b6ed8 to
db4a201
Compare
Contributor
Author
|
Integrated your proposed change. CI is now passing (though I wasn't able to make it not run 🙄) |
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.
This Pull Request is based on the response I received in #40462.
It might be non-obvious to users who are new to ActiveStorage, how access control to files is handled. While the "Avatar" example is innocent enough, other people might use ActiveStorage for invoices or other kinds of sensitive material. I think they should at least be made aware of the security model of these links so that they can decide whether they need to take further steps.
Further documentation?
I came to this problem from the opposite side: We are uploading files from an authenticated area, but they need to be publicly accessible. However, our authentication is enabled through a rack middleware based on the request path. So we actually had to allow access to a specific path, otherwise the files would not have been accessible.
Do you think it might make sense to add details on the URL's from which blobs would be served to the guides? Or would this be something that developers are supposed to find out on their own by inspecting the routes? (I can see arguments in both directions)