Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent directory traversal on SSR #1241

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

jometzner
Copy link
Collaborator

@jometzner jometzner commented Aug 11, 2022

PR Type

[X] Bugfix

What Is the Current Behavior?

It is possible to get file contents from the underlying container files system by passing a relative file system path behind any .js or .css resource url (valid for PWA 1.0 to 2.1.0).

For example:

https://host/.js?/../../../../etc/hosts would potentially leak the contents of file /etc/hosts

What Is the New Behavior?

You'll get a 404 when trying to breakout of the server determined BROWSER_FOLDER.
(This is already fixed with 2.1.0 but this fix adds an additional check to prevent the unwanted behavior)

Does this PR Introduce a Breaking Change?

[X] No

Other Information

https://nodejs.org/en/knowledge/file-system/security/introduction/#preventing-directory-traversal

AB#78766

@jometzner jometzner added this to the 3.0 milestone Aug 11, 2022
@SGrueber SGrueber requested a review from shauke August 11, 2022 12:17
@shauke shauke merged commit c7d8d00 into develop Aug 11, 2022
@shauke shauke deleted the fix/prevent-directory-traversal branch August 11, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants