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

[plugin-host] Path traversal + XSS fix #5746

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Conversation

paul-marechal
Copy link
Member

The plugin host used to send unescaped responses via HTML, leading to
a potential XSS vulnerability. Also, no constraint was applied to the file
serving functionality, which means that you can get served any file on
the filesystem if you add enough ../ parts in the requested path,
walking past the plugin's root being served.

This commit prevents clients to request something past the plugin's
root, and also encodes the plugin id -requested by the client- in its response.

Signed-off-by: Paul Maréchal paul.marechal@ericsson.com

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I verify this?

packages/plugin-ext/package.json Outdated Show resolved Hide resolved
packages/plugin-ext/package.json Show resolved Hide resolved
@benoitf
Copy link
Contributor

benoitf commented Jul 19, 2019

linked to #4168 ?

@akosyakov akosyakov added the plug-in system issues related to the plug-in system label Jul 19, 2019
@paul-marechal
Copy link
Member Author

paul-marechal commented Jul 19, 2019

How can I verify this?

For the XSS injection, simply make requests -using your browser maybe- like ...theia/hostedPlugin/%3Cscript%3Ealert(1)%3C%2Fscript%3E/.

For the path traversal, you need to have at least one plugin, then in the "path" part of the URL, you can walk past the plugin root being served, and get anything you want.

@paul-marechal paul-marechal force-pushed the mp/plugin-host-tmp branch 2 times, most recently from b8a9899 to 0a09d41 Compare August 1, 2019 16:00
@akosyakov akosyakov added the vscode issues related to VSCode compatibility label Aug 6, 2019
@akosyakov
Copy link
Member

@marechal-p Is there a reason why it is not merged? I've seen that @benoitf verified that relative paths are still working.

@paul-marechal
Copy link
Member Author

I was away and forgot, will rebase and merge.

The plugin host used to send unescaped responses via HTML, leading to
a potential XSS vulnerability. Also, no constraint was applied to the file
serving functionality, which means that you can get served any file on
the filesystem if you add enough `../` parts in the requested path,
walking past the plugin's root being served.

This commit prevents clients to request something past the plugin's
root, and also encodes the plugin id -requested by the client- in its response.

Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
@paul-marechal paul-marechal merged commit 62fe752 into master Aug 7, 2019
@paul-marechal paul-marechal deleted the mp/plugin-host-tmp branch August 7, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants