Uh oh!
There was an error while loading. Please reload this page.
permission: fix some vulnerabilities in fs - #47091
Merged
nodejs-github-bot merged 1 commit intoMar 19, 2023
Merged
Conversation
nodejs-github-bot
commented
Mar 14, 2023
Collaborator
RafaelGSS
left a comment
Member
There was a problem hiding this comment.
Good catch. I wasn't aware of write_as_side_effects. That's indeed bizarre.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
tniessenforce-pushed
the
permission-fix-some-fatal-flaws-in-fs-open
branch
from
March 15, 2023 19:05
c291faa to
233eb62Comparetniessen
commented
Mar 15, 2023
MemberAuthor
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
tniessen
commented
Mar 15, 2023
MemberAuthor
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
tniessen
commented
Mar 17, 2023
MemberAuthor
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
nodejs-github-bot
commented
Mar 19, 2023
Collaborator
nodejs-github-bot
commented
Mar 19, 2023
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 freeto 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