permission: fix some vulnerabilities in fs#47091
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Mar 19, 2023
Merged
permission: fix some vulnerabilities in fs#47091nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Collaborator
RafaelGSS
reviewed
Mar 14, 2023
Member
RafaelGSS
left a comment
There was a problem hiding this comment.
Good catch. I wasn't aware of write_as_side_effects. That's indeed bizarre.
marco-ippolito
approved these changes
Mar 15, 2023
Without this patch, any restrictions imposed by the permission model can be easily bypassed, granting full read and write access to any file. On Windows, this could even be used to delete files that are supposed to be write-protected. Fixes: nodejs#47090
c291faa to
233eb62
Compare
Member
Author
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
Both Jenkins CI runs failed on Windows due to |
22 tasks
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
19 tasks
Member
Author
|
It might be good to get more eyes on this, perhaps from @nodejs/libuv since especially the behavior on Windows depends more on how libuv translates flags than on Windows itself. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
23 tasks
This comment was marked as outdated.
This comment was marked as outdated.
Trott
approved these changes
Mar 18, 2023
19 tasks
Collaborator
Collaborator
|
Landed in aa30e16 |
This was referenced Mar 20, 2023
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.
Without this patch, any restrictions imposed by the permission model can be easily bypassed, granting full read and write access to any file. On Windows, this could even be used to delete files that are supposed to be write-protected.
This likely also fixes a separate bug in
fsPromises.open(), which currently incorrectly requires read permissions even for write-only access. (Unless that was somehow intentional?)I'm not very confident in my understanding of the permission model. Please review carefully.
Fixes: #47090